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 01/22/98 at 15:20:43

Corrected/simplified setting of RTEMS_ROOT.

  • Property mode set to 100644
File size: 11.9 KB
RevLine 
[254b4450]1dnl Process this file with autoconf to produce a configure script.
[6f9c75c3]2dnl
3dnl  $Id$
4
[254b4450]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
[91333c2]14AC_ARG_ENABLE(gmake-print-directory, \
15[  --enable-gmake-print-directory    enable GNU Make's print directory], \
16[case "${enableval}" in
[39ffc7d]17  yes) RTEMS_USE_OWN_PDIR=no ;;
18  no) RTEMS_USE_OWN_PDIR=yes ;;
[91333c2]19  *)  AC_MSG_ERROR(bad value ${enableval} for gmake-print-directory option) ;;
20esac],[RTEMS_USE_OWN_PDIR=yes])
21
[254b4450]22AC_ARG_ENABLE(posix, \
[ba1a2af9]23[  --enable-posix                   enable posix interface], \
[69df7da]24[case "${enableval}" in
25  yes) RTEMS_HAS_POSIX_API=yes ;;
26  no) RTEMS_HAS_POSIX_API=no ;;
[ba1a2af9]27  *)  AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
[69df7da]28esac],[RTEMS_HAS_POSIX_API=yes])
[254b4450]29
[1f0f3e35]30AC_ARG_ENABLE(ka9q, \
[ba1a2af9]31[  --enable-ka9q                enable KA9Q TCP/IP stack], \
[1f0f3e35]32[case "${enableval}" in
33  yes) RTEMS_HAS_KA9Q=yes ;;
34  no) RTEMS_HAS_KA9Q=no ;;
[ba1a2af9]35  *)  AC_MSG_ERROR(bad value ${enableval} for enable-ka9q option) ;;
[1f0f3e35]36esac],[RTEMS_HAS_KA9Q=yes])
37
[254b4450]38AC_ARG_ENABLE(rtems-inlines, \
[ba1a2af9]39[  --enable-rtems-inlines           enable RTEMS inline functions (use macros)], \
[69df7da]40[case "${enableval}" in
[ba1a2af9]41  yes) RTEMS_USE_MACROS=no ;;
42  no) RTEMS_USE_MACROS=yes ;;
[69df7da]43  *)  AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
44esac],[RTEMS_USE_MACROS=no])
[254b4450]45
[3f70e3c]46AC_ARG_ENABLE(cpp, \
[37717818]47[  --enable-cpp            enable C++ support, and build the rtems++ library], \
[3f70e3c]48[case "${enableval}" in
[91333c2]49  yes) RTEMS_HAS_CPLUSPLUS=yes ;;
[37717818]50  no) RTEMS_HAS_CPLUSPLUS=no   ;;
[91333c2]51  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cpp option) ;;
[37717818]52esac], [RTEMS_HAS_CPLUSPLUS=no])
[91333c2]53
[971cd22]54AC_ARG_ENABLE(gcc28, \
[e412bae]55[  --enable-gcc28                   enable use of gcc 2.8.x features], \
[69df7da]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) ;;
[fcb114c1]60esac],[RTEMS_USE_GCC272=no])
[e412bae]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
[254b4450]67RTEMS_PREFIX=${target_cpu}-${target_vendor}
68
[a50148a]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)
[37717818]76AC_PROG_LN_S
[a50148a]77AC_PATH_PROG(CHMOD,chmod)
78AC_PATH_PROG(SORT,sort)
[9ad1f13]79AC_CHECK_FUNCS(strerror)
[a50148a]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
[1670eede]107dnl BEGIN configure.target.in
108
[37717818]109dnl echo "TARGET"
110dnl echo "    cpu    --> $target_cpu"
111dnl echo "    os     --> $target_os"
112dnl echo "    vendor --> $target_vendor"
[1670eede]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
[37717818]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.
[872cc62]124
[744df795]125RTEMS_HOST=$host_os
126
[254b4450]127case "${target}" in
128  # hpux unix port should go here
129  hppa1.1-rtems*)
[1670eede]130        target_cpu=hppa1_1
[254b4450]131        ;;
132  i[[3456]]86-go32-rtems*)
[1670eede]133        target_cpu=i386
[254b4450]134        rtems_bsp="go32 go32_p5"
[37717818]135        skip_startfiles="yes"
[254b4450]136        RTEMS_HAS_POSIX_API=no
137        ;;
138  i[[3456]]86-rtems*)
[1670eede]139        target_cpu=i386
[254b4450]140        ;;
141  i[[3456]]86-pc-linux*)         # unix "simulator" port
[1670eede]142        target_cpu=unix
[254b4450]143        RTEMS_HAS_POSIX_API=no
[744df795]144        RTEMS_HOST=Linux
[254b4450]145        ;;
146  no_cpu-rtems*)
[1670eede]147        target_cpu=no_cpu
[475fb331]148        RTEMS_HAS_POSIX_API=no
[254b4450]149        ;;
[674c900]150  powerpc-*tems*)
[1670eede]151        target_cpu=ppc
[254b4450]152        ;;
153  sparc-sun-solaris*)             # unix "simulator" port
[1670eede]154        target_cpu=unix
[254b4450]155        RTEMS_HAS_POSIX_API=no
[744df795]156        RTEMS_HOST=Solaris
[254b4450]157        ;;
[1670eede]158  *)
159        RTEMS_CANONICAL_TARGET_CPU
[254b4450]160        ;;
161esac
162
[b9ca4ba]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
[37717818]169# Is this a supported CPU?
[1670eede]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)
[37717818]173  makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
[1670eede]174else
175  AC_MSG_ERROR(no)
176fi
177
[37717818]178# find all the Executive Makefiles
[744df795]179RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
[37717818]180RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
181RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
[b9ca4ba]182
[ba1a2af9]183if test "$RTEMS_HAS_POSIX_API" = "yes"; then
[b9ca4ba]184  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
[ba1a2af9]185  makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
[b9ca4ba]186fi
[1670eede]187
[37717818]188# find all the Makefiles for the BSPs
[1670eede]189if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
[37717818]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*);;
[674c900]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";;
[37717818]207        *) rtems_bsp="$rtems_bsp $file";;
208      esac;
209    done
[674c900]210
[300c8a76]211    AC_MSG_RESULT([$rtems_bsp done])
[37717818]212  fi
213
214  # collect makefiles for each bsp
215  for i in $rtems_bsp; do
[b9ca4ba]216    # make sure there is a make/custom file for the bsp
[6d6f1b34]217    if test ! -r "$srcdir/make/custom/${i}.cfg"; then
[b9ca4ba]218      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
219    fi
[674c900]220 
[b9ca4ba]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
[87cec48]233      RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
[b9ca4ba]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
[1670eede]243  done
244fi
245
[37717818]246# find all the CPU dependent library Makefiles
[1670eede]247RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
248
[37717818]249dnl Workaround for go32
250if test "$skip_startfiles" != "yes"; then
251  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
252fi
[1670eede]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
[a50148a]262dnl NOTE: host_os is automatically set by autoconf
[254b4450]263
264if [[ "${program_prefix}" = "NONE" ]] ; then
265  if [[ "${target}" = "${host}" ]] ; then
266    program_prefix=
267  else
268    program_prefix=${target}-
269  fi
270fi
271
[ba024755]272RTEMS_ROOT=$srcdir
273PROJECT_ROOT=`pwd`
[254b4450]274
[566aea7d]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
[80a16ec4]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
[37717818]290
[80a16ec4]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
[1f0f3e35]295
[37717818]296# If the tests are enabled, then find all the test suite Makefiles
297AC_MSG_CHECKING([Are the test suites enabled? ])
[b9ca4ba]298tests_enabled=yes
[254b4450]299AC_ARG_ENABLE(tests, \
[b9ca4ba]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)
[37717818]307)
308
[b9ca4ba]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
[37717818]320# If the HWAPI is enabled, the find the HWAPI Makefiles
321AC_MSG_CHECKING([Is the HWAPI enabled? ])
[d4cf164]322AC_ARG_ENABLE(hwapi, \
[b9ca4ba]323[  --enable-hwapi                 enable hardware API library], \
324  [case "${enableval}" in
325    yes) AC_MSG_RESULT(yes)
[80a16ec4]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)
[6d6f1b34]331            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/non_volatile_memory)
[80a16ec4]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         ;;
[b9ca4ba]339    no)  AC_MSG_RESULT(no) ;;
340    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
341  esac],
342  AC_MSG_RESULT(no)
[37717818]343)
[254b4450]344
[87cec48]345AC_SUBST(RTEMS_BSP_LIST)
[254b4450]346AC_SUBST(RTEMS_HOST)
347AC_SUBST(RTEMS_LIBC_DIR)
348AC_SUBST(RTEMS_ROOT)
[91333c2]349AC_SUBST(RTEMS_USE_OWN_PDIR)
[254b4450]350AC_SUBST(RTEMS_HAS_POSIX_API)
[1f0f3e35]351AC_SUBST(RTEMS_HAS_KA9Q)
[254b4450]352AC_SUBST(RTEMS_USE_MACROS)
[91333c2]353AC_SUBST(RTEMS_HAS_CPLUSPLUS)
[e412bae]354AC_SUBST(RTEMS_USE_GCC272)
355AC_SUBST(RTEMS_LIBC_DIR)
[254b4450]356AC_SUBST(PROJECT_ROOT)
357AC_SUBST(program_prefix)
358
[37717818]359# pick up all the Makefiles in required parts of the tree
360RTEMS_CHECK_MAKEFILE(c/build-tools)
[6d6f1b34]361RTEMS_CHECK_MAKEFILE(make)
[37717818]362RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
363RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
[1670eede]364
[37717818]365# try not to explicitly list a Makefile here
[1670eede]366AC_OUTPUT(
367Makefile
[a50148a]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
[566aea7d]374c/src/exec/score/${inline_dir}/Makefile
[a50148a]375c/src/exec/score/src/Makefile
376c/src/exec/score/tools/Makefile
377c/src/exec/score/tools/generic/Makefile
[6d5769f]378c/src/exec/score/tools/generic/size_rtems
[b9ca4ba]379c/src/exec/wrapup/Makefile
380c/src/exec/wrapup/rtems/Makefile
[a50148a]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
[6d6f1b34]397make/host.cfg
398make/target.cfg
399make/Templates/Makefile.inc
[9ad1f13]400c/build-tools/src/config.h
[1670eede]401c/update-tools/Makefile)
[254b4450]402
403echo
404echo target architecture: $target_cpu.
405echo available BSPs: $rtems_bsp.
[87cec48]406echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
407echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
[254b4450]408echo
Note: See TracBrowser for help on using the repository browser.