source: rtems/c/src/tests/support/aclocal.m4 @ 4075af6f

4.104.114.84.95
Last change on this file since 4075af6f was 4075af6f, checked in by Joel Sherrill <joel.sherrill@…>, on 10/05/99 at 13:49:54

Regenerated.

  • Property mode set to 100644
File size: 19.0 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4a
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_BEFORE([$0], [AC_CONFIG_AUX_DIR])dnl
23AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
24
25AC_ARG_WITH(target-subdir,
26[  --with-target-subdir=DIR],
27TARGET_SUBDIR="$withval",
28TARGET_SUBDIR=".")
29
30RTEMS_TOPdir="$1";
31AC_SUBST(RTEMS_TOPdir)
32
33dnl Determine RTEMS Version string from the VERSION file
34dnl Hopefully, Joel never changes its format ;-
35AC_MSG_CHECKING([for RTEMS Version])
36if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
37changequote(,)dnl
38RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \
39sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
40changequote([,])dnl
41else
42AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
43fi
44if test -z "$RTEMS_VERSION"; then
45AC_MSG_ERROR(Unable to determine version)
46fi
47AC_MSG_RESULT($RTEMS_VERSION)
48])dnl
49
50# Do all the work for Automake.  This macro actually does too much --
51# some checks are only needed if your package does certain things.
52# But this isn't really a big deal.
53
54# serial 1
55
56dnl Usage:
57dnl AM_INIT_AUTOMAKE(package,version, [no-define])
58
59AC_DEFUN(AM_INIT_AUTOMAKE,
60[AC_REQUIRE([AC_PROG_INSTALL])
61dnl We require 2.13 because we rely on SHELL being computed by configure.
62AC_PREREQ([2.13])
63PACKAGE=[$1]
64AC_SUBST(PACKAGE)
65VERSION=[$2]
66AC_SUBST(VERSION)
67dnl test to see if srcdir already configured
68if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
69  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
70fi
71ifelse([$3],,
72AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
73AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
74AC_REQUIRE([AM_SANITY_CHECK])
75AC_REQUIRE([AC_ARG_PROGRAM])
76dnl FIXME This is truly gross.
77missing_dir=`cd $ac_aux_dir && pwd`
78AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
79AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
80AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
81AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
82AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
83AC_REQUIRE([AC_PROG_MAKE_SET])])
84
85#
86# Check to make sure that the build environment is sane.
87#
88
89AC_DEFUN(AM_SANITY_CHECK,
90[AC_MSG_CHECKING([whether build environment is sane])
91# Just in case
92sleep 1
93echo timestamp > conftestfile
94# Do `set' in a subshell so we don't clobber the current shell's
95# arguments.  Must try -L first in case configure is actually a
96# symlink; some systems play weird games with the mod time of symlinks
97# (eg FreeBSD returns the mod time of the symlink's containing
98# directory).
99if (
100   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
101   if test "[$]*" = "X"; then
102      # -L didn't work.
103      set X `ls -t $srcdir/configure conftestfile`
104   fi
105   if test "[$]*" != "X $srcdir/configure conftestfile" \
106      && test "[$]*" != "X conftestfile $srcdir/configure"; then
107
108      # If neither matched, then we have a broken ls.  This can happen
109      # if, for instance, CONFIG_SHELL is bash and it inherits a
110      # broken ls alias from the environment.  This has actually
111      # happened.  Such a system could not be considered "sane".
112      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
113alias in your environment])
114   fi
115
116   test "[$]2" = conftestfile
117   )
118then
119   # Ok.
120   :
121else
122   AC_MSG_ERROR([newly created file is older than distributed files!
123Check your system clock])
124fi
125rm -f conftest*
126AC_MSG_RESULT(yes)])
127
128dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
129dnl The program must properly implement --version.
130AC_DEFUN(AM_MISSING_PROG,
131[AC_MSG_CHECKING(for working $2)
132# Run test in a subshell; some versions of sh will print an error if
133# an executable is not found, even if stderr is redirected.
134# Redirect stdin to placate older versions of autoconf.  Sigh.
135if ($2 --version) < /dev/null > /dev/null 2>&1; then
136   $1=$2
137   AC_MSG_RESULT(found)
138else
139   $1="$3/missing $2"
140   AC_MSG_RESULT(missing)
141fi
142AC_SUBST($1)])
143
144dnl
145dnl $Id$
146dnl
147
148dnl canonicalize target cpu
149dnl NOTE: Most rtems targets do not fullfil autoconf's
150dnl target naming conventions "processor-vendor-os"
151dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
152dnl and we have to fix it for rtems ourselves
153
154AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
155[
156AC_CANONICAL_SYSTEM
157AC_MSG_CHECKING(rtems target cpu)
158changequote(,)dnl
159case "${target}" in
160  # hpux unix port should go here
161  i[3456]86-go32-rtems*)
162        RTEMS_CPU=i386
163        ;;
164  i[3456]86-pc-linux*)          # unix "simulator" port
165        RTEMS_CPU=unix
166        ;;
167  i[3456]86-*freebsd2*)         # unix "simulator" port
168        RTEMS_CPU=unix
169        ;;
170  no_cpu-*rtems*)
171        RTEMS_CPU=no_cpu
172        ;;
173  sparc-sun-solaris*)           # unix "simulator" port
174        RTEMS_CPU=unix
175        ;;
176  *)
177        RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
178        ;;
179esac
180changequote([,])dnl
181AC_SUBST(RTEMS_CPU)
182AC_MSG_RESULT($RTEMS_CPU)
183])
184
185# Add --enable-maintainer-mode option to configure.
186# From Jim Meyering
187
188# serial 1
189
190AC_DEFUN(AM_MAINTAINER_MODE,
191[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
192  dnl maintainer-mode is disabled by default
193  AC_ARG_ENABLE(maintainer-mode,
194[  --enable-maintainer-mode enable make rules and dependencies not useful
195                          (and sometimes confusing) to the casual installer],
196      USE_MAINTAINER_MODE=$enableval,
197      USE_MAINTAINER_MODE=no)
198  AC_MSG_RESULT($USE_MAINTAINER_MODE)
199  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
200  MAINT=$MAINTAINER_MODE_TRUE
201  AC_SUBST(MAINT)dnl
202]
203)
204
205# Define a conditional.
206
207AC_DEFUN(AM_CONDITIONAL,
208[AC_SUBST($1_TRUE)
209AC_SUBST($1_FALSE)
210if $2; then
211  $1_TRUE=
212  $1_FALSE='#'
213else
214  $1_TRUE='#'
215  $1_FALSE=
216fi])
217
218dnl $Id$
219
220AC_DEFUN(RTEMS_ENABLE_POSIX,
221[
222AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl
223
224AC_ARG_ENABLE(posix,
225[  --enable-posix                       enable posix interface],
226[case "${enableval}" in
227  yes) RTEMS_HAS_POSIX_API=yes ;;
228  no) RTEMS_HAS_POSIX_API=no ;;
229  *)  AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
230esac],[RTEMS_HAS_POSIX_API=yes])
231AC_SUBST(RTEMS_HAS_POSIX_API)
232
233changequote(,)dnl
234case "${target}" in
235  # hpux unix port should go here
236  i[3456]86-go32-rtems*)
237        RTEMS_HAS_POSIX_API=no
238        ;;
239  i[3456]86-pc-linux*)         # unix "simulator" port
240        RTEMS_HAS_POSIX_API=no
241        ;;
242  i[3456]86-*freebsd2*) # unix "simulator" port
243        RTEMS_HAS_POSIX_API=no
244        ;;
245  no_cpu-*rtems*)
246        RTEMS_HAS_POSIX_API=no
247        ;;
248  sparc-sun-solaris*)             # unix "simulator" port
249        RTEMS_HAS_POSIX_API=no
250        ;;
251  *)
252        ;;
253esac
254changequote([,])dnl
255AC_SUBST(RTEMS_HAS_POSIX_API)
256])
257
258dnl $Id$
259dnl
260AC_DEFUN(RTEMS_CHECK_POSIX_API,
261[dnl
262AC_REQUIRE([RTEMS_CHECK_CPU])dnl
263AC_REQUIRE([RTEMS_ENABLE_POSIX])dnl
264
265AC_CACHE_CHECK([whether BSP supports libposix],
266  rtems_cv_HAS_POSIX_API,
267  [dnl
268    case "$RTEMS_CPU" in
269    unix*)
270      rtems_cv_HAS_POSIX_API="no"
271      ;;
272    *)
273      if test "${RTEMS_HAS_POSIX_API}" = "yes"; then
274        rtems_cv_HAS_POSIX_API="yes";
275      else
276        rtems_cv_HAS_POSIX_API="disabled";
277      fi
278      ;;
279    esac])
280if test "$rtems_cv_HAS_POSIX_API" = "yes"; then
281  HAS_POSIX_API="yes";
282else
283  HAS_POSIX_API="no";
284fi
285AC_SUBST(HAS_POSIX_API)dnl
286])
287
288dnl $Id$
289
290dnl check if RTEMS support a cpu
291AC_DEFUN(RTEMS_CHECK_CPU,
292[dnl
293AC_REQUIRE([RTEMS_TOP])
294AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
295AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl
296
297# Is this a supported CPU?
298AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
299if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
300  AC_MSG_RESULT(yes)
301else
302  AC_MSG_ERROR(no)
303fi
304])dnl
305
306
307dnl $Id$
308
309dnl Override the set of BSPs to be built.
310dnl used by the toplevel configure script
311dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
312AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
313[
314AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])dnl
315AC_ARG_ENABLE(rtemsbsp,
316[  --enable-rtemsbsp=bsp1 bsp2 ..      BSPs to include in build],
317[case "${enableval}" in
318  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
319  *) $1=$enableval;;
320esac],[$1=""])
321])
322
323dnl Pass a single BSP via an environment variable
324dnl used by per BSP configure scripts
325AC_DEFUN(RTEMS_ENV_RTEMSBSP,
326[dnl
327AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl
328AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl
329AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl
330AC_BEFORE([$0], [RTEMS_CHECK_MULTIPROCESSING])dnl
331AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl
332
333AC_MSG_CHECKING([for RTEMS_BSP])
334AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
335[dnl
336  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
337])dnl
338if test -z "$rtems_cv_RTEMS_BSP"; then
339  AC_MSG_ERROR([Missing RTEMS_BSP])
340fi
341RTEMS_BSP="$rtems_cv_RTEMS_BSP"
342AC_MSG_RESULT(${RTEMS_BSP})
343AC_SUBST(RTEMS_BSP)
344])
345
346dnl
347dnl $Id$
348dnl
349
350AC_DEFUN(RTEMS_PROJECT_ROOT,
351[dnl
352AC_REQUIRE([RTEMS_TOP])
353if test "$TARGET_SUBDIR" = "." ; then
354PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
355else
356PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
357fi
358AC_SUBST(PROJECT_ROOT)
359
360RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
361AC_SUBST(RTEMS_ROOT)
362
363INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
364AC_SUBST(INSTALL_CHANGE)
365
366PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
367AC_SUBST(PACKHEX)
368])
369
370
371dnl $Id$
372
373dnl Report all available bsps for a target,
374dnl check if a bsp-subdirectory is present for all bsps found
375dnl
376dnl RTEMS_CHECK_BSPS(bsp_list)
377AC_DEFUN(RTEMS_CHECK_BSPS,
378[
379AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
380AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
381AC_MSG_CHECKING([for bsps])
382case "${target}" in
383changequote(,)dnl
384  i[3456]86-go32-rtems*)
385changequote([,])dnl
386    $1="go32 go32_p5"
387    ;;
388  *)
389    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
390    for file in $files; do
391      case $file in
392        shared*);;
393        Makefile*);;
394        READ*);;
395        CVS*);;
396        pxfl*);;
397        go32*);;       # so the i386 port can pick up the other Makefiles
398        # Now account for BSPs with build variants
399        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
400        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
401        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
402        *) $1="[$]$1 $file";;
403      esac;
404    done
405    ;;
406esac
407AC_MSG_RESULT([[$]$1 .. done])
408])dnl
409
410AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
411[dnl
412AC_REQUIRE([RTEMS_TOP])
413
414AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
415if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
416  AC_MSG_RESULT([yes])
417else
418  AC_MSG_ERROR([no])
419fi
420])dnl
421
422dnl
423dnl $Id$
424dnl
425
426AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING,
427[dnl
428AC_REQUIRE([RTEMS_TOP])dnl
429AC_REQUIRE([RTEMS_CHECK_CPU])dnl
430AC_REQUIRE([RTEMS_ENABLE_MULTIPROCESSING])dnl
431
432AC_CACHE_CHECK([whether BSP supports multiprocessing],
433  rtems_cv_HAS_MP,
434  [dnl
435    if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}/${$1}/shmsupp"; then
436      if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then
437        rtems_cv_HAS_MP="yes" ;
438      else
439        rtems_cv_HAS_MP="disabled";
440      fi
441    else
442      rtems_cv_HAS_MP="no";
443    fi])
444if test "$rtems_cv_HAS_MP" = "yes"; then
445HAS_MP="yes"
446else
447HAS_MP="no"
448fi
449AC_SUBST(HAS_MP)
450])
451
452dnl $Id$
453
454AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING,
455[
456AC_ARG_ENABLE(multiprocessing,
457[  --enable-multiprocessing             enable multiprocessing interface],
458[case "${enableval}" in
459  yes) RTEMS_HAS_MULTIPROCESSING=yes ;;
460  no) RTEMS_HAS_MULTIPROCESSING=no ;;
461  *)  AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
462esac],[RTEMS_HAS_MULTIPROCESSING=no])
463AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl
464])
465
466dnl $Id$
467
468AC_DEFUN(RTEMS_CANONICAL_HOST,
469[dnl
470AC_REQUIRE([AC_CANONICAL_HOST])
471RTEMS_HOST=$host_os
472changequote(,)dnl
473case "${target}" in
474  # hpux unix port should go here
475  i[3456]86-pc-linux*)         # unix "simulator" port
476        RTEMS_HOST=Linux
477        ;;
478  i[3456]86-*freebsd2*) # unix "simulator" port
479        RTEMS_HOST=FreeBSD
480        ;;
481  sparc-sun-solaris*)             # unix "simulator" port
482        RTEMS_HOST=Solaris
483        ;;
484  *)
485        ;;
486esac
487changequote([,])dnl
488AC_SUBST(RTEMS_HOST)
489])dnl
490
491dnl
492dnl $Id$
493dnl
494dnl Check for target gcc
495dnl
496dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
497dnl                             Completely reworked
498
499AC_DEFUN(RTEMS_PROG_CC,
500[
501AC_BEFORE([$0], [AC_PROG_CPP])dnl
502AC_BEFORE([$0], [AC_PROG_CC])dnl
503AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
504AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
505
506dnl Only accept gcc and cc
507dnl NOTE: This might be too restrictive for native compilation
508AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
509test -z "$CC_FOR_TARGET" \
510  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
511
512dnl backup
513rtems_save_CC=$CC
514rtems_save_CFLAGS=$CFLAGS
515
516dnl temporarily set CC
517CC=$CC_FOR_TARGET
518
519AC_PROG_CC_WORKS
520AC_PROG_CC_GNU
521
522if test $ac_cv_prog_gcc = yes; then
523  GCC=yes
524dnl Check whether -g works, even if CFLAGS is set, in case the package
525dnl plays around with CFLAGS (such as to build both debugging and
526dnl normal versions of a library), tasteless as that idea is.
527  ac_test_CFLAGS="${CFLAGS+set}"
528  ac_save_CFLAGS="$CFLAGS"
529  CFLAGS=
530  AC_PROG_CC_G
531  if test "$ac_test_CFLAGS" = set; then
532    CFLAGS="$ac_save_CFLAGS"
533  elif test $ac_cv_prog_cc_g = yes; then
534    CFLAGS="-g -O2"
535  else
536    CFLAGS="-O2"
537  fi
538else
539  GCC=
540  test "${CFLAGS+set}" = set || CFLAGS="-g"
541fi
542
543rtems_cv_prog_gcc=$ac_cv_prog_gcc
544rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
545rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
546rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
547
548dnl restore initial values
549CC=$rtems_save_CC
550CFLAGS=$rtems_save_CFLAGS
551
552unset ac_cv_prog_gcc
553unset ac_cv_prog_cc_g
554unset ac_cv_prog_cc_works
555unset ac_cv_prog_cc_cross
556])
557
558AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
559[
560dnl check target cc
561RTEMS_PROG_CC
562dnl check if the compiler supports --specs
563RTEMS_GCC_SPECS
564dnl check if the target compiler may use --pipe
565RTEMS_GCC_PIPE
566dnl check if the compiler supports --specs if gcc28 is requested
567if test "$RTEMS_USE_GCC272" != "yes" ; then
568  if test "$rtems_cv_gcc_specs" = "no"; then
569    AC_MSG_WARN([*** disabling --enable-gcc28])
570      RTEMS_USE_GCC272=yes
571  fi
572fi
573test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
574
575dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
576case $host_os in
577*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
578*) ;;
579esac
580AC_SUBST(GCCSED)
581])
582
583dnl
584dnl $Id$
585dnl
586dnl Set target tools
587dnl
588dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
589dnl             fixing cache/environment variable handling
590dnl             adding checks for cygwin/egcs '\\'-bug
591dnl             adding checks for ranlib/ar -s problem
592dnl
593dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
594dnl
595
596AC_DEFUN(RTEMS_GCC_PRINT,
597[ case $host_os in
598  *cygwin*)
599    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
600    dnl        Should be removed once cygwin/egcs reports '/' only
601    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
602    ;;
603  *)
604    $1=`$CC_FOR_TARGET --print-prog-name=$2`
605    ;;
606  esac
607])
608
609AC_DEFUN(RTEMS_PATH_TOOL,
610[
611AC_MSG_CHECKING([target's $2])
612AC_CACHE_VAL(ac_cv_path_$1,:)
613AC_MSG_RESULT([$ac_cv_path_$1])
614
615if test -n "$ac_cv_path_$1"; then
616  dnl retrieve the value from the cache
617  $1=$ac_cv_path_$1
618else
619  dnl the cache was not set
620  if test -z "[$]$1" ; then
621    if test "$rtems_cv_prog_gcc" = "yes"; then
622      # We are using gcc, ask it about its tool
623      # NOTE: Necessary if gcc was configured to use the target's
624      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
625      RTEMS_GCC_PRINT($1,$2)
626    fi
627  else
628    # The user set an environment variable.
629    # Check whether it is an absolute path, otherwise AC_PATH_PROG
630    # will override the environment variable, which isn't what the user
631    # intends
632    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
633    case "[$]$1" in
634    /*) # valid
635      AC_MSG_RESULT("yes")
636    ;;
637    *)  # invalid for AC_PATH_PROG
638      AC_MSG_RESULT("no")
639      AC_MSG_ERROR([***]
640        [Environment variable $1 should either]
641        [be unset (preferred) or contain an absolute path])
642    ;;
643    esac
644  fi
645
646  AC_PATH_PROG($1,"$program_prefix"$2,$3)
647fi
648])
649
650AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
651[AC_REQUIRE([RTEMS_PROG_CC])dnl
652
653dnl FIXME: What shall be done if these tools are not available?
654  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
655  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
656  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
657  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
658
659dnl special treatment of ranlib
660  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
661  if test "$RANLIB_FOR_TARGET" = "no"; then
662    # ranlib wasn't found; check if ar -s is available
663    RTEMS_AR_FOR_TARGET_S
664    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
665      dnl override RANLIB_FOR_TARGET's cache
666      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
667      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
668    else
669      AC_MSG_ERROR([***]
670        [Can't figure out how to build a library index]
671        [Neither ranlib nor ar -s seem to be available] )
672    fi
673  fi
674
675dnl NOTE: These may not be available if not using gnutools
676  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
677  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
678  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
679])
680
681dnl
682dnl $Id$
683dnl
684
685AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
686[
687AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
688rtems_cv_AR_FOR_TARGET_S,
689[
690cat > conftest.$ac_ext <<EOF
691int foo( int b )
692{ return b; }
693EOF
694if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
695  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
696  && test -s conftest.a ; \
697then
698  rtems_cv_AR_FOR_TARGET_S="yes"
699else
700  rtems_cv_AR_FOR_TARGET_S="no"
701fi
702  rm -f conftest*
703])
704])
705
706
707dnl
708dnl  $Id$
709dnl
710dnl Set program_prefix
711dnl
712dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
713dnl                             Extracted from configure
714
715AC_DEFUN(RTEMS_TOOL_PREFIX,
716[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
717AC_REQUIRE([AC_CANONICAL_BUILD])dnl
718
719changequote(,)dnl
720if [ "${program_prefix}" = "NONE" ] ; then
721  if [ "${target}" = "${host}" ] ; then
722    program_prefix=
723  else
724    program_prefix=${target}-
725  fi
726fi
727changequote([,])dnl
728])
729
730dnl
731dnl $Id$
732dnl
733dnl Check whether the target compiler accepts -specs
734dnl
735
736AC_DEFUN(RTEMS_GCC_SPECS,
737[AC_REQUIRE([RTEMS_PROG_CC])
738AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
739[
740rtems_cv_gcc_specs=no
741if test "$rtems_cv_prog_gcc" = "yes"; then
742  touch confspec
743  echo 'void f(){}' >conftest.c
744  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
745    rtems_cv_gcc_specs=yes
746  fi
747fi
748rm -f confspec conftest*
749])])
750
751dnl
752dnl $Id$
753dnl
754dnl Check whether the target compiler accepts -pipe
755dnl
756dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
757dnl
758
759AC_DEFUN(RTEMS_GCC_PIPE,
760[AC_REQUIRE([RTEMS_PROG_CC])
761AC_REQUIRE([AC_CANONICAL_HOST])
762AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
763[
764rtems_cv_gcc_pipe=no
765if test "$rtems_cv_prog_gcc" = "yes"; then
766case "$host_os" in
767  cygwin*)
768    ;;
769  *)
770    echo 'void f(){}' >conftest.c
771    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
772      rtems_cv_gcc_pipe=yes
773    fi
774    rm -f conftest*
775    ;;
776esac
777fi
778])
779])
780
Note: See TracBrowser for help on using the repository browser.