source: rtems/configure.in @ 2c3840b

4.104.114.84.95
Last change on this file since 2c3840b was 2c3840b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/30/98 at 20:58:39

Added new autoconf test for i386 code16/code32 support. The guts of the
test were suggested by Ian Taylor <ian@…> and Joel did the
hard part of putting it in aclocal and editting all the offending
Makefiles and source code which could use this feature.

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