source: rtems/configure.in @ 692b9f7

4.104.114.84.9
Last change on this file since 692b9f7 was 692b9f7, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 28, 1998 at 7:17:16 PM

Merged Vista SCORE603e, Radstone PPCn_60x, and DY-4 DMV177 BSPs along
with libchip.

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