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