source: rtems/configure.in @ 41f61bc

4.104.114.84.95
Last change on this file since 41f61bc was 41f61bc, checked in by Joel Sherrill <joel.sherrill@…>, on 02/19/98 at 22:54:14

Updated so test tools are installed even when --disable-tests is
specified. Otherwise a target specific runtest is not installed.

  • Property mode set to 100644
File size: 12.4 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
[3771cc6e]46AC_ARG_ENABLE(cxx, \
47[  --enable-cxx            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   ;;
[3771cc6e]51  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cxx 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)
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
[1670eede]104dnl BEGIN configure.target.in
105
[37717818]106dnl echo "TARGET"
107dnl echo "    cpu    --> $target_cpu"
108dnl echo "    os     --> $target_os"
109dnl echo "    vendor --> $target_vendor"
[1670eede]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
[37717818]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.
[872cc62]121
[744df795]122RTEMS_HOST=$host_os
123
[254b4450]124case "${target}" in
125  # hpux unix port should go here
[2bb990f]126  hppa1.1-*-rtems*)
[1670eede]127        target_cpu=hppa1_1
[254b4450]128        ;;
129  i[[3456]]86-go32-rtems*)
[1670eede]130        target_cpu=i386
[254b4450]131        rtems_bsp="go32 go32_p5"
[37717818]132        skip_startfiles="yes"
[254b4450]133        RTEMS_HAS_POSIX_API=no
134        ;;
135  i[[3456]]86-pc-linux*)         # unix "simulator" port
[1670eede]136        target_cpu=unix
[254b4450]137        RTEMS_HAS_POSIX_API=no
[744df795]138        RTEMS_HOST=Linux
[254b4450]139        ;;
[2bb990f]140  no_cpu-*rtems*)
[1670eede]141        target_cpu=no_cpu
[475fb331]142        RTEMS_HAS_POSIX_API=no
[254b4450]143        ;;
[2bb990f]144  powerpc-*rtems*)
[1670eede]145        target_cpu=ppc
[254b4450]146        ;;
147  sparc-sun-solaris*)             # unix "simulator" port
[1670eede]148        target_cpu=unix
[254b4450]149        RTEMS_HAS_POSIX_API=no
[744df795]150        RTEMS_HOST=Solaris
[254b4450]151        ;;
[1670eede]152  *)
153        RTEMS_CANONICAL_TARGET_CPU
[254b4450]154        ;;
155esac
156
[b9ca4ba]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
[37717818]163# Is this a supported CPU?
[1670eede]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)
[37717818]167  makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile"
[1670eede]168else
169  AC_MSG_ERROR(no)
170fi
171
[3771cc6e]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
[37717818]217# find all the Executive Makefiles
[744df795]218RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
[37717818]219RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
220RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
[b9ca4ba]221
[ba1a2af9]222if test "$RTEMS_HAS_POSIX_API" = "yes"; then
[b9ca4ba]223  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
[ba1a2af9]224  makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
[b9ca4ba]225fi
[1670eede]226
[37717818]227# find all the Makefiles for the BSPs
[1670eede]228if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
[37717818]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*);;
[674c900]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";;
[37717818]246        *) rtems_bsp="$rtems_bsp $file";;
247      esac;
248    done
[674c900]249
[300c8a76]250    AC_MSG_RESULT([$rtems_bsp done])
[37717818]251  fi
252
253  # collect makefiles for each bsp
254  for i in $rtems_bsp; do
[b9ca4ba]255    # make sure there is a make/custom file for the bsp
[6d6f1b34]256    if test ! -r "$srcdir/make/custom/${i}.cfg"; then
[b9ca4ba]257      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
258    fi
[674c900]259 
[b9ca4ba]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
[87cec48]272      RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
[b9ca4ba]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
[1670eede]282  done
283fi
284
[37717818]285# find all the CPU dependent library Makefiles
[1670eede]286RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
287
[37717818]288dnl Workaround for go32
289if test "$skip_startfiles" != "yes"; then
290  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
291fi
[1670eede]292
293dnl END configure.target.in
294
295
[4a7c0451]296PROJECT_ROOT=`pwd;`
[254b4450]297
[566aea7d]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
[80a16ec4]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
[37717818]313
[80a16ec4]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
[1f0f3e35]318
[37717818]319# If the tests are enabled, then find all the test suite Makefiles
320AC_MSG_CHECKING([Are the test suites enabled? ])
[b9ca4ba]321tests_enabled=yes
[254b4450]322AC_ARG_ENABLE(tests, \
[b9ca4ba]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)
[37717818]330)
331
[41f61bc]332RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
333
[b9ca4ba]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
[37717818]344# If the HWAPI is enabled, the find the HWAPI Makefiles
345AC_MSG_CHECKING([Is the HWAPI enabled? ])
[d4cf164]346AC_ARG_ENABLE(hwapi, \
[b9ca4ba]347[  --enable-hwapi                 enable hardware API library], \
348  [case "${enableval}" in
349    yes) AC_MSG_RESULT(yes)
[80a16ec4]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)
[6d6f1b34]355            RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/non_volatile_memory)
[80a16ec4]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         ;;
[b9ca4ba]363    no)  AC_MSG_RESULT(no) ;;
364    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
365  esac],
366  AC_MSG_RESULT(no)
[37717818]367)
[254b4450]368
[87cec48]369AC_SUBST(RTEMS_BSP_LIST)
[254b4450]370AC_SUBST(RTEMS_HOST)
371AC_SUBST(RTEMS_LIBC_DIR)
[91333c2]372AC_SUBST(RTEMS_USE_OWN_PDIR)
[254b4450]373AC_SUBST(RTEMS_HAS_POSIX_API)
[1f0f3e35]374AC_SUBST(RTEMS_HAS_KA9Q)
[254b4450]375AC_SUBST(RTEMS_USE_MACROS)
[91333c2]376AC_SUBST(RTEMS_HAS_CPLUSPLUS)
[e412bae]377AC_SUBST(RTEMS_USE_GCC272)
378AC_SUBST(RTEMS_LIBC_DIR)
[254b4450]379AC_SUBST(PROJECT_ROOT)
380AC_SUBST(program_prefix)
381
[37717818]382# pick up all the Makefiles in required parts of the tree
383RTEMS_CHECK_MAKEFILE(c/build-tools)
[6d6f1b34]384RTEMS_CHECK_MAKEFILE(make)
[37717818]385RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
386RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
[1670eede]387
[243ce5d]388AC_CONFIG_HEADER(c/build-tools/src/config.h)
389
[37717818]390# try not to explicitly list a Makefile here
[1670eede]391AC_OUTPUT(
392Makefile
[3771cc6e]393make/host.cfg
394make/target.cfg
395make/Templates/Makefile.inc
[a50148a]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
[566aea7d]402c/src/exec/score/${inline_dir}/Makefile
[a50148a]403c/src/exec/score/src/Makefile
404c/src/exec/score/tools/Makefile
405c/src/exec/score/tools/generic/Makefile
[6d5769f]406c/src/exec/score/tools/generic/size_rtems
[b9ca4ba]407c/src/exec/wrapup/Makefile
408c/src/exec/wrapup/rtems/Makefile
[a50148a]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
[540292a]425c/build-tools/scripts/rtems-glom
[1670eede]426c/update-tools/Makefile)
[254b4450]427
428echo
429echo target architecture: $target_cpu.
430echo available BSPs: $rtems_bsp.
[87cec48]431echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
432echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
[254b4450]433echo
Note: See TracBrowser for help on using the repository browser.