source: rtems/configure.in @ ba024755

4.104.114.84.95
Last change on this file since ba024755 was ba024755, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 22, 1998 at 3:20:43 PM

Corrected/simplified setting of RTEMS_ROOT.

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