source: rtems/configure.in @ fb339a8

4.104.114.84.95
Last change on this file since fb339a8 was 67a2288, checked in by Joel Sherrill <joel.sherrill@…>, on 07/23/98 at 22:02:34

Patch from Eric VALETTE <valette@…>:

Here is a enhanced version of my previous patch. This patch enables
to potentially share the new interrupt management code for all Intel targets
(pc386, go32 and force386) bsp.

Note : this patch is complete only for pc386. It still needs to

be completed for go32 and force386. I carrefully checked
that anything needed is in for force386 (only some function
name changes for IDT manipulation and GDT segment
manipulation). But anyway I will not be able to test any
of theses targets...

  • Property mode set to 100644
File size: 14.2 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)    bspcpudir= ;;
322      *)       bspcpudir=$target_cpu/ ;;
323    esac
324     
325    if test -d "$srcdir/c/src/lib/libbsp/$bspcpudir$bspdir"; then
326      RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
327      # make sure the Makefiles in a bsp directory are only done once
328      echo $bspdirs | grep $bspdir >/dev/null 2>&1
329      if test $? -ne 0 ; then
330        bspdirs="$bspdirs $bspdir"
331        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$bspcpudir$bspdir)
332        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/${bspcpudir}shared)
333      fi
334    else
335      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
336    fi
337  done
338fi
339
340# find all the CPU dependent library Makefiles
341RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
342
343dnl Workaround for go32
344if test "$skip_startfiles" != "yes"; then
345  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
346fi
347
348dnl END configure.target.in
349
350
351PROJECT_ROOT=`pwd;`
352
353# If RTEMS macros are enabled, then use them.  Otherwise, use inlines.
354if test "$RTEMS_USE_MACROS" = "yes"; then
355  inline_dir=macros
356  if test "$RTEMS_HAS_POSIX_API" = "yes"; then
357    # The problem is that there is currently no code in posix/macros :)
358    AC_MSG_ERROR(Macros are not implemented for the POSIX API)
359  fi
360else
361  inline_dir=inline
362fi
363
364# If the KA9Q TCP/IP stack is enabled, then find all KA9Q Makefiles
365if test "$RTEMS_HAS_KA9Q" = "yes"; then
366  makefiles="$makefiles c/src/lib/libka9q/Makefile"
367fi
368
369# If the C++ support is enabled, then include the Makefiles
370if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
371  makefiles="$makefiles c/src/lib/librtems++/Makefile"
372fi
373
374# If the tests are enabled, then find all the test suite Makefiles
375AC_MSG_CHECKING([if the test suites are enabled? ])
376tests_enabled=yes
377AC_ARG_ENABLE(tests, \
378[  --enable-tests                   enable tests], \
379  [case "${enableval}" in
380    yes) AC_MSG_RESULT(yes) ;;
381    no)  AC_MSG_RESULT(no) ; tests_enabled=no ;;
382    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
383  esac],
384AC_MSG_RESULT(yes)
385)
386
387RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
388
389if test "$tests_enabled" = "yes"; then
390   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
391   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
392   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
393   RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
394   if test "$RTEMS_HAS_POSIX_API" = "yes"; then
395     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
396   fi
397fi
398
399# If the HWAPI is enabled, the find the HWAPI Makefiles
400AC_MSG_CHECKING([if the HWAPI is enabled? ])
401AC_ARG_ENABLE(hwapi, \
402[  --enable-hwapi                 enable hardware API library], \
403  [case "${enableval}" in
404    yes) AC_MSG_RESULT(yes)
405         if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
406            makefiles="$makefiles c/src/lib/libhwapi/Makefile"
407            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
408            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
409            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
410            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/non_volatile_memory)
411            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
412            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
413            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
414         else
415            AC_MSG_ERROR(No source code found for the HWAPI)
416         fi
417         ;;
418    no)  AC_MSG_RESULT(no) ;;
419    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
420  esac],
421  AC_MSG_RESULT(no)
422)
423
424AC_SUBST(rtems_cv_prog_cc_cross)
425AC_SUBST(RTEMS_BSP_LIST)
426AC_SUBST(RTEMS_HOST)
427AC_SUBST(RTEMS_LIBC_DIR)
428AC_SUBST(RTEMS_USE_OWN_PDIR)
429AC_SUBST(RTEMS_HAS_POSIX_API)
430AC_SUBST(RTEMS_HAS_KA9Q)
431AC_SUBST(RTEMS_USE_MACROS)
432AC_SUBST(RTEMS_HAS_CPLUSPLUS)
433AC_SUBST(RTEMS_USE_GCC272)
434AC_SUBST(RTEMS_LIBC_DIR)
435AC_SUBST(BARE_CPU_CFLAGS)
436AC_SUBST(BARE_CPU_MODEL)
437AC_SUBST(PROJECT_ROOT)
438AC_SUBST(program_prefix)
439
440# pick up all the Makefiles in required parts of the tree
441RTEMS_CHECK_MAKEFILE(c/build-tools)
442RTEMS_CHECK_MAKEFILE(make)
443RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
444RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
445
446AC_CONFIG_HEADER(c/build-tools/src/config.h)
447
448# try not to explicitly list a Makefile here
449AC_OUTPUT(
450Makefile
451make/host.cfg
452make/target.cfg
453make/Templates/Makefile.inc
454c/Makefile
455c/src/Makefile
456c/src/exec/Makefile
457c/src/exec/score/Makefile
458c/src/exec/score/cpu/Makefile
459c/src/exec/score/headers/Makefile
460c/src/exec/score/${inline_dir}/Makefile
461c/src/exec/score/src/Makefile
462c/src/exec/score/tools/Makefile
463c/src/exec/score/tools/generic/Makefile
464c/src/exec/score/tools/generic/size_rtems
465c/src/exec/wrapup/Makefile
466c/src/exec/wrapup/rtems/Makefile
467c/src/lib/Makefile
468c/src/lib/include/Makefile
469c/src/lib/libbsp/Makefile
470c/src/lib/libbsp/shmdr/Makefile
471c/src/lib/libc/Makefile
472c/src/lib/libcpu/Makefile
473c/src/lib/start/Makefile
474c/src/lib/wrapup/Makefile
475c/src/tests/Makefile
476c/src/tests/support/Makefile
477c/src/tests/support/include/Makefile
478c/src/tests/support/stubdr/Makefile
479c/src/tests/support/wrapup/Makefile
480c/src/tests/tools/Makefile
481c/src/tests/tools/generic/Makefile
482$makefiles
483c/update-tools/Makefile)
484
485echo
486echo target architecture: $target_cpu.
487echo available BSPs: $rtems_bsp.
488echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
489echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
490echo
Note: See TracBrowser for help on using the repository browser.