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