source: rtems/configure.in @ 2efdd08

4.104.114.84.95
Last change on this file since 2efdd08 was 2efdd08, checked in by Joel Sherrill <joel.sherrill@…>, on May 20, 1998 at 5:06:57 PM

Patch from Ralf Corseipus to fix latent configure problems suddenly triggered:

The breakdown:

  • CC_FOR_TARGET and CXX_FOR_TARGET were not correctly re-read from autoconf's configuration cache (config.cache)
  • If <target>-[gcc|g++] was not found while running configure, the config macros tried to use other (wrong) compilers (e.g. cc).

Changes:

  • New RTEMS_PROG_CC macro (aclocal/prog-cc.m4).
  • New RTEMS_PROG_CXX macro (aclocal/prog-cxx.m4)
  • Moved a shell script fragment from configure.in to a new m4-autoconf macro (New file: aclocal/tool-prefix.m4)
  • Minor changes to configure.in

I tested it with linux/posix (native gcc/primary libc) and
sh-rtems/gensh1 on a linux host and didn't notice any bugs
related to the problems mentioned above. There seem to be
more bugs with the posix bsp, but I consider them minor as
the build run completed successfully. It is just too late
for me to attempt to fix them now.

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