source: rtems/configure.in @ 0280cb6

4.104.114.84.95
Last change on this file since 0280cb6 was 0280cb6, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/98 at 14:39:09

FreeBSD stack compiles for the first time (except libc/strsep.c)

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