source: rtems/configure.in @ 42dc81e

4.104.114.84.95
Last change on this file since 42dc81e was 42dc81e, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 23, 1998 at 11:08:10 PM

Renamed hppa1_1 to hppa1.1

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