source: rtems/configure.in @ 6ee6abb

4.104.114.84.95
Last change on this file since 6ee6abb was 0b76723, checked in by Joel Sherrill <joel.sherrill@…>, on May 18, 1998 at 4:36:09 PM

Support bsp_specs style building for linux and solaris. Improved C++
support.

  • Property mode set to 100644
File size: 12.8 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        ;;
138  no_cpu-*rtems*)
139        target_cpu=no_cpu
140        RTEMS_HAS_POSIX_API=no
141        ;;
142  sparc-sun-solaris*)             # unix "simulator" port
143        target_cpu=unix
144        RTEMS_HOST=Solaris
145        # override these settings
146        RTEMS_HAS_POSIX_API=no
147        ;;
148  *)
149        RTEMS_CANONICAL_TARGET_CPU
150        ;;
151esac
152
153# Override the set of BSPs to be built.
154AC_ARG_ENABLE(rtemsbsp, \
155  [  --enable-rtemsbsp=bsp1 bsp2 ..   BSPs to include in build], \
156      rtems_bsp=$enableval \
157)
158
159# Is this a supported CPU?
160AC_MSG_CHECKING([if cpu $target_cpu is supported])
161if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
162  AC_MSG_RESULT(yes)
163  makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
164else
165  AC_MSG_ERROR(no)
166fi
167
168dnl NOTE: host_os is automatically set by autoconf
169
170if [[ "${program_prefix}" = "NONE" ]] ; then
171  if [[ "${target}" = "${host}" ]] ; then
172    program_prefix=
173  else
174    program_prefix=${target}-
175  fi
176fi
177
178dnl check target cc
179CC="$program_prefix"gcc
180RTEMS_PROG_CC
181dnl check if the compiler supports --specs
182RTEMS_GCC_SPECS
183dnl check if the target compiler may use --pipe
184RTEMS_GCC_PIPE
185
186dnl check if the compiler supports --specs if gcc28 is requested
187if test "$RTEMS_USE_GCC272" != "yes" ; then
188  if test "$rtems_cv_gcc_specs" = "no"; then
189    AC_MSG_WARN([*** disabling --enable-gcc28])
190     RTEMS_USE_GCC272=yes
191  fi
192fi
193
194dnl check for g++
195if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
196  CXX="$program_prefix"g++
197  RTEMS_PROG_CXX
198  if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
199    AC_MSG_ERROR([***]
200     [Inconsistency in compiler configuration:]
201     [Target C compiler and Target C++ compiler]
202     [must both ether be cross compilers or native compilers]
203     [Hint: LD_LIBRARY_PATH ?] )
204  fi
205  AC_PATH_PROG(CXX_FOR_TARGET,"$program_prefix"g++,no)
206else
207  CXX_FOR_TARGET="no"
208fi
209
210RTEMS_CANONICALIZE_TOOLS
211test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
212
213dnl check host cc
214AC_PROG_CC
215
216dnl check for host library functions
217dnl NOTE: must be called after AC_PROG_CC
218AC_CHECK_FUNCS(strerror)
219
220# find all the Executive Makefiles
221RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
222RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
223RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
224
225if test "$RTEMS_HAS_POSIX_API" = "yes"; then
226  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
227  makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
228fi
229
230# find all the Makefiles for the BSPs
231if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
232  makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
233
234  if test -z "$rtems_bsp"; then
235    AC_MSG_CHECKING([for bsps])
236    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
237    for file in $files; do
238      case $file in
239        shared*);;
240        Makefile*);;
241        READ*);;
242        CVS*);;
243        pxfl*);;
244        go32*);;       # so the i386 port can pick up the other Makefiles
245        # Now account for BSPs with build variants
246        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
247        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
248        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
249        *) rtems_bsp="$rtems_bsp $file";;
250      esac;
251    done
252
253    AC_MSG_RESULT([$rtems_bsp done])
254  fi
255
256  # collect makefiles for each bsp
257  for i in $rtems_bsp; do
258    # make sure there is a make/custom file for the bsp
259    if test ! -r "$srcdir/make/custom/${i}.cfg"; then
260      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
261    fi
262 
263    # account for "aliased" bsps which share source code
264    case $i in
265      mvme162lx)    bspdir=mvme162  ;;  # mvme162 board variant
266      gen68360_040) bspdir=gen68360 ;;  # 68360 in companion mode
267      go32_p5)      bspdir=go32     ;;  # go32 on Pentium class CPU
268      p4600)        bspdir=p4000    ;;  # p4000 board with IDT 4600
269      p4650)        bspdir=p4000    ;;  # p4000 board with IDT 4650
270      *)            bspdir=$i;;
271    esac
272
273    # Is there code where there should be for this BSP?
274    if test -d "$srcdir/c/src/lib/libbsp/$target_cpu/$bspdir"; then
275      RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
276      # make sure the Makefiles in a bsp directory are only done once
277      echo $bspdirs | grep $bspdir >/dev/null 2>&1
278      if test $? -ne 0 ; then
279        bspdirs="$bspdirs $bspdir"
280        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$target_cpu/$bspdir)
281      fi
282    else
283      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
284    fi
285  done
286fi
287
288# find all the CPU dependent library Makefiles
289RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
290
291dnl Workaround for go32
292if test "$skip_startfiles" != "yes"; then
293  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
294fi
295
296dnl END configure.target.in
297
298
299PROJECT_ROOT=`pwd;`
300
301# If RTEMS macros are enabled, then use them.  Otherwise, use inlines.
302if test "$RTEMS_USE_MACROS" = "yes"; then
303  inline_dir=macros
304  if test "$RTEMS_HAS_POSIX_API" = "yes"; then
305    # The problem is that there is currently no code in posix/macros :)
306    AC_MSG_ERROR(Macros are not implemented for the POSIX API)
307  fi
308else
309  inline_dir=inline
310fi
311
312# If the KA9Q TCP/IP stack is enabled, then find all KA9Q Makefiles
313if test "$RTEMS_HAS_KA9Q" = "yes"; then
314  makefiles="$makefiles c/src/lib/libka9q/Makefile"
315fi
316
317# If the C++ support is enabled, then include the Makefiles
318if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
319  makefiles="$makefiles c/src/lib/librtems++/Makefile"
320fi
321
322# If the tests are enabled, then find all the test suite Makefiles
323AC_MSG_CHECKING([if the test suites are enabled? ])
324tests_enabled=yes
325AC_ARG_ENABLE(tests, \
326[  --enable-tests                   enable tests], \
327  [case "${enableval}" in
328    yes) AC_MSG_RESULT(yes) ;;
329    no)  AC_MSG_RESULT(no) ; tests_enabled=no ;;
330    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
331  esac],
332AC_MSG_RESULT(yes)
333)
334
335RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
336
337if test "$tests_enabled" = "yes"; then
338   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
339   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
340   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
341   RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
342   if test "$RTEMS_HAS_POSIX_API" = "yes"; then
343     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
344   fi
345fi
346
347# If the HWAPI is enabled, the find the HWAPI Makefiles
348AC_MSG_CHECKING([if the HWAPI is enabled? ])
349AC_ARG_ENABLE(hwapi, \
350[  --enable-hwapi                 enable hardware API library], \
351  [case "${enableval}" in
352    yes) AC_MSG_RESULT(yes)
353         if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
354            makefiles="$makefiles c/src/lib/libhwapi/Makefile"
355            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
356            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
357            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
358            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/non_volatile_memory)
359            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
360            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
361            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
362         else
363            AC_MSG_ERROR(No source code found for the HWAPI)
364         fi
365         ;;
366    no)  AC_MSG_RESULT(no) ;;
367    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
368  esac],
369  AC_MSG_RESULT(no)
370)
371
372AC_SUBST(rtems_cv_prog_cc_cross)
373AC_SUBST(RTEMS_BSP_LIST)
374AC_SUBST(RTEMS_HOST)
375AC_SUBST(RTEMS_LIBC_DIR)
376AC_SUBST(RTEMS_USE_OWN_PDIR)
377AC_SUBST(RTEMS_HAS_POSIX_API)
378AC_SUBST(RTEMS_HAS_KA9Q)
379AC_SUBST(RTEMS_USE_MACROS)
380AC_SUBST(RTEMS_HAS_CPLUSPLUS)
381AC_SUBST(RTEMS_USE_GCC272)
382AC_SUBST(RTEMS_LIBC_DIR)
383AC_SUBST(PROJECT_ROOT)
384AC_SUBST(program_prefix)
385
386# pick up all the Makefiles in required parts of the tree
387RTEMS_CHECK_MAKEFILE(c/build-tools)
388RTEMS_CHECK_MAKEFILE(make)
389RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
390RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
391
392AC_CONFIG_HEADER(c/build-tools/src/config.h)
393
394# try not to explicitly list a Makefile here
395AC_OUTPUT(
396Makefile
397make/host.cfg
398make/target.cfg
399make/Templates/Makefile.inc
400c/Makefile
401c/src/Makefile
402c/src/exec/Makefile
403c/src/exec/score/Makefile
404c/src/exec/score/cpu/Makefile
405c/src/exec/score/headers/Makefile
406c/src/exec/score/${inline_dir}/Makefile
407c/src/exec/score/src/Makefile
408c/src/exec/score/tools/Makefile
409c/src/exec/score/tools/generic/Makefile
410c/src/exec/score/tools/generic/size_rtems
411c/src/exec/wrapup/Makefile
412c/src/exec/wrapup/rtems/Makefile
413c/src/lib/Makefile
414c/src/lib/include/Makefile
415c/src/lib/libbsp/Makefile
416c/src/lib/libbsp/shmdr/Makefile
417c/src/lib/libc/Makefile
418c/src/lib/libcpu/Makefile
419c/src/lib/start/Makefile
420c/src/lib/wrapup/Makefile
421c/src/tests/Makefile
422c/src/tests/support/Makefile
423c/src/tests/support/include/Makefile
424c/src/tests/support/stubdr/Makefile
425c/src/tests/support/wrapup/Makefile
426c/src/tests/tools/Makefile
427c/src/tests/tools/generic/Makefile
428$makefiles
429c/build-tools/scripts/rtems-glom
430c/update-tools/Makefile)
431
432echo
433echo target architecture: $target_cpu.
434echo available BSPs: $rtems_bsp.
435echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
436echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
437echo
Note: See TracBrowser for help on using the repository browser.