source: rtems/configure.in @ bd9c3d1

4.104.114.84.95
Last change on this file since bd9c3d1 was 2758c9f2, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/98 at 22:13:05

Ralf Corsepius suggested a way to get rid of UNIX compiler files and use gcc-target-default.cfg

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