source: rtems/configure.in @ f95d2b53

4.104.114.84.95
Last change on this file since f95d2b53 was f95d2b53, checked in by Joel Sherrill <joel.sherrill@…>, on 07/17/98 at 15:49:12

Patch from Ralf Corsepius <corsepiu@…>. Comments:

  • Added support for bsd "install" ($(BSDINSTALL)) to host.cfg.in, i.e. the standard "install" program that most packages (including automake) use. In Makefiles outside of rtems, "install" normally is referenced by $(INSTALL), but rtems already uses $(INSTALL) for install-if-change, hence I used $(BSDINSTALL) instead to keep up backward compatibility.
  • Removed references to @GREP@ etc. from host.cfg.in, as configure.in doesn't check for them (Minor cleanup).
  • Added installation flags INST*FLAGS to host.cfg.in, which should replace -m XXXX flags for installation calls.

*Changes to gcc.cfg to enable it to build host programs from multiple
sources files.
Should not disturb existing sources, but neccessary.

  • There was a not-so-minor bug in the configuration files: "make install" and "make debug_install" don't work in all subdirectories!! I tried to fix this by adding "install" to MTARGETS in main.cfg, which seems to solve most of the problems. But there still seem to be rare (?) cases where "make debug_install" still seems to have problems.
  • Changes to many host related tool-Makefiles to demonstrate the abilities of INST*FLAGS, BSDINSTALL and the new rules in gcc.cfg. ..of cause ... but BSDINSTALL is THE standard method to install files in most program packages besides rtems. This part of the patch fixes some minor protection setting problems, but doesn't support TARGET_VARIANTS

NOTE:
I hope you will like the BSDINSTALL, INST*FLAGS stuff. It is a step to
get rid of "install-if-change" and to rely on a more standard
installation procedure. If you don't like BSDINSTALL, removing it from
the patch isn't difficult- just grep for BSDINSTALL and replace
BSDINSTALL with INSTALL or MKDIR.

FINALLY:
I still have another patch pending (well, not a complete patch yet, it's
a partial patch to demonstrate the principle), which adds automatic
rebuilding of files generated by autoconf/configure. At the moment I
don't dare to submit it, because integrating this patch would require to
modify all Makefile.ins because we'd need to add a new "include " line
to each Makefile.in.

  • Property mode set to 100644
