source: rtems/c/src/exec/posix/aclocal.m4 @ 473b4e5

4.104.114.84.95
Last change on this file since 473b4e5 was 473b4e5, checked in by Joel Sherrill <joel.sherrill@…>, on 10/04/99 at 13:30:15

Regenerated.

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