source: rtems/configure.in @ a5400c0

4.104.114.84.95
Last change on this file since a5400c0 was a5400c0, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 25, 1998 at 4:21:31 PM

Bare bsp patch from Chris Johns and regenerated files.

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