source: rtems/c/src/exec/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.3 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
283AC_DEFUN(RTEMS_ENABLE_GCC28,
284[
285AC_ARG_ENABLE(gcc28,
286[  --enable-gcc28                       enable use of gcc 2.8.x features],
287[case "${enableval}" in
288  yes) RTEMS_USE_GCC272=no ;;
289  no) RTEMS_USE_GCC272=yes ;;
290  *)  AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
291esac],[RTEMS_USE_GCC272=no])
292])
293
294dnl $Id$
295
296AC_DEFUN(RTEMS_ENABLE_LIBCDIR,
297[
298AC_ARG_ENABLE(libcdir,
299[  --enable-libcdir=directory           set the directory for the C library],
300[ RTEMS_LIBC_DIR="${enableval}" ; \
301test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
302AC_SUBST(RTEMS_LIBC_DIR)dnl
303])
304
305dnl $Id$
306
307dnl Override the set of BSPs to be built.
308dnl used by the toplevel configure script
309dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
310AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
311[
312AC_ARG_ENABLE(rtemsbsp,
313[  --enable-rtemsbsp=bsp1 bsp2 ..      BSPs to include in build],
314[case "${enableval}" in
315  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
316  *) $1=$enableval;;
317esac],[$1=""])
318])
319
320dnl Pass a single BSP via an environment variable
321dnl used by per BSP configure scripts
322AC_DEFUN(RTEMS_ENV_RTEMSBSP,
323[dnl
324AC_MSG_CHECKING([for RTEMS_BSP])
325AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
326[dnl
327  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
328])dnl
329if test -z "$rtems_cv_RTEMS_BSP"; then
330  AC_MSG_ERROR([Missing RTEMS_BSP])
331fi
332RTEMS_BSP="$rtems_cv_RTEMS_BSP"
333AC_MSG_RESULT(${RTEMS_BSP})
334AC_SUBST(RTEMS_BSP)
335])
336
337dnl $Id$
338
339dnl check if RTEMS support a cpu
340AC_DEFUN(RTEMS_CHECK_CPU,
341[dnl
342AC_REQUIRE([RTEMS_TOP])
343AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
344# Is this a supported CPU?
345AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
346if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
347  AC_MSG_RESULT(yes)
348else
349  AC_MSG_ERROR(no)
350fi
351])dnl
352
353
354dnl $Id$
355
356AC_DEFUN(RTEMS_CANONICAL_HOST,
357[dnl
358AC_REQUIRE([AC_CANONICAL_HOST])
359RTEMS_HOST=$host_os
360changequote(,)dnl
361case "${target}" in
362  # hpux unix port should go here
363  i[3456]86-pc-linux*)         # unix "simulator" port
364        RTEMS_HOST=Linux
365        ;;
366  i[3456]86-*freebsd2*) # unix "simulator" port
367        RTEMS_HOST=FreeBSD
368        ;;
369  sparc-sun-solaris*)             # unix "simulator" port
370        RTEMS_HOST=Solaris
371        ;;
372  *)
373        ;;
374esac
375changequote([,])dnl
376AC_SUBST(RTEMS_HOST)
377])dnl
378
379dnl
380dnl $Id$
381dnl
382
383AC_DEFUN(RTEMS_PROJECT_ROOT,
384[dnl
385AC_REQUIRE([RTEMS_TOP])
386if test "$TARGET_SUBDIR" = "." ; then
387PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
388else
389PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
390fi
391AC_SUBST(PROJECT_ROOT)
392
393RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
394AC_SUBST(RTEMS_ROOT)
395
396INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
397AC_SUBST(INSTALL_CHANGE)
398
399PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
400AC_SUBST(PACKHEX)
401])
402
403
404dnl
405dnl $Id$
406dnl
407dnl Check for target gcc
408dnl
409dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
410dnl                             Completely reworked
411
412AC_DEFUN(RTEMS_PROG_CC,
413[
414AC_BEFORE([$0], [AC_PROG_CPP])dnl
415AC_BEFORE([$0], [AC_PROG_CC])dnl
416AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
417
418dnl Only accept gcc and cc
419dnl NOTE: This might be too restrictive for native compilation
420AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
421test -z "$CC_FOR_TARGET" \
422  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
423
424dnl backup
425rtems_save_CC=$CC
426rtems_save_CFLAGS=$CFLAGS
427
428dnl temporarily set CC
429CC=$CC_FOR_TARGET
430
431AC_PROG_CC_WORKS
432AC_PROG_CC_GNU
433
434if test $ac_cv_prog_gcc = yes; then
435  GCC=yes
436dnl Check whether -g works, even if CFLAGS is set, in case the package
437dnl plays around with CFLAGS (such as to build both debugging and
438dnl normal versions of a library), tasteless as that idea is.
439  ac_test_CFLAGS="${CFLAGS+set}"
440  ac_save_CFLAGS="$CFLAGS"
441  CFLAGS=
442  AC_PROG_CC_G
443  if test "$ac_test_CFLAGS" = set; then
444    CFLAGS="$ac_save_CFLAGS"
445  elif test $ac_cv_prog_cc_g = yes; then
446    CFLAGS="-g -O2"
447  else
448    CFLAGS="-O2"
449  fi
450else
451  GCC=
452  test "${CFLAGS+set}" = set || CFLAGS="-g"
453fi
454
455rtems_cv_prog_gcc=$ac_cv_prog_gcc
456rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
457rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
458rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
459
460dnl restore initial values
461CC=$rtems_save_CC
462CFLAGS=$rtems_save_CFLAGS
463
464unset ac_cv_prog_gcc
465unset ac_cv_prog_cc_g
466unset ac_cv_prog_cc_works
467unset ac_cv_prog_cc_cross
468])
469
470AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
471[
472dnl check target cc
473RTEMS_PROG_CC
474dnl check if the compiler supports --specs
475RTEMS_GCC_SPECS
476dnl check if the target compiler may use --pipe
477RTEMS_GCC_PIPE
478dnl check if the compiler supports --specs if gcc28 is requested
479if test "$RTEMS_USE_GCC272" != "yes" ; then
480  if test "$rtems_cv_gcc_specs" = "no"; then
481    AC_MSG_WARN([*** disabling --enable-gcc28])
482      RTEMS_USE_GCC272=yes
483  fi
484fi
485test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
486
487dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
488case $host_os in
489*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
490*) ;;
491esac
492AC_SUBST(GCCSED)
493])
494
495dnl
496dnl  $Id$
497dnl
498dnl Set program_prefix
499dnl
500dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
501dnl                             Extracted from configure
502
503AC_DEFUN(RTEMS_TOOL_PREFIX,
504[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
505AC_REQUIRE([AC_CANONICAL_BUILD])dnl
506
507changequote(,)dnl
508if [ "${program_prefix}" = "NONE" ] ; then
509  if [ "${target}" = "${host}" ] ; then
510    program_prefix=
511  else
512    program_prefix=${target}-
513  fi
514fi
515changequote([,])dnl
516])
517
518dnl
519dnl $Id$
520dnl
521dnl Check whether the target compiler accepts -specs
522dnl
523dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
524dnl
525
526AC_DEFUN(RTEMS_GCC_SPECS,
527[AC_REQUIRE([RTEMS_PROG_CC])
528AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
529[
530rtems_cv_gcc_specs=no
531if test "$rtems_cv_prog_gcc" = "yes"; then
532  touch confspec
533  echo 'void f(){}' >conftest.c
534  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
535    rtems_cv_gcc_specs=yes
536  fi
537fi
538rm -f confspec conftest*
539])])
540
541dnl
542dnl $Id$
543dnl
544dnl Check whether the target compiler accepts -pipe
545dnl
546dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
547dnl
548
549AC_DEFUN(RTEMS_GCC_PIPE,
550[AC_REQUIRE([RTEMS_PROG_CC])
551AC_REQUIRE([AC_CANONICAL_HOST])
552AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
553[
554rtems_cv_gcc_pipe=no
555if test "$rtems_cv_prog_gcc" = "yes"; then
556case "$host_os" in
557  cygwin*)
558    ;;
559  *)
560    echo 'void f(){}' >conftest.c
561    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
562      rtems_cv_gcc_pipe=yes
563    fi
564    rm -f conftest*
565    ;;
566esac
567fi
568])
569])
570
571dnl
572dnl $Id$
573dnl
574dnl Set target tools
575dnl
576dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
577dnl             fixing cache/environment variable handling
578dnl             adding checks for cygwin/egcs '\\'-bug
579dnl             adding checks for ranlib/ar -s problem
580dnl
581dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
582dnl
583
584AC_DEFUN(RTEMS_GCC_PRINT,
585[ case $host_os in
586  *cygwin*)
587    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
588    dnl        Should be removed once cygwin/egcs reports '/' only
589    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
590    ;;
591  *)
592    $1=`$CC_FOR_TARGET --print-prog-name=$2`
593    ;;
594  esac
595])
596
597AC_DEFUN(RTEMS_PATH_TOOL,
598[
599AC_MSG_CHECKING([target's $2])
600AC_CACHE_VAL(ac_cv_path_$1,:)
601AC_MSG_RESULT([$ac_cv_path_$1])
602
603if test -n "$ac_cv_path_$1"; then
604  dnl retrieve the value from the cache
605  $1=$ac_cv_path_$1
606else
607  dnl the cache was not set
608  if test -z "[$]$1" ; then
609    if test "$rtems_cv_prog_gcc" = "yes"; then
610      # We are using gcc, ask it about its tool
611      # NOTE: Necessary if gcc was configured to use the target's
612      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
613      RTEMS_GCC_PRINT($1,$2)
614    fi
615  else
616    # The user set an environment variable.
617    # Check whether it is an absolute path, otherwise AC_PATH_PROG
618    # will override the environment variable, which isn't what the user
619    # intends
620    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
621    case "[$]$1" in
622    /*) # valid
623      AC_MSG_RESULT("yes")
624    ;;
625    *)  # invalid for AC_PATH_PROG
626      AC_MSG_RESULT("no")
627      AC_MSG_ERROR([***]
628        [Environment variable $1 should either]
629        [be unset (preferred) or contain an absolute path])
630    ;;
631    esac
632  fi
633
634  AC_PATH_PROG($1,"$program_prefix"$2,$3)
635fi
636])
637
638AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
639[AC_REQUIRE([RTEMS_PROG_CC])dnl
640
641dnl FIXME: What shall be done if these tools are not available?
642  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
643  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
644  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
645  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
646
647dnl special treatment of ranlib
648  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
649  if test "$RANLIB_FOR_TARGET" = "no"; then
650    # ranlib wasn't found; check if ar -s is available
651    RTEMS_AR_FOR_TARGET_S
652    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
653      dnl override RANLIB_FOR_TARGET's cache
654      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
655      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
656    else
657      AC_MSG_ERROR([***]
658        [Can't figure out how to build a library index]
659        [Neither ranlib nor ar -s seem to be available] )
660    fi
661  fi
662
663dnl NOTE: These may not be available if not using gnutools
664  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
665  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
666  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
667])
668
669dnl
670dnl $Id$
671dnl
672
673AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
674[
675AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
676rtems_cv_AR_FOR_TARGET_S,
677[
678cat > conftest.$ac_ext <<EOF
679int foo( int b )
680{ return b; }
681EOF
682if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
683  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
684  && test -s conftest.a ; \
685then
686  rtems_cv_AR_FOR_TARGET_S="yes"
687else
688  rtems_cv_AR_FOR_TARGET_S="no"
689fi
690  rm -f conftest*
691])
692])
693
694
695dnl $Id$
696
697AC_DEFUN(RTEMS_CHECK_NEWLIB,
698[dnl
699AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl
700AC_REQUIRE([RTEMS_CANONICALIZE_TOOLS])dnl
701AC_CACHE_CHECK([for newlib],
702  rtems_cv_use_newlib,
703  [
704    rtems_save_CC=$CC
705    CC=$CC_FOR_TARGET
706
707dnl some versions of newlib provide not_required_by_rtems
708    AC_TRY_LINK(
709      [extern int not_required_by_rtems() ;],
710      [not_required_by_rtems()],
711      rtems_cv_use_newlib="yes")
712
713dnl older versions of newlib provided rtems_provides_crt0
714    if test -z "$rtems_cv_use_newlib"; then
715      AC_TRY_LINK(
716        [extern int rtems_provides_crt0 ;],
717        [rtems_provides_crt0 = 0],
718        rtems_cv_use_newlib="yes",
719        rtems_cv_use_newlib="no")
720    fi
721  CC=$rtems_save_CC])
722RTEMS_USE_NEWLIB="$rtems_cv_use_newlib"
723AC_SUBST(RTEMS_USE_NEWLIB)
724])
725
726
727dnl $Id$
728
729dnl Report all available bsps for a target,
730dnl check if a bsp-subdirectory is present for all bsps found
731dnl
732dnl RTEMS_CHECK_BSPS(bsp_list)
733AC_DEFUN(RTEMS_CHECK_BSPS,
734[
735AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
736AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
737AC_MSG_CHECKING([for bsps])
738case "${target}" in
739changequote(,)dnl
740  i[3456]86-go32-rtems*)
741changequote([,])dnl
742    $1="go32 go32_p5"
743    ;;
744  *)
745    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
746    for file in $files; do
747      case $file in
748        shared*);;
749        Makefile*);;
750        READ*);;
751        CVS*);;
752        pxfl*);;
753        go32*);;       # so the i386 port can pick up the other Makefiles
754        # Now account for BSPs with build variants
755        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
756        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
757        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
758        *) $1="[$]$1 $file";;
759      esac;
760    done
761    ;;
762esac
763AC_MSG_RESULT([[$]$1 .. done])
764])dnl
765
766AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
767[dnl
768AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
769if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
770  AC_MSG_RESULT([yes])
771else
772  AC_MSG_ERROR([no])
773fi
774])dnl
775
776dnl
777dnl $Id$
778dnl
779
780AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING,
781[dnl
782AC_REQUIRE([RTEMS_TOP])dnl
783AC_REQUIRE([RTEMS_CHECK_CPU])dnl
784AC_CACHE_CHECK([whether BSP supports multiprocessing],
785  rtems_cv_HAS_MP,
786  [dnl
787    if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}/${$1}/shmsupp"; then
788      if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then
789        rtems_cv_HAS_MP="yes" ;
790      else
791        rtems_cv_HAS_MP="disabled";
792      fi
793    else
794      rtems_cv_HAS_MP="no";
795    fi])
796if test "$rtems_cv_HAS_MP" = "yes"; then
797HAS_MP="yes"
798else
799HAS_MP="no"
800fi
801AC_SUBST(HAS_MP)
802])
803
804dnl $Id$
805dnl
806AC_DEFUN(RTEMS_CHECK_POSIX_API,
807[dnl
808AC_REQUIRE([RTEMS_CHECK_CPU])dnl
809AC_CACHE_CHECK([whether BSP supports libposix],
810  rtems_cv_HAS_POSIX_API,
811  [dnl
812    case "$RTEMS_CPU" in
813    unix*)
814      rtems_cv_HAS_POSIX_API="no"
815      ;;
816    *)
817      if test "${RTEMS_HAS_POSIX_API}" = "yes"; then
818        rtems_cv_HAS_POSIX_API="yes";
819      else
820        rtems_cv_HAS_POSIX_API="disabled";
821      fi
822      ;;
823    esac])
824if test "$rtems_cv_HAS_POSIX_API" = "yes"; then
825  HAS_POSIX_API="yes";
826else
827  HAS_POSIX_API="no";
828fi
829AC_SUBST(HAS_POSIX_API)dnl
830])
831
Note: See TracBrowser for help on using the repository browser.