source: rtems/aclocal.m4 @ 15aa5ffb

4.104.114.84.95
Last change on this file since 15aa5ffb was 15aa5ffb, checked in by Joel Sherrill <joel.sherrill@…>, on 06/14/99 at 18:54:24

Patch ("FIX: no_cpu/no_bsp") from Ralf Corsepius <corsepiu@…>:

This patch should fix the nastiest configuration bugs for no_cpu/no_bsp.

With this patch applied, configure --target=no_cpu-rtems now correctly
acknowledges its configuration, but later fails building when trying to
build libcsupport (I leave this problem for you :-).

Fixes/Changes?:

  • aclocal/canonicalize-target-name.m4: use RTEMS_CPU instead of target_cpu, switch to a native compiler setup if target = no_cpu*rtems, ie. implicitly use host=target (native) and RTEMS_CPU=no_cpu for --target=no_cpu*rtems.
  • add no_bsp/bsp_specs (Support -qrtems, -qrtems_debug; please check before adding :-)
  • Use RTEMS_CANONICALIZE_TARGET_CPU instead of AC_CANONICAL_SYSTEM in toplevel/configure.in
  • All references to $target_cpu in aclocal/*.m4, Makefile.ins and *.cfg files changed to RTEMS_CPU
  • bug fixes to exec/score/cpu/no_cpu/wrap (This part of the patch may result into patch rejections, because your recently posted patch may also have addressed this problem).

After applying this patch, please do:

cvs add c/src/lib/libbsp/no_cpu/no_bsp/bsp_specs
./autogen

  • Property mode set to 100644
File size: 19.9 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl $Id$
14
15dnl
16dnl RTEMS_TOP($1)
17dnl
18dnl $1 .. relative path from this configure.in to the toplevel configure.in
19dnl
20AC_DEFUN(RTEMS_TOP,
21[dnl
22AC_ARG_WITH(target-subdir,
23[  --with-target-subdir=DIR],
24TARGET_SUBDIR="$withval",
25TARGET_SUBDIR=".")
26
27RTEMS_TOPdir="$1";
28AC_SUBST(RTEMS_TOPdir)
29
30PROJECT_ROOT=`pwd`/$RTEMS_TOPdir;
31test "$TARGET_SUBDIR" = "." || PROJECT_ROOT="$PROJECT_ROOT/.."
32AC_SUBST(PROJECT_ROOT)
33
34dnl Determine RTEMS Version string from the VERSION file
35dnl Hopefully, Joel never changes its format ;-
36AC_MSG_CHECKING([for RTEMS Version])
37if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
38changequote(,)dnl
39RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \
40sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
41changequote([,])dnl
42else
43AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
44fi
45if test -z "$RTEMS_VERSION"; then
46AC_MSG_ERROR(Unable to determine version)
47fi
48AC_MSG_RESULT($RTEMS_VERSION)
49
50RTEMS_ROOT='$(top_srcdir)'/$RTEMS_TOPdir;
51AC_SUBST(RTEMS_ROOT)
52])dnl
53
54dnl
55dnl $Id$
56dnl
57
58dnl canonicalize target cpu
59dnl NOTE: Most rtems targets do not fullfil autoconf's
60dnl target naming conventions "processor-vendor-os"
61dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
62dnl and we have to fix it for rtems ourselves
63
64AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
65[
66rtems_target=$target;
67case "$target" in
68no_cpu*) target=$host;;
69*) ;;
70esac
71AC_CANONICAL_SYSTEM
72AC_MSG_CHECKING(rtems target cpu)
73changequote(,)dnl
74case "${rtems_target}" in
75  # hpux unix port should go here
76  i[3456]86-go32-rtems*)
77        RTEMS_CPU=i386
78        ;;
79  i[3456]86-pc-linux*)          # unix "simulator" port
80        RTEMS_CPU=unix
81        ;;
82  i[3456]86-*freebsd2*)         # unix "simulator" port
83        RTEMS_CPU=unix
84        ;;
85  no_cpu-*rtems*)
86        RTEMS_CPU=no_cpu
87        ;;
88  sparc-sun-solaris*)           # unix "simulator" port
89        RTEMS_CPU=unix
90        ;;
91  *)
92        RTEMS_CPU=`echo $rtems_target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
93        ;;
94esac
95changequote([,])dnl
96AC_MSG_RESULT($RTEMS_CPU)
97])
98
99dnl $Id$
100
101AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING,
102[
103AC_ARG_ENABLE(multiprocessing,
104[  --enable-multiprocessing             enable multiprocessing interface],
105[case "${enableval}" in
106  yes) RTEMS_HAS_MULTIPROCESSING=yes ;;
107  no) RTEMS_HAS_MULTIPROCESSING=no ;;
108  *)  AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
109esac],[RTEMS_HAS_MULTIPROCESSING=no])
110AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl
111])
112
113dnl $Id$
114
115AC_DEFUN(RTEMS_ENABLE_POSIX,
116[
117AC_ARG_ENABLE(posix,
118[  --enable-posix                       enable posix interface],
119[case "${enableval}" in
120  yes) RTEMS_HAS_POSIX_API=yes ;;
121  no) RTEMS_HAS_POSIX_API=no ;;
122  *)  AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
123esac],[RTEMS_HAS_POSIX_API=yes])
124AC_SUBST(RTEMS_HAS_POSIX_API)
125
126changequote(,)dnl
127case "${target}" in
128  # hpux unix port should go here
129  i[3456]86-go32-rtems*)
130        RTEMS_HAS_POSIX_API=no
131        ;;
132  i[3456]86-pc-linux*)         # unix "simulator" port
133        RTEMS_HAS_POSIX_API=no
134        ;;
135  i[3456]86-*freebsd2*) # unix "simulator" port
136        RTEMS_HAS_POSIX_API=no
137        ;;
138  no_cpu-*rtems*)
139        RTEMS_HAS_POSIX_API=no
140        ;;
141  sparc-sun-solaris*)             # unix "simulator" port
142        RTEMS_HAS_POSIX_API=no
143        ;;
144  *)
145        ;;
146esac
147changequote([,])dnl
148AC_SUBST(RTEMS_HAS_POSIX_API)
149])
150
151dnl $Id$
152
153AC_DEFUN(RTEMS_ENABLE_NETWORKING,
154[
155AC_ARG_ENABLE(networking,
156[  --enable-networking                  enable TCP/IP stack],
157[case "${enableval}" in
158  yes) RTEMS_HAS_NETWORKING=yes ;;
159  no) RTEMS_HAS_NETWORKING=no ;;
160  *)  AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;;
161esac],[RTEMS_HAS_NETWORKING=yes])
162AC_SUBST(RTEMS_HAS_NETWORKING)dnl
163])
164
165dnl $Id$
166
167AC_DEFUN(RTEMS_ENABLE_RDBG,
168[
169AC_ARG_ENABLE(rdbg,
170[  --enable-rdbg                        enable remote debugger],
171[case "${enableval}" in
172  yes) RTEMS_HAS_RDBG=yes ;;
173  no) RTEMS_HAS_RDBG=no ;;
174  *)  AC_MSG_ERROR(bad value ${enableval} for enable-rdbg option) ;;
175esac],[RTEMS_HAS_RDBG=no])
176AC_SUBST(RTEMS_HAS_RDBG)dnl
177])
178
179dnl $Id$
180
181AC_DEFUN(RTEMS_ENABLE_INLINES,
182[AC_ARG_ENABLE(rtems-inlines,
183[  --enable-rtems-inlines               enable RTEMS inline functions]
184[                                       (default:enabled, disable to use macros)],
185[case "${enableval}" in
186  yes) RTEMS_USE_MACROS=no ;;
187  no) RTEMS_USE_MACROS=yes ;;
188  *)  AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
189esac],[RTEMS_USE_MACROS=no])
190AC_SUBST(RTEMS_USE_MACROS)dnl
191])
192
193dnl $Id$
194
195AC_DEFUN(RTEMS_ENABLE_CXX,
196[
197AC_ARG_ENABLE(cxx,
198[  --enable-cxx                         enable C++ support,]
199[                                       and build the rtems++ library],
200[case "${enableval}" in
201  yes) RTEMS_HAS_CPLUSPLUS=yes ;;
202  no) RTEMS_HAS_CPLUSPLUS=no   ;;
203  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
204esac], [RTEMS_HAS_CPLUSPLUS=no])
205])
206
207dnl $Id$
208
209AC_DEFUN(RTEMS_ENABLE_GCC28,
210[
211AC_ARG_ENABLE(gcc28,
212[  --enable-gcc28                       enable use of gcc 2.8.x features],
213[case "${enableval}" in
214  yes) RTEMS_USE_GCC272=no ;;
215  no) RTEMS_USE_GCC272=yes ;;
216  *)  AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
217esac],[RTEMS_USE_GCC272=no])
218])
219
220dnl $Id$
221
222AC_DEFUN(RTEMS_ENABLE_LIBCDIR,
223[
224AC_ARG_ENABLE(libcdir,
225[  --enable-libcdir=directory           set the directory for the C library],
226[ RTEMS_LIBC_DIR="${enableval}" ; \
227test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
228AC_SUBST(RTEMS_LIBC_DIR)dnl
229])
230
231AC_DEFUN(RTEMS_ENABLE_BARE,
232[
233AC_ARG_ENABLE(bare-cpu-cflags,
234[  --enable-bare-cpu-cflags             specify a particular cpu cflag]
235[                                       (bare bsp specific)],
236[case "${enableval}" in
237  no) BARE_CPU_CFLAGS="" ;;
238  *)    BARE_CPU_CFLAGS="${enableval}" ;;
239esac],
240[BARE_CPU_CFLAGS=""])
241
242AC_ARG_ENABLE(bare-cpu-model,
243[  --enable-bare-cpu-model              specify a particular cpu model]
244[                                       (bare bsp specific)],
245[case "${enableval}" in
246  no)   BARE_CPU_MODEL="" ;;
247  *)    BARE_CPU_MODEL="${enableval}" ;;
248esac],
249[BARE_CPU_MODEL=""])
250])
251
252
253dnl $Id$
254
255AC_DEFUN(RTEMS_PATH_PERL,
256[
257AC_PATH_PROG(PERL,perl)
258if test -z "$PERL" ; then
259AC_MSG_WARN(
260[***]
261[   perl was not found]
262[   Note: Some tools will not be built.])
263fi
264])
265
266dnl $Id$
267
268AC_DEFUN(RTEMS_PATH_KSH,
269[
270dnl NOTE: prefer bash over ksh over sh
271AC_PATH_PROGS(KSH,bash ksh sh)
272if test -z "$KSH"; then
273dnl NOTE: This cannot happen -- /bin/sh must always exist
274AC_MSG_ERROR(
275[***]
276[    Cannot determine a usable shell bash/ksh/sh]
277[    Please contact your system administrator] );
278fi
279])
280
281dnl $Id$
282
283dnl check if RTEMS support a cpu
284AC_DEFUN(RTEMS_CHECK_CPU,
285[dnl
286AC_REQUIRE([RTEMS_TOP])
287AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
288# Is this a supported CPU?
289AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
290if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
291  AC_MSG_RESULT(yes)
292else
293  AC_MSG_ERROR(no)
294fi
295])dnl
296
297
298dnl $Id$
299
300AC_DEFUN(RTEMS_CANONICAL_HOST,
301[dnl
302AC_REQUIRE([AC_CANONICAL_HOST])
303RTEMS_HOST=$host_os
304changequote(,)dnl
305case "${target}" in
306  # hpux unix port should go here
307  i[3456]86-pc-linux*)         # unix "simulator" port
308        RTEMS_HOST=Linux
309        ;;
310  i[3456]86-*freebsd2*) # unix "simulator" port
311        RTEMS_HOST=FreeBSD
312        ;;
313  sparc-sun-solaris*)             # unix "simulator" port
314        RTEMS_HOST=Solaris
315        ;;
316  *)
317        ;;
318esac
319changequote([,])dnl
320AC_SUBST(RTEMS_HOST)
321])dnl
322
323dnl
324dnl  $Id$
325dnl
326dnl Set program_prefix
327dnl
328dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
329dnl                             Extracted from configure
330
331AC_DEFUN(RTEMS_TOOL_PREFIX,
332[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
333AC_REQUIRE([AC_CANONICAL_BUILD])dnl
334
335if [[ "${program_prefix}" = "NONE" ]] ; then
336  if [[ "${target}" = "${host}" ]] ; then
337    program_prefix=
338  else
339    program_prefix=${target}-
340  fi
341fi
342])
343
344dnl
345dnl $Id$
346dnl
347dnl Check for target gcc
348dnl
349dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
350dnl                             Completely reworked
351
352AC_DEFUN(RTEMS_PROG_CC,
353[
354AC_BEFORE([$0], [AC_PROG_CPP])dnl
355AC_BEFORE([$0], [AC_PROG_CC])dnl
356AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
357
358dnl Only accept gcc and cc
359dnl NOTE: This might be too restrictive for native compilation
360AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
361test -z "$CC_FOR_TARGET" \
362  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
363
364dnl backup
365rtems_save_CC=$CC
366rtems_save_CFLAGS=$CFLAGS
367
368dnl temporarily set CC
369CC=$CC_FOR_TARGET
370
371AC_PROG_CC_WORKS
372AC_PROG_CC_GNU
373
374if test $ac_cv_prog_gcc = yes; then
375  GCC=yes
376dnl Check whether -g works, even if CFLAGS is set, in case the package
377dnl plays around with CFLAGS (such as to build both debugging and
378dnl normal versions of a library), tasteless as that idea is.
379  ac_test_CFLAGS="${CFLAGS+set}"
380  ac_save_CFLAGS="$CFLAGS"
381  CFLAGS=
382  AC_PROG_CC_G
383  if test "$ac_test_CFLAGS" = set; then
384    CFLAGS="$ac_save_CFLAGS"
385  elif test $ac_cv_prog_cc_g = yes; then
386    CFLAGS="-g -O2"
387  else
388    CFLAGS="-O2"
389  fi
390else
391  GCC=
392  test "${CFLAGS+set}" = set || CFLAGS="-g"
393fi
394
395rtems_cv_prog_gcc=$ac_cv_prog_gcc
396rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
397rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
398rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
399
400dnl restore initial values
401CC=$rtems_save_CC
402CFLAGS=$rtems_save_CFLAGS
403
404unset ac_cv_prog_gcc
405unset ac_cv_prog_cc_g
406unset ac_cv_prog_cc_works
407unset ac_cv_prog_cc_cross
408])
409
410dnl
411dnl $Id$
412dnl
413dnl Check whether the target compiler accepts -specs
414dnl
415dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
416dnl
417
418AC_DEFUN(RTEMS_GCC_SPECS,
419[AC_REQUIRE([RTEMS_PROG_CC])
420AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
421[
422rtems_cv_gcc_specs=no
423if test "$rtems_cv_prog_gcc" = "yes"; then
424  touch confspec
425  echo 'void f(){}' >conftest.c
426  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
427    rtems_cv_gcc_specs=yes
428  fi
429fi
430rm -f confspec conftest*
431])])
432
433dnl
434dnl $Id$
435dnl
436dnl Check whether the target compiler accepts -pipe
437dnl
438dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
439dnl
440
441AC_DEFUN(RTEMS_GCC_PIPE,
442[AC_REQUIRE([RTEMS_PROG_CC])
443AC_REQUIRE([AC_CANONICAL_HOST])
444AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
445[
446rtems_cv_gcc_pipe=no
447if test "$rtems_cv_prog_gcc" = "yes"; then
448case "$host_os" in
449  cygwin32*)
450    ;;
451  *)
452    echo 'void f(){}' >conftest.c
453    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
454      rtems_cv_gcc_pipe=yes
455    fi
456    rm -f conftest*
457    ;;
458esac
459fi
460])
461])
462
463dnl
464dnl $Id$
465dnl
466dnl Check for target g++
467dnl
468dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
469dnl                             Completely reworked
470
471AC_DEFUN(RTEMS_PROG_CXX,
472[
473AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
474AC_BEFORE([$0], [AC_PROG_CXX])dnl
475AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
476
477dnl Only accept g++ and c++
478dnl NOTE: This might be too restrictive for native compilation
479AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
480test -z "$CXX_FOR_TARGET" \
481  && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
482
483dnl backup
484rtems_save_CXX=$CXX
485rtems_save_CXXFLAGS=$CXXFLAGS
486
487dnl temporarily set CXX
488CXX=$CXX_FOR_TARGET
489
490AC_PROG_CXX_WORKS
491AC_PROG_CXX_GNU
492
493if test $ac_cv_prog_gxx = yes; then
494  GXX=yes
495dnl Check whether -g works, even if CXXFLAGS is set, in case the package
496dnl plays around with CXXFLAGS (such as to build both debugging and
497dnl normal versions of a library), tasteless as that idea is.
498  ac_test_CXXFLAGS="${CXXFLAGS+set}"
499  ac_save_CXXFLAGS="$CXXFLAGS"
500  CXXFLAGS=
501  AC_PROG_CXX_G
502  if test "$ac_test_CXXFLAGS" = set; then
503    CXXFLAGS="$ac_save_CXXFLAGS"
504  elif test $ac_cv_prog_cxx_g = yes; then
505    CXXFLAGS="-g -O2"
506  else
507    CXXFLAGS="-O2"
508  fi
509else
510  GXX=
511  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
512fi
513
514rtems_cv_prog_gxx=$ac_cv_prog_gxx
515rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
516rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
517rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
518
519CXX=$rtems_save_CXX
520CXXFLAGS=$rtems_save_CXXFLAGS
521
522dnl restore initial values
523unset ac_cv_prog_gxx
524unset ac_cv_prog_cc_g
525unset ac_cv_prog_cxx_works
526unset ac_cv_prog_cxx_cross
527])
528
529dnl
530dnl $Id$
531dnl
532dnl Set target tools
533dnl
534dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
535dnl             fixing cache/environment variable handling
536dnl             adding checks for cygwin/egcs '\\'-bug
537dnl             adding checks for ranlib/ar -s problem
538dnl
539dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
540dnl
541
542AC_DEFUN(RTEMS_GCC_PRINT,
543[ case $host_os in
544  *cygwin32*)
545    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
546    dnl        Should be removed once cygwin/egcs reports '/' only
547    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
548    ;;
549  *)
550    $1=`$CC_FOR_TARGET --print-prog-name=$2`
551    ;;
552  esac
553])
554
555AC_DEFUN(RTEMS_PATH_TOOL,
556[
557AC_MSG_CHECKING([target's $2])
558AC_CACHE_VAL(ac_cv_path_$1,:)
559AC_MSG_RESULT([$ac_cv_path_$1])
560
561if test -n "$ac_cv_path_$1"; then
562  dnl retrieve the value from the cache
563  $1=$ac_cv_path_$1
564else
565  dnl the cache was not set
566  if test -z "[$]$1" ; then
567    if test "$rtems_cv_prog_gcc" = "yes"; then
568      # We are using gcc, ask it about its tool
569      # NOTE: Necessary if gcc was configured to use the target's
570      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
571      RTEMS_GCC_PRINT($1,$2)
572    fi
573  else
574    # The user set an environment variable.
575    # Check whether it is an absolute path, otherwise AC_PATH_PROG
576    # will override the environment variable, which isn't what the user
577    # intends
578    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
579    case "[$]$1" in
580    /*) # valid
581      AC_MSG_RESULT("yes")
582    ;;
583    *)  # invalid for AC_PATH_PROG
584      AC_MSG_RESULT("no")
585      AC_MSG_ERROR([***]
586        [Environment variable $1 should either]
587        [be unset (preferred) or contain an absolute path])
588    ;;
589    esac
590  fi
591
592  AC_PATH_PROG($1,"$program_prefix"$2,$3)
593fi
594])
595
596AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
597[AC_REQUIRE([RTEMS_PROG_CC])dnl
598
599dnl FIXME: What shall be done if these tools are not available?
600  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
601  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
602  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
603  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
604
605dnl special treatment of ranlib
606  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
607  if test "$RANLIB_FOR_TARGET" = "no"; then
608    # ranlib wasn't found; check if ar -s is available
609    RTEMS_AR_FOR_TARGET_S
610    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
611      dnl override RANLIB_FOR_TARGET's cache
612      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
613      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
614    else
615      AC_MSG_ERROR([***]
616        [Can't figure out how to build a library index]
617        [Neither ranlib nor ar -s seem to be available] )
618    fi
619  fi
620
621dnl NOTE: These may not be available if not using gnutools
622  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
623  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
624  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
625])
626
627dnl
628dnl $Id$
629dnl
630
631AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
632[
633AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
634rtems_cv_AR_FOR_TARGET_S,
635[
636cat > conftest.$ac_ext <<EOF
637int foo( int b )
638{ return b; }
639EOF
640if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
641  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
642  && test -s conftest.a ; \
643then
644  rtems_cv_AR_FOR_TARGET_S="yes"
645else
646  rtems_cv_AR_FOR_TARGET_S="no"
647fi
648  rm -f conftest*
649])
650])
651
652
653dnl
654dnl  $Id$
655dnl
656
657dnl check for i386 gas supporting 16 bit mode
658dnl     - binutils 2.9.1.0.7 and higher
659
660AC_DEFUN(RTEMS_I386_GAS_CODE16,
661[ if test "${target_cpu}" = "i386"; then
662    AC_CACHE_CHECK([for 16 bit mode assembler support],
663      rtems_cv_prog_gas_code16,
664      [cat > conftest.s << EOF
665         .code16
666         data32
667         addr32
668         lgdt 0
669EOF
670      if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
671        rtems_cv_prog_gas_code16=yes
672      else
673        rtems_cv_prog_gas_code16=no
674      fi])
675    RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
676  fi
677  AC_SUBST(RTEMS_GAS_CODE16)
678])
679
680
681dnl
682dnl $Id$
683dnl
684dnl Check for System V IPC calls used by Unix simulators
685dnl
686dnl 98/07/17 Dario Alcocer     alcocer@netcom.com
687dnl          Ralf Corsepius    corsepiu@faw.uni-ulm.de
688dnl
689dnl Note: $host_os should probably *not* ever be used here to
690dnl determine if host supports System V IPC calls, since some
691dnl (e.g. FreeBSD 2.x) are configured by default to include only
692dnl a subset of the System V IPC calls.  Therefore, to make sure
693dnl all of the required calls are found, test for each call explicitly.
694dnl
695dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
696dnl modify any existing key sets.  See the man pages for semget, shmget,
697dnl msgget, semctl, shmctl and msgctl for details.
698
699AC_DEFUN(RTEMS_SYSV_SEM,
700[AC_REQUIRE([RTEMS_PROG_CC])
701AC_REQUIRE([AC_CANONICAL_HOST])
702AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
703rtems_cv_sysv_sem,
704[
705AC_TRY_RUN([
706#include <sys/types.h>
707#include <sys/ipc.h>
708#include <sys/sem.h>
709int main () {
710#if !defined(sun)
711  union semun arg ;
712#else
713  union semun {
714    int val;
715    struct semid_ds *buf;
716    ushort *array;
717  } arg;
718#endif
719  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
720  if (id == -1)
721    exit(1);
722  arg.val = 0; /* avoid implicit type cast to union */
723  if (semctl(id, 0, IPC_RMID, arg) == -1)
724    exit(1);
725  exit(0);
726}
727],
728rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
729])
730])
731
732AC_DEFUN(RTEMS_SYSV_SHM,
733[AC_REQUIRE([RTEMS_PROG_CC])
734AC_REQUIRE([AC_CANONICAL_HOST])
735AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
736rtems_cv_sysv_shm,
737[
738AC_TRY_RUN([
739#include <sys/types.h>
740#include <sys/ipc.h>
741#include <sys/shm.h>
742int main () {
743  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
744  if (id == -1)
745    exit(1);
746  if (shmctl(id, IPC_RMID, 0) == -1)
747    exit(1);
748  exit(0);
749}
750],
751rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
752])
753])
754
755AC_DEFUN(RTEMS_SYSV_MSG,
756[AC_REQUIRE([RTEMS_PROG_CC])
757AC_REQUIRE([AC_CANONICAL_HOST])
758AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
759rtems_cv_sysv_msg,
760[
761AC_TRY_RUN([
762#include <sys/types.h>
763#include <sys/ipc.h>
764#include <sys/msg.h>
765int main () {
766  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
767  if (id == -1)
768    exit(1);
769  if (msgctl(id, IPC_RMID, 0) == -1)
770    exit(1);
771  exit(0);
772}
773],
774rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
775])
776])
777
778dnl
779dnl $Id$
780dnl
781
782dnl RTEMS_CHECK_MAKEFILE(path)
783dnl Search for Makefile.in's within the directory starting
784dnl at path and append an entry for Makefile to global variable
785dnl "makefiles" (from configure.in) for each Makefile.in found
786dnl
787AC_DEFUN(RTEMS_CHECK_MAKEFILE,
788[RTEMS_CHECK_FILES_IN($1,Makefile,makefiles)
789])
790
791dnl
792dnl $Id$
793dnl
794
795dnl RTEMS_CHECK_FILES_IN(path,file,var)
796dnl path .. path relative to srcdir, where to start searching for files
797dnl file .. name of the files to search for
798dnl var  .. shell variable to append files found
799
800AC_DEFUN(RTEMS_CHECK_FILES_IN,
801[
802AC_MSG_CHECKING(for $2.in in $1)
803if test -d $srcdir/$1; then
804  rtems_av_save_dir=`pwd`;
805  cd $srcdir;
806  rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"`
807  $3="$$3 $rtems_av_tmp";
808  cd $rtems_av_save_dir;
809  AC_MSG_RESULT(done)
810else
811  AC_MSG_RESULT(no)
812fi
813])
814
815
816dnl $Id$
817
818AC_DEFUN(RTEMS_ENABLE_TESTS,
819[
820# If the tests are enabled, then find all the test suite Makefiles
821AC_MSG_CHECKING([if the test suites are enabled? ])
822AC_ARG_ENABLE(tests,
823[  --enable-tests                       enable tests (default:disabled)],
824  [case "${enableval}" in
825    yes) tests_enabled=yes ;;
826    no)  tests_enabled=no ;;
827    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
828  esac], [tests_enabled=no])
829AC_MSG_RESULT([$tests_enabled])
830])
831
832dnl $Id$
833dnl
834dnl FIXME: this needs to be reworked
835
836AC_DEFUN(RTEMS_ENABLE_HWAPI,
837[dnl
838AC_ARG_ENABLE(hwapi, \
839[  --enable-hwapi                       enable hardware API library],
840[case "${enableval}" in
841    yes) RTEMS_HAS_HWAPI=yes ;;
842    no)  RTEMS_HAS_HWAPI=no ;;
843    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
844  esac],[RTEMS_HAS_HWAPI=no])
845AC_SUBST(RTEMS_HAS_HWAPI)dnl
846])dnl
847
Note: See TracBrowser for help on using the repository browser.