File size: 13.6 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl
3dnl  $Id$
4
5AC_PREREQ(2.12)
6AC_INIT(README)
7
8dnl Checks for programs.
9AC_PROG_MAKE_SET
10AC_CANONICAL_SYSTEM
11AC_ARG_WITH(cross-host,[  --with-cross-host=HOST      host (cygnus)], \
12host=$withval)
13
14AC_ARG_ENABLE(gmake-print-directory, \
15[  --enable-gmake-print-directory    enable GNU Make's print directory], \
16[case "${enableval}" in
17  yes) RTEMS_USE_OWN_PDIR=no ;;
18  no) RTEMS_USE_OWN_PDIR=yes ;;
19  *)  AC_MSG_ERROR(bad value ${enableval} for gmake-print-directory option) ;;
20esac],[RTEMS_USE_OWN_PDIR=yes])
21
22AC_ARG_ENABLE(posix, \
23[  --enable-posix                   enable posix interface], \
24[case "${enableval}" in
25  yes) RTEMS_HAS_POSIX_API=yes ;;
26  no) RTEMS_HAS_POSIX_API=no ;;
27  *)  AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
28esac],[RTEMS_HAS_POSIX_API=yes])
29
30AC_ARG_ENABLE(ka9q, \
31[  --enable-ka9q                enable KA9Q TCP/IP stack], \
32[case "${enableval}" in
33  yes) RTEMS_HAS_KA9Q=yes ;;
34  no) RTEMS_HAS_KA9Q=no ;;
35  *)  AC_MSG_ERROR(bad value ${enableval} for enable-ka9q option) ;;
36esac],[RTEMS_HAS_KA9Q=yes])
37
38AC_ARG_ENABLE(rtems-inlines, \
39[  --enable-rtems-inlines           enable RTEMS inline functions (use macros)], \
40[case "${enableval}" in
41  yes) RTEMS_USE_MACROS=no ;;
42  no) RTEMS_USE_MACROS=yes ;;
43  *)  AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
44esac],[RTEMS_USE_MACROS=no])
45
46AC_ARG_ENABLE(cxx, \
47[  --enable-cxx            enable C++ support, and build the rtems++ library], \
48[case "${enableval}" in
49  yes) RTEMS_HAS_CPLUSPLUS=yes ;;
50  no) RTEMS_HAS_CPLUSPLUS=no   ;;
51  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
52esac], [RTEMS_HAS_CPLUSPLUS=no])
53
54AC_ARG_ENABLE(gcc28, \
55[  --enable-gcc28                   enable use of gcc 2.8.x features], \
56[case "${enableval}" in
57  yes) RTEMS_USE_GCC272=no ;;
58  no) RTEMS_USE_GCC272=yes ;;
59  *)  AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
60esac],[RTEMS_USE_GCC272=no])
61
62AC_ARG_ENABLE(libcdir, \
63[  --enable-libcdir=directory       set the directory for the C library], \
64[ RTEMS_LIBC_DIR="${enableval}" ; \
65test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
66
67AC_ARG_ENABLE(bare-cpu-cflags,
68[  --enable-bare-cpu-cflags          \
69         specify a particular cpu cflag (bare bsp specific)],
70[case "${enableval}" in
71  no) BARE_CPU_CFLAGS="" ;;
72  *)    BARE_CPU_CFLAGS="${enableval}" ;;
73esac],
74[BARE_CPU_CFLAGS=""])
75
76AC_ARG_ENABLE(bare-cpu-model,
77[  --enable-bare-cpu-model              \
78         specify a particular cpu model (bare bsp specific)],
79[case "${enableval}" in
80  no)   BARE_CPU_MODEL="" ;;
81  *)    BARE_CPU_MODEL="${enableval}" ;;
82esac],
83[BARE_CPU_MODEL=""])
84
85RTEMS_PREFIX=${target_cpu}-${target_vendor}
86
87dnl BEGIN configure.host.in
88
89AC_PATH_PROG(CAT,cat)
90AC_PATH_PROG(RM,rm)
91AC_PATH_PROG(CP,cp)
92AC_PATH_PROG(MV,mv)
93AC_PATH_PROG(LN,ln)
94AC_PROG_LN_S
95AC_PATH_PROG(CHMOD,chmod)
96AC_PATH_PROG(SORT,sort)
97AC_PROG_INSTALL
98
99dnl check mkdir behaviour, try to get mkdir -p -m 0755
100RTEMS_PATH_MKDIR
101RTEMS_PROG_MKDIR_M
102RTEMS_PROG_MKDIR_P
103test "$rtems_cv_prog_MKDIR_P" = "yes" && MKDIR="$MKDIR -p"
104test "$rtems_cv_prog_MKDIR_M" = "yes" && MKDIR="$MKDIR -m 0755"
105
106AC_PATH_PROG(TOUCH,touch)
107AC_PATH_PROG(CMP,cmp)
108
109AC_PATH_PROG(SED,sed)
110AC_PATH_PROGS(M4,gm4 m4)
111
112dnl NOTE: prefer bash over ksh over sh
113AC_PATH_PROGS(KSH,bash ksh sh)
114
115if test -z "$KSH"; then
116dnl NOTE: This cannot happen -- /bin/sh must always exist
117AC_MSG_ERROR(
118[***]
119[    Cannot determine a usable shell bash/ksh/sh]
120[    Please contact your system administrator] );
121fi
122
123dnl BEGIN configure.target.in
124
125dnl echo "TARGET"
126dnl echo "    cpu    --> $target_cpu"
127dnl echo "    os     --> $target_os"
128dnl echo "    vendor --> $target_vendor"
129
130dnl canonicalize target name
131dnl NOTE: Most rtems targets do not fullfil autoconf
132dnl targets naming conventions "processor-vendor-os"
133dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
134dnl and we have to fix it for rtems ourselves
135dnl
136dnl The original plan was to do CPU-BSP-rtems or CPU-rtems to
137dnl imply all BSPs.  Eventually we would like to build a collection
138dnl of CPU model specific RTEMS libraries which in conjunction with
139dnl a BSP library would be used to link an application.
140
141RTEMS_HOST=$host_os
142
143case "${target}" in
144  # hpux unix port should go here
145  i[[3456]]86-go32-rtems*)
146        target_cpu=i386
147        rtems_bsp="go32 go32_p5"
148        skip_startfiles="yes"
149        RTEMS_HAS_POSIX_API=no
150        ;;
151  i[[3456]]86-pc-linux*)         # unix "simulator" port
152        target_cpu=unix
153        RTEMS_HOST=Linux
154        # override these settings
155        RTEMS_HAS_POSIX_API=no
156        ;;
157  i[[3456]]86-*freebsd2*) # unix "simulator" port
158        target_cpu=unix
159        RTEMS_HOST=FreeBSD
160        # override these settings
161        RTEMS_HAS_POSIX_API=no
162        ;;
163  no_cpu-*rtems*)
164        target_cpu=no_cpu
165        RTEMS_HAS_POSIX_API=no
166        ;;
167  ppc*-*rtems*)
168        target_cpu=powerpc
169        ;;
170  sparc-sun-solaris*)             # unix "simulator" port
171        target_cpu=unix
172        RTEMS_HOST=Solaris
173        # override these settings
174        RTEMS_HAS_POSIX_API=no
175        ;;
176  *)
177        RTEMS_CANONICAL_TARGET_CPU
178        ;;
179esac
180
181# Override the set of BSPs to be built.
182AC_ARG_ENABLE(rtemsbsp, \
183  [  --enable-rtemsbsp=bsp1 bsp2 ..   BSPs to include in build], \
184      rtems_bsp=$enableval \
185)
186
187# Is this a supported CPU?
188AC_MSG_CHECKING([if cpu $target_cpu is supported])
189if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
190  AC_MSG_RESULT(yes)
191  makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
192else
193  AC_MSG_ERROR(no)
194fi
195
196RTEMS_TOOL_PREFIX
197
198dnl check target cc
199RTEMS_PROG_CC
200dnl check if the compiler supports --specs
201RTEMS_GCC_SPECS
202dnl check if the target compiler may use --pipe
203RTEMS_GCC_PIPE
204
205dnl check if the compiler supports --specs if gcc28 is requested
206if test "$RTEMS_USE_GCC272" != "yes" ; then
207  if test "$rtems_cv_gcc_specs" = "no"; then
208    AC_MSG_WARN([*** disabling --enable-gcc28])
209     RTEMS_USE_GCC272=yes
210  fi
211fi
212test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
213
214dnl check for g++
215if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
216  RTEMS_PROG_CXX
217  if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
218    AC_MSG_ERROR([***]
219     [Inconsistency in compiler configuration:]
220     [Target C compiler and Target C++ compiler]
221     [must both ether be cross compilers or native compilers]
222     [Hint: If building a posix bsp: LD_LIBRARY_PATH?] )
223  fi
224else
225  CXX_FOR_TARGET="no"
226fi
227
228RTEMS_CANONICALIZE_TOOLS
229
230dnl check host cc
231AC_PROG_CC
232
233RTEMS_CYGWIN32
234RTEMS_EXEEXT
235
236dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
237case $host_os in
238*cygwin32*)     GCCSED="| sed 's%\\\\%/%g'" ;;
239*) ;;
240esac
241AC_SUBST(GCCSED)
242
243dnl check for host library functions
244dnl NOTE: must be called after AC_PROG_CC
245AC_CHECK_FUNCS(strerror)
246
247# find all the Executive Makefiles
248RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
249RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
250RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
251
252if test "$RTEMS_HAS_POSIX_API" = "yes"; then
253  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
254  makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
255fi
256
257# find all the Makefiles for the BSPs
258if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
259  makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
260
261  if test -z "$rtems_bsp"; then
262    AC_MSG_CHECKING([for bsps])
263    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
264    for file in $files; do
265      case $file in
266        shared*);;
267        Makefile*);;
268        READ*);;
269        CVS*);;
270        pxfl*);;
271        go32*);;       # so the i386 port can pick up the other Makefiles
272        # Now account for BSPs with build variants
273        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
274        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
275        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
276        *) rtems_bsp="$rtems_bsp $file";;
277      esac;
278    done
279
280    makefiles="$makefiles c/src/lib/libbsp/bare/Makefile"
281
282    AC_MSG_RESULT([$rtems_bsp done])
283  fi
284
285  # collect makefiles for each bsp
286  for i in $rtems_bsp; do
287    # make sure there is a make/custom file for the bsp
288    if test ! -r "$srcdir/make/custom/${i}.cfg"; then
289      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
290    fi
291 
292    # account for "aliased" bsps which share source code
293    case $i in
294      mvme162lx)    bspdir=mvme162  ;;  # mvme162 board variant
295      gen68360_040) bspdir=gen68360 ;;  # 68360 in companion mode
296      go32_p5)      bspdir=go32     ;;  # go32 on Pentium class CPU
297      p4600)        bspdir=p4000    ;;  # p4000 board with IDT 4600
298      p4650)        bspdir=p4000    ;;  # p4000 board with IDT 4650
299      *)            bspdir=$i;;
300    esac
301
302    # Is there code where there should be for this BSP?
303    # The bare bsp is a special case as it is not under the target_cpu path
304    case $i in
305      bare)    bspcpudir= ;;
306      *)       bspcpudir=$target_cpu/ ;;
307    esac
308     
309    if test -d "$srcdir/c/src/lib/libbsp/$bspcpudir$bspdir"; then
310      RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
311      # make sure the Makefiles in a bsp directory are only done once
312      echo $bspdirs | grep $bspdir >/dev/null 2>&1
313      if test $? -ne 0 ; then
314        bspdirs="$bspdirs $bspdir"
315        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$bspcpudir$bspdir)
316      fi
317    else
318      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
319    fi
320  done
321fi
322
323# find all the CPU dependent library Makefiles
324RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
325
326dnl Workaround for go32
327if test "$skip_startfiles" != "yes"; then
328  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
329fi
330
331dnl END configure.target.in
332
333
334PROJECT_ROOT=`pwd;`
335
336# If RTEMS macros are enabled, then use them.  Otherwise, use inlines.
337if test "$RTEMS_USE_MACROS" = "yes"; then
338  inline_dir=macros
339  if test "$RTEMS_HAS_POSIX_API" = "yes"; then
340    # The problem is that there is currently no code in posix/macros :)
341    AC_MSG_ERROR(Macros are not implemented for the POSIX API)
342  fi
343else
344  inline_dir=inline
345fi
346
347# If the KA9Q TCP/IP stack is enabled, then find all KA9Q Makefiles
348if test "$RTEMS_HAS_KA9Q" = "yes"; then
349  makefiles="$makefiles c/src/lib/libka9q/Makefile"
350fi
351
352# If the C++ support is enabled, then include the Makefiles
353if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
354  makefiles="$makefiles c/src/lib/librtems++/Makefile"
355fi
356
357# If the tests are enabled, then find all the test suite Makefiles
358AC_MSG_CHECKING([if the test suites are enabled? ])
359tests_enabled=yes
360AC_ARG_ENABLE(tests, \
361[  --enable-tests                   enable tests], \
362  [case "${enableval}" in
363    yes) AC_MSG_RESULT(yes) ;;
364    no)  AC_MSG_RESULT(no) ; tests_enabled=no ;;
365    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
366  esac],
367AC_MSG_RESULT(yes)
368)
369
370RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
371
372if test "$tests_enabled" = "yes"; then
373   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
374   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
375   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
376   RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
377   if test "$RTEMS_HAS_POSIX_API" = "yes"; then
378     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
379   fi
380fi
381
382# If the HWAPI is enabled, the find the HWAPI Makefiles
383AC_MSG_CHECKING([if the HWAPI is enabled? ])
384AC_ARG_ENABLE(hwapi, \
385[  --enable-hwapi                 enable hardware API library], \
386  [case "${enableval}" in
387    yes) AC_MSG_RESULT(yes)
388         if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
389            makefiles="$makefiles c/src/lib/libhwapi/Makefile"
390            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
391            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
392            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
393            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/non_volatile_memory)
394            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
395            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
396            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
397         else
398            AC_MSG_ERROR(No source code found for the HWAPI)
399         fi
400         ;;
401    no)  AC_MSG_RESULT(no) ;;
402    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
403  esac],
404  AC_MSG_RESULT(no)
405)
406
407AC_SUBST(rtems_cv_prog_cc_cross)
408AC_SUBST(RTEMS_BSP_LIST)
409AC_SUBST(RTEMS_HOST)
410AC_SUBST(RTEMS_LIBC_DIR)
411AC_SUBST(RTEMS_USE_OWN_PDIR)
412AC_SUBST(RTEMS_HAS_POSIX_API)
413AC_SUBST(RTEMS_HAS_KA9Q)
414AC_SUBST(RTEMS_USE_MACROS)
415AC_SUBST(RTEMS_HAS_CPLUSPLUS)
416AC_SUBST(RTEMS_USE_GCC272)
417AC_SUBST(RTEMS_LIBC_DIR)
418AC_SUBST(BARE_CPU_CFLAGS)
419AC_SUBST(BARE_CPU_MODEL)
420AC_SUBST(PROJECT_ROOT)
421AC_SUBST(program_prefix)
422
423# pick up all the Makefiles in required parts of the tree
424RTEMS_CHECK_MAKEFILE(c/build-tools)
425RTEMS_CHECK_MAKEFILE(make)
426RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
427RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
428
429AC_CONFIG_HEADER(c/build-tools/src/config.h)
430
431# try not to explicitly list a Makefile here
432AC_OUTPUT(
433Makefile
434make/host.cfg
435make/target.cfg
436make/Templates/Makefile.inc
437c/Makefile
438c/src/Makefile
439c/src/exec/Makefile
440c/src/exec/score/Makefile
441c/src/exec/score/cpu/Makefile
442c/src/exec/score/headers/Makefile
443c/src/exec/score/${inline_dir}/Makefile
444c/src/exec/score/src/Makefile
445c/src/exec/score/tools/Makefile
446c/src/exec/score/tools/generic/Makefile
447c/src/exec/score/tools/generic/size_rtems
448c/src/exec/wrapup/Makefile
449c/src/exec/wrapup/rtems/Makefile
450c/src/lib/Makefile
451c/src/lib/include/Makefile
452c/src/lib/libbsp/Makefile
453c/src/lib/libbsp/shmdr/Makefile
454c/src/lib/libc/Makefile
455c/src/lib/libcpu/Makefile
456c/src/lib/start/Makefile
457c/src/lib/wrapup/Makefile
458c/src/tests/Makefile
459c/src/tests/support/Makefile
460c/src/tests/support/include/Makefile
461c/src/tests/support/stubdr/Makefile
462c/src/tests/support/wrapup/Makefile
463c/src/tests/tools/Makefile
464c/src/tests/tools/generic/Makefile
465$makefiles
466c/update-tools/Makefile)
467
468echo
469echo target architecture: $target_cpu.
470echo available BSPs: $rtems_bsp.
471echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
472echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
473echo
Note: See TracBrowser for help on using the repository browser.