source: rtems/configure.in @ f99d4f83

4.104.114.84.95
Last change on this file since f99d4f83 was 80a16ec4, checked in by Joel Sherrill <joel.sherrill@…>, on 12/06/97 at 15:44:46

Redid hwapi makefile search to remove need for -follow option to find.

Avoid generating Makefiles for KA9Q and C++ when they are disabled.

  • Property mode set to 100644
File size: 11.2 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-rtems*|ppc-rtems*)
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        go32*);;   # so the i386 port can pick up the other Makefiles
198        *) rtems_bsp="$rtems_bsp $file";;
199      esac;
200    done
201    AC_MSG_RESULT([$rtems_bsp])
202  fi
203
204  # collect makefiles for each bsp
205  for i in $rtems_bsp; do
206    # make sure there is a make/custom file for the bsp
207    if test ! -r "$srcdir/c/make/custom/${i}.cfg"; then
208      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
209    fi
210
211    # account for "aliased" bsps which share source code
212    case $i in
213      mvme162lx)    bspdir=mvme162  ;;  # mvme162 board variant
214      gen68360_040) bspdir=gen68360 ;;  # 68360 in companion mode
215      go32_p5)      bspdir=go32     ;;  # go32 on Pentium class CPU
216      p4600)        bspdir=p4000    ;;  # p4000 board with IDT 4600
217      p4650)        bspdir=p4000    ;;  # p4000 board with IDT 4650
218      *)            bspdir=$i;;
219    esac
220
221    # Is there code where there should be for this BSP?
222    if test -d "$srcdir/c/src/lib/libbsp/$target_cpu/$bspdir"; then
223      RTEMS_BSP="$RTEMS_BSP $i"
224      # make sure the Makefiles in a bsp directory are only done once
225      echo $bspdirs | grep $bspdir >/dev/null 2>&1
226      if test $? -ne 0 ; then
227        bspdirs="$bspdirs $bspdir"
228        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$target_cpu/$bspdir)
229      fi
230    else
231      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
232    fi
233  done
234fi
235
236# find all the CPU dependent library Makefiles
237RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
238
239dnl Workaround for go32
240if test "$skip_startfiles" != "yes"; then
241  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
242fi
243
244dnl END configure.target.in
245
246
247#
248#  Target configurations are listed in alphabetical order. 
249#  The BSPs for a target configuration are also listed in alphabetical order.
250#
251
252dnl NOTE: host_os is automatically set by autoconf
253
254if [[ "${program_prefix}" = "NONE" ]] ; then
255  if [[ "${target}" = "${host}" ]] ; then
256    program_prefix=
257  else
258    program_prefix=${target}-
259  fi
260fi
261
262dnl AC_PROG_CC
263dnl AC_PROG_CXX
264
265dnl RTEMS_BSP=$rtems_bsp
266dnl RTEMS_HOST=$host_os
267RTEMS_ROOT=`cd $srcdir/c; pwd`
268PROJECT_ROOT=`pwd;`
269
270# If the KA9Q TCP/IP stack is enabled, then find all KA9Q Makefiles
271if test "$RTEMS_HAS_KA9Q" = "yes"; then
272  makefiles="$makefiles c/src/lib/libka9q/Makefile"
273fi
274
275# If the C++ support is enabled, then include the Makefiles
276if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
277  makefiles="$makefiles c/src/lib/librtems++/Makefile"
278fi
279
280# If the tests are enabled, then find all the test suite Makefiles
281AC_MSG_CHECKING([Are the test suites enabled? ])
282tests_enabled=yes
283AC_ARG_ENABLE(tests, \
284[  --enable-tests                   enable tests], \
285  [case "${enableval}" in
286    yes) AC_MSG_RESULT(yes) ;;
287    no)  AC_MSG_RESULT(no) ; tests_enabled=no ;;
288    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
289  esac],
290AC_MSG_RESULT(yes)
291)
292
293if test "$tests_enabled" = "yes"; then
294   RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
295   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
296   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
297   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
298   RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
299   if test "$RTEMS_HAS_POSIX" = "yes"; then
300     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
301   fi
302fi
303
304# If the HWAPI is enabled, the find the HWAPI Makefiles
305AC_MSG_CHECKING([Is the HWAPI enabled? ])
306AC_ARG_ENABLE(hwapi, \
307[  --enable-hwapi                 enable hardware API library], \
308  [case "${enableval}" in
309    yes) AC_MSG_RESULT(yes)
310         if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
311            makefiles="$makefiles c/src/lib/libhwapi/Makefile"
312            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
313            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
314            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
315            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/eeprom)
316            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
317            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
318            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
319         else
320            AC_MSG_ERROR(No source code found for the HWAPI)
321         fi
322         ;;
323    no)  AC_MSG_RESULT(no) ;;
324    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
325  esac],
326  AC_MSG_RESULT(no)
327)
328
329AC_SUBST(RTEMS_BSP)
330AC_SUBST(RTEMS_HOST)
331AC_SUBST(RTEMS_LIBC_DIR)
332AC_SUBST(RTEMS_ROOT)
333AC_SUBST(RTEMS_USE_OWN_PDIR)
334AC_SUBST(RTEMS_HAS_POSIX_API)
335AC_SUBST(RTEMS_HAS_KA9Q)
336AC_SUBST(RTEMS_USE_MACROS)
337AC_SUBST(RTEMS_HAS_CPLUSPLUS)
338AC_SUBST(RTEMS_USE_GCC272)
339AC_SUBST(RTEMS_LIBC_DIR)
340AC_SUBST(PROJECT_ROOT)
341AC_SUBST(program_prefix)
342
343# pick up all the Makefiles in required parts of the tree
344RTEMS_CHECK_MAKEFILE(c/build-tools)
345RTEMS_CHECK_MAKEFILE(c/make)
346RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
347RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
348
349# try not to explicitly list a Makefile here
350AC_OUTPUT(
351Makefile
352c/Makefile
353c/src/Makefile
354c/src/exec/Makefile
355c/src/exec/score/Makefile
356c/src/exec/score/cpu/Makefile
357c/src/exec/score/headers/Makefile
358c/src/exec/score/inline/Makefile
359c/src/exec/score/src/Makefile
360c/src/exec/score/tools/Makefile
361c/src/exec/score/tools/generic/Makefile
362c/src/exec/wrapup/Makefile
363c/src/exec/wrapup/rtems/Makefile
364c/src/lib/Makefile
365c/src/lib/include/Makefile
366c/src/lib/libbsp/Makefile
367c/src/lib/libbsp/shmdr/Makefile
368c/src/lib/libc/Makefile
369c/src/lib/libcpu/Makefile
370c/src/lib/start/Makefile
371c/src/lib/wrapup/Makefile
372c/src/tests/Makefile
373c/src/tests/support/Makefile
374c/src/tests/support/include/Makefile
375c/src/tests/support/stubdr/Makefile
376c/src/tests/support/wrapup/Makefile
377c/src/tests/tools/Makefile
378c/src/tests/tools/generic/Makefile
379$makefiles
380c/make/host.cfg
381c/make/Templates/Makefile.inc
382c/update-tools/Makefile)
383
384echo
385echo target architecture: $target_cpu.
386echo available BSPs: $rtems_bsp.
387echo \'make all\' will build the following BSPs: $RTEMS_BSP.
388echo other BSPs can be built with \'make RTEMSBSP=\"bsp1 bsp2 ...\"\'
389echo
Note: See TracBrowser for help on using the repository browser.