source: rtems/configure.in @ 1253f39

4.104.114.84.9
Last change on this file since 1253f39 was 579fc6a3, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 13, 1998 at 2:47:18 PM

Per request from Chris Johns <ccj@…>, I added code to detect
when the bare bsp was enabled without setting both --enable-cpu-model
and --enable-cpu-cflags.

  • Property mode set to 100644
File size: 14.5 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
247dnl check for SysV IPC used by simulators
248if test "$target_cpu" = "unix" ; then
249  RTEMS_SYSV_SEM
250  if test "$rtems_cv_sysv_sem" != "yes" ; then
251    AC_MSG_ERROR([System V semaphores don't work, required by simulator])
252  fi
253  RTEMS_SYSV_SHM
254  if test "$rtems_cv_sysv_shm" != "yes" ; then
255    AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
256  fi
257  RTEMS_SYSV_MSG
258  if test "$rtems_cv_sysv_msg" != "yes" ; then
259    AC_MSG_ERROR([System V messages don't work, required by simulator])
260  fi
261fi
262
263# find all the Executive Makefiles
264RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
265RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
266RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
267
268if test "$RTEMS_HAS_POSIX_API" = "yes"; then
269  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
270  makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
271fi
272
273# find all the Makefiles for the BSPs
274if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
275  makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
276
277  if test -z "$rtems_bsp"; then
278    AC_MSG_CHECKING([for bsps])
279    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
280    for file in $files; do
281      case $file in
282        shared*);;
283        Makefile*);;
284        READ*);;
285        CVS*);;
286        pxfl*);;
287        go32*);;       # so the i386 port can pick up the other Makefiles
288        # Now account for BSPs with build variants
289        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
290        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
291        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
292        *) rtems_bsp="$rtems_bsp $file";;
293      esac;
294    done
295
296    makefiles="$makefiles c/src/lib/libbsp/bare/Makefile"
297
298    AC_MSG_RESULT([$rtems_bsp done])
299  fi
300
301  # collect makefiles for each bsp
302  for i in $rtems_bsp; do
303    # make sure there is a make/custom file for the bsp
304    if test ! -r "$srcdir/make/custom/${i}.cfg"; then
305      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
306    fi
307 
308    # account for "aliased" bsps which share source code
309    case $i in
310      mvme162lx)    bspdir=mvme162  ;;  # mvme162 board variant
311      gen68360_040) bspdir=gen68360 ;;  # 68360 in companion mode
312      go32_p5)      bspdir=go32     ;;  # go32 on Pentium class CPU
313      p4600)        bspdir=p4000    ;;  # p4000 board with IDT 4600
314      p4650)        bspdir=p4000    ;;  # p4000 board with IDT 4650
315      *)            bspdir=$i;;
316    esac
317
318    # Is there code where there should be for this BSP?
319    # The bare bsp is a special case as it is not under the target_cpu path
320    case $i in
321      bare)
322        bspcpudir=
323        if test "X${BARE_CPU_CFLAGS}" = "X" ; then
324          AC_MSG_ERROR([--enable-bare-cpu-flags not specified for bare bsp])
325        fi
326        if test "X${BARE_CPU_MODEL}" = "X" ; then
327          AC_MSG_ERROR([--enable-bare-cpu-model not specified for bare bsp])
328        fi
329        ;;
330      *)
331        bspcpudir=$target_cpu/
332        ;;
333    esac
334     
335    if test -d "$srcdir/c/src/lib/libbsp/$bspcpudir$bspdir"; then
336      RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
337      # make sure the Makefiles in a bsp directory are only done once
338      echo $bspdirs | grep $bspdir >/dev/null 2>&1
339      if test $? -ne 0 ; then
340        bspdirs="$bspdirs $bspdir"
341        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$bspcpudir$bspdir)
342        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/${bspcpudir}shared)
343      fi
344    else
345      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
346    fi
347  done
348fi
349
350# find all the CPU dependent library Makefiles
351RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
352
353dnl Workaround for go32
354if test "$skip_startfiles" != "yes"; then
355  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
356fi
357
358dnl END configure.target.in
359
360
361PROJECT_ROOT=`pwd;`
362
363# If RTEMS macros are enabled, then use them.  Otherwise, use inlines.
364if test "$RTEMS_USE_MACROS" = "yes"; then
365  inline_dir=macros
366  if test "$RTEMS_HAS_POSIX_API" = "yes"; then
367    # The problem is that there is currently no code in posix/macros :)
368    AC_MSG_ERROR(Macros are not implemented for the POSIX API)
369  fi
370else
371  inline_dir=inline
372fi
373
374# If the KA9Q TCP/IP stack is enabled, then find all KA9Q Makefiles
375if test "$RTEMS_HAS_KA9Q" = "yes"; then
376  makefiles="$makefiles c/src/lib/libka9q/Makefile"
377fi
378
379# If the C++ support is enabled, then include the Makefiles
380if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
381  makefiles="$makefiles c/src/lib/librtems++/Makefile"
382fi
383
384# If the tests are enabled, then find all the test suite Makefiles
385AC_MSG_CHECKING([if the test suites are enabled? ])
386tests_enabled=yes
387AC_ARG_ENABLE(tests, \
388[  --enable-tests                   enable tests], \
389  [case "${enableval}" in
390    yes) AC_MSG_RESULT(yes) ;;
391    no)  AC_MSG_RESULT(no) ; tests_enabled=no ;;
392    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
393  esac],
394AC_MSG_RESULT(yes)
395)
396
397RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
398
399if test "$tests_enabled" = "yes"; then
400   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
401   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
402   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
403   RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
404   if test "$RTEMS_HAS_POSIX_API" = "yes"; then
405     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
406   fi
407fi
408
409# If the HWAPI is enabled, the find the HWAPI Makefiles
410AC_MSG_CHECKING([if the HWAPI is enabled? ])
411AC_ARG_ENABLE(hwapi, \
412[  --enable-hwapi                 enable hardware API library], \
413  [case "${enableval}" in
414    yes) AC_MSG_RESULT(yes)
415         if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
416            makefiles="$makefiles c/src/lib/libhwapi/Makefile"
417            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
418            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
419            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
420            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/non_volatile_memory)
421            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
422            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
423            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
424         else
425            AC_MSG_ERROR(No source code found for the HWAPI)
426         fi
427         ;;
428    no)  AC_MSG_RESULT(no) ;;
429    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
430  esac],
431  AC_MSG_RESULT(no)
432)
433
434AC_SUBST(rtems_cv_prog_cc_cross)
435AC_SUBST(RTEMS_BSP_LIST)
436AC_SUBST(RTEMS_HOST)
437AC_SUBST(RTEMS_LIBC_DIR)
438AC_SUBST(RTEMS_USE_OWN_PDIR)
439AC_SUBST(RTEMS_HAS_POSIX_API)
440AC_SUBST(RTEMS_HAS_KA9Q)
441AC_SUBST(RTEMS_USE_MACROS)
442AC_SUBST(RTEMS_HAS_CPLUSPLUS)
443AC_SUBST(RTEMS_USE_GCC272)
444AC_SUBST(RTEMS_LIBC_DIR)
445AC_SUBST(BARE_CPU_CFLAGS)
446AC_SUBST(BARE_CPU_MODEL)
447AC_SUBST(PROJECT_ROOT)
448AC_SUBST(program_prefix)
449
450# pick up all the Makefiles in required parts of the tree
451RTEMS_CHECK_MAKEFILE(c/build-tools)
452RTEMS_CHECK_MAKEFILE(make)
453RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
454RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
455
456AC_CONFIG_HEADER(c/build-tools/src/config.h)
457
458# try not to explicitly list a Makefile here
459AC_OUTPUT(
460Makefile
461make/host.cfg
462make/target.cfg
463make/Templates/Makefile.inc
464c/Makefile
465c/src/Makefile
466c/src/exec/Makefile
467c/src/exec/score/Makefile
468c/src/exec/score/cpu/Makefile
469c/src/exec/score/headers/Makefile
470c/src/exec/score/${inline_dir}/Makefile
471c/src/exec/score/src/Makefile
472c/src/exec/score/tools/Makefile
473c/src/exec/score/tools/generic/Makefile
474c/src/exec/score/tools/generic/size_rtems
475c/src/exec/wrapup/Makefile
476c/src/exec/wrapup/rtems/Makefile
477c/src/lib/Makefile
478c/src/lib/include/Makefile
479c/src/lib/libbsp/Makefile
480c/src/lib/libbsp/shmdr/Makefile
481c/src/lib/libc/Makefile
482c/src/lib/libcpu/Makefile
483c/src/lib/start/Makefile
484c/src/lib/wrapup/Makefile
485c/src/tests/Makefile
486c/src/tests/support/Makefile
487c/src/tests/support/include/Makefile
488c/src/tests/support/stubdr/Makefile
489c/src/tests/support/wrapup/Makefile
490c/src/tests/tools/Makefile
491c/src/tests/tools/generic/Makefile
492$makefiles
493c/update-tools/Makefile)
494
495echo
496echo target architecture: $target_cpu.
497echo available BSPs: $rtems_bsp.
498echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
499echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
500echo
Note: See TracBrowser for help on using the repository browser.