source: rtems/configure.in @ d637822

4.104.114.84.95
Last change on this file since d637822 was 87cec48, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 16, 1997 at 6:40:08 PM

Changed RTEMS_BSP to RTEMS_BSP_LIST.

  • Property mode set to 100644
File size: 11.4 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.12)
3AC_INIT(README)
4
5dnl Checks for programs.
6AC_PROG_MAKE_SET
7AC_CANONICAL_SYSTEM
8AC_ARG_WITH(cross-host,[  --with-cross-host=HOST      host (cygnus)], \
9host=$withval)
10
11AC_ARG_ENABLE(gmake-print-directory, \
12[  --enable-gmake-print-directory    enable GNU Make's print directory], \
13[case "${enableval}" in
14  yes) RTEMS_USE_OWN_PDIR=no ;;
15  no) RTEMS_USE_OWN_PDIR=yes ;;
16  *)  AC_MSG_ERROR(bad value ${enableval} for gmake-print-directory option) ;;
17esac],[RTEMS_USE_OWN_PDIR=yes])
18
19AC_ARG_ENABLE(posix, \
20[  --enable-posix                   enable posix interface], \
21[case "${enableval}" in
22  yes) RTEMS_HAS_POSIX_API=yes ;;
23  no) RTEMS_HAS_POSIX_API=no ;;
24  *)  AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
25esac],[RTEMS_HAS_POSIX_API=yes])
26
27AC_ARG_ENABLE(ka9q, \
28[  --enable-ka9q                enable KA9Q TCP/IP stack], \
29[case "${enableval}" in
30  yes) RTEMS_HAS_KA9Q=yes ;;
31  no) RTEMS_HAS_KA9Q=no ;;
32  *)  AC_MSG_ERROR(bad value ${enableval} for enable-ka9q option) ;;
33esac],[RTEMS_HAS_KA9Q=yes])
34
35AC_ARG_ENABLE(rtems-inlines, \
36[  --enable-rtems-inlines           enable RTEMS inline functions (use macros)], \
37[case "${enableval}" in
38  yes) RTEMS_USE_MACROS=no ;;
39  no) RTEMS_USE_MACROS=yes ;;
40  *)  AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
41esac],[RTEMS_USE_MACROS=no])
42
43AC_ARG_ENABLE(cpp, \
44[  --enable-cpp            enable C++ support, and build the rtems++ library], \
45[case "${enableval}" in
46  yes) RTEMS_HAS_CPLUSPLUS=yes ;;
47  no) RTEMS_HAS_CPLUSPLUS=no   ;;
48  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cpp option) ;;
49esac], [RTEMS_HAS_CPLUSPLUS=no])
50
51AC_ARG_ENABLE(gcc28, \
52[  --enable-gcc28                   enable use of gcc 2.8.x features], \
53[case "${enableval}" in
54  yes) RTEMS_USE_GCC272=no ;;
55  no) RTEMS_USE_GCC272=yes ;;
56  *)  AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
57esac],[RTEMS_USE_GCC272=yes])
58
59AC_ARG_ENABLE(libcdir, \
60[  --enable-libcdir=directory       set the directory for the C library], \
61[ RTEMS_LIBC_DIR="${enableval}" ; \
62test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
63
64RTEMS_PREFIX=${target_cpu}-${target_vendor}
65
66dnl BEGIN configure.host.in
67
68AC_PATH_PROG(CAT,cat)
69AC_PATH_PROG(RM,rm)
70AC_PATH_PROG(CP,cp)
71AC_PATH_PROG(MV,mv)
72AC_PATH_PROG(LN,ln)
73AC_PROG_LN_S
74AC_PATH_PROG(CHMOD,chmod)
75AC_PATH_PROG(SORT,sort)
76
77dnl check mkdir behaviour, try to get mkdir -p -m 0755
78RTEMS_PATH_MKDIR
79RTEMS_PROG_MKDIR_M
80RTEMS_PROG_MKDIR_P
81test "$rtems_cv_prog_MKDIR_P" = "yes" && MKDIR="$MKDIR -p"
82test "$rtems_cv_prog_MKDIR_M" = "yes" && MKDIR="$MKDIR -m 0755"
83
84AC_PATH_PROG(TOUCH,touch)
85AC_PATH_PROG(CMP,cmp)
86
87AC_PATH_PROG(SED,sed)
88AC_PATH_PROGS(M4,gm4 m4)
89
90dnl NOTE: prefer bash over ksh over sh
91AC_PATH_PROGS(KSH,bash ksh sh)
92
93if test -z "$KSH"; then
94dnl NOTE: This cannot happen -- /bin/sh must always exist
95AC_MSG_ERROR(
96[***]
97[    Cannot determine a usable shell bash/ksh/sh]
98[    Please contact your system administrator] );
99fi
100
101dnl END configure.host.in
102
103dnl BEGIN configure.target.in
104
105dnl echo "TARGET"
106dnl echo "    cpu    --> $target_cpu"
107dnl echo "    os     --> $target_os"
108dnl echo "    vendor --> $target_vendor"
109
110dnl canonicalize target name
111dnl NOTE: Most rtems targets do not fullfil autoconf
112dnl targets naming conventions "processor-vendor-os"
113dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
114dnl and we have to fix it for rtems ourselves
115dnl
116dnl The original plan was to do CPU-BSP-rtems or CPU-rtems to
117dnl imply all BSPs.  Eventually we would like to build a collection
118dnl of CPU model specific RTEMS libraries which in conjunction with
119dnl a BSP library would be used to link an application.
120
121RTEMS_HOST=$host_os
122
123case "${target}" in
124  # hpux unix port should go here
125  hppa1.1-rtems*)
126        target_cpu=hppa1_1
127        ;;
128  i[[3456]]86-go32-rtems*)
129        target_cpu=i386
130        rtems_bsp="go32 go32_p5"
131        skip_startfiles="yes"
132        RTEMS_HAS_POSIX_API=no
133        ;;
134  i[[3456]]86-rtems*)
135        target_cpu=i386
136        ;;
137  i[[3456]]86-pc-linux*)         # unix "simulator" port
138        target_cpu=unix
139        RTEMS_HAS_POSIX_API=no
140        RTEMS_HOST=Linux
141        ;;
142  no_cpu-rtems*)
143        target_cpu=no_cpu
144        RTEMS_HAS_POSIX_API=no
145        ;;
146  powerpc-*tems*)
147        target_cpu=ppc
148        ;;
149  sparc-sun-solaris*)             # unix "simulator" port
150        target_cpu=unix
151        RTEMS_HAS_POSIX_API=no
152        RTEMS_HOST=Solaris
153        ;;
154  *)
155        RTEMS_CANONICAL_TARGET_CPU
156        ;;
157esac
158
159# Override the set of BSPs to be built.
160AC_ARG_ENABLE(rtemsbsp, \
161  [  --enable-rtemsbsp=bsp1 bsp2 ..   BSPs to include in build], \
162      rtems_bsp=$enableval \
163)
164
165# Is this a supported CPU?
166AC_MSG_CHECKING([if cpu $target_cpu is supported])
167if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
168  AC_MSG_RESULT(yes)
169  makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
170else
171  AC_MSG_ERROR(no)
172fi
173
174# find all the Executive Makefiles
175RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
176RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
177RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
178
179if test "$RTEMS_HAS_POSIX_API" = "yes"; then
180  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
181  makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
182fi
183
184# find all the Makefiles for the BSPs
185if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
186  makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
187
188  if test -z "$rtems_bsp"; then
189    AC_MSG_CHECKING([for bsps])
190    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
191    for file in $files; do
192      case $file in
193        shared*);;
194        Makefile*);;
195        READ*);;
196        CVS*);;
197        pxfl*);;
198        go32*);;       # so the i386 port can pick up the other Makefiles
199        # Now account for BSPs with build variants
200        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
201        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
202        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
203        *) rtems_bsp="$rtems_bsp $file";;
204      esac;
205    done
206
207    AC_MSG_RESULT([$rtems_bsp])
208  fi
209
210  # collect makefiles for each bsp
211  for i in $rtems_bsp; do
212    # make sure there is a make/custom file for the bsp
213    if test ! -r "$srcdir/c/make/custom/${i}.cfg"; then
214      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
215    fi
216 
217    # account for "aliased" bsps which share source code
218    case $i in
219      mvme162lx)    bspdir=mvme162  ;;  # mvme162 board variant
220      gen68360_040) bspdir=gen68360 ;;  # 68360 in companion mode
221      go32_p5)      bspdir=go32     ;;  # go32 on Pentium class CPU
222      p4600)        bspdir=p4000    ;;  # p4000 board with IDT 4600
223      p4650)        bspdir=p4000    ;;  # p4000 board with IDT 4650
224      *)            bspdir=$i;;
225    esac
226
227    # Is there code where there should be for this BSP?
228    if test -d "$srcdir/c/src/lib/libbsp/$target_cpu/$bspdir"; then
229      RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
230      # make sure the Makefiles in a bsp directory are only done once
231      echo $bspdirs | grep $bspdir >/dev/null 2>&1
232      if test $? -ne 0 ; then
233        bspdirs="$bspdirs $bspdir"
234        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$target_cpu/$bspdir)
235      fi
236    else
237      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
238    fi
239  done
240fi
241
242# find all the CPU dependent library Makefiles
243RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
244
245dnl Workaround for go32
246if test "$skip_startfiles" != "yes"; then
247  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
248fi
249
250dnl END configure.target.in
251
252
253#
254#  Target configurations are listed in alphabetical order. 
255#  The BSPs for a target configuration are also listed in alphabetical order.
256#
257
258dnl NOTE: host_os is automatically set by autoconf
259
260if [[ "${program_prefix}" = "NONE" ]] ; then
261  if [[ "${target}" = "${host}" ]] ; then
262    program_prefix=
263  else
264    program_prefix=${target}-
265  fi
266fi
267
268RTEMS_ROOT=`cd $srcdir/c; pwd`
269PROJECT_ROOT=`pwd;`
270
271# If the KA9Q TCP/IP stack is enabled, then find all KA9Q Makefiles
272if test "$RTEMS_HAS_KA9Q" = "yes"; then
273  makefiles="$makefiles c/src/lib/libka9q/Makefile"
274fi
275
276# If the C++ support is enabled, then include the Makefiles
277if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
278  makefiles="$makefiles c/src/lib/librtems++/Makefile"
279fi
280
281# If the tests are enabled, then find all the test suite Makefiles
282AC_MSG_CHECKING([Are the test suites enabled? ])
283tests_enabled=yes
284AC_ARG_ENABLE(tests, \
285[  --enable-tests                   enable tests], \
286  [case "${enableval}" in
287    yes) AC_MSG_RESULT(yes) ;;
288    no)  AC_MSG_RESULT(no) ; tests_enabled=no ;;
289    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
290  esac],
291AC_MSG_RESULT(yes)
292)
293
294if test "$tests_enabled" = "yes"; then
295   RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
296   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
297   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
298   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
299   RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
300   if test "$RTEMS_HAS_POSIX" = "yes"; then
301     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
302   fi
303fi
304
305# If the HWAPI is enabled, the find the HWAPI Makefiles
306AC_MSG_CHECKING([Is the HWAPI enabled? ])
307AC_ARG_ENABLE(hwapi, \
308[  --enable-hwapi                 enable hardware API library], \
309  [case "${enableval}" in
310    yes) AC_MSG_RESULT(yes)
311         if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
312            makefiles="$makefiles c/src/lib/libhwapi/Makefile"
313            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
314            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
315            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
316            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/eeprom)
317            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
318            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
319            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
320         else
321            AC_MSG_ERROR(No source code found for the HWAPI)
322         fi
323         ;;
324    no)  AC_MSG_RESULT(no) ;;
325    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
326  esac],
327  AC_MSG_RESULT(no)
328)
329
330AC_SUBST(RTEMS_BSP_LIST)
331AC_SUBST(RTEMS_HOST)
332AC_SUBST(RTEMS_LIBC_DIR)
333AC_SUBST(RTEMS_ROOT)
334AC_SUBST(RTEMS_USE_OWN_PDIR)
335AC_SUBST(RTEMS_HAS_POSIX_API)
336AC_SUBST(RTEMS_HAS_KA9Q)
337AC_SUBST(RTEMS_USE_MACROS)
338AC_SUBST(RTEMS_HAS_CPLUSPLUS)
339AC_SUBST(RTEMS_USE_GCC272)
340AC_SUBST(RTEMS_LIBC_DIR)
341AC_SUBST(PROJECT_ROOT)
342AC_SUBST(program_prefix)
343
344# pick up all the Makefiles in required parts of the tree
345RTEMS_CHECK_MAKEFILE(c/build-tools)
346RTEMS_CHECK_MAKEFILE(c/make)
347RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
348RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
349
350# try not to explicitly list a Makefile here
351AC_OUTPUT(
352Makefile
353c/Makefile
354c/src/Makefile
355c/src/exec/Makefile
356c/src/exec/score/Makefile
357c/src/exec/score/cpu/Makefile
358c/src/exec/score/headers/Makefile
359c/src/exec/score/inline/Makefile
360c/src/exec/score/src/Makefile
361c/src/exec/score/tools/Makefile
362c/src/exec/score/tools/generic/Makefile
363c/src/exec/wrapup/Makefile
364c/src/exec/wrapup/rtems/Makefile
365c/src/lib/Makefile
366c/src/lib/include/Makefile
367c/src/lib/libbsp/Makefile
368c/src/lib/libbsp/shmdr/Makefile
369c/src/lib/libc/Makefile
370c/src/lib/libcpu/Makefile
371c/src/lib/start/Makefile
372c/src/lib/wrapup/Makefile
373c/src/tests/Makefile
374c/src/tests/support/Makefile
375c/src/tests/support/include/Makefile
376c/src/tests/support/stubdr/Makefile
377c/src/tests/support/wrapup/Makefile
378c/src/tests/tools/Makefile
379c/src/tests/tools/generic/Makefile
380$makefiles
381c/make/host.cfg
382c/make/target.cfg
383c/make/Templates/Makefile.inc
384c/update-tools/Makefile)
385
386echo
387echo target architecture: $target_cpu.
388echo available BSPs: $rtems_bsp.
389echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
390echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
391echo
Note: See TracBrowser for help on using the repository browser.