source: rtems/c/src/tests/samples/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.4 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
481dnl Override the set of BSPs to be built.
482dnl used by the toplevel configure script
483dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
484AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
485[
486AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])dnl
487AC_ARG_ENABLE(rtemsbsp,
488[  --enable-rtemsbsp=bsp1 bsp2 ..      BSPs to include in build],
489[case "${enableval}" in
490  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
491  *) $1=$enableval;;
492esac],[$1=""])
493])
494
495dnl Pass a single BSP via an environment variable
496dnl used by per BSP configure scripts
497AC_DEFUN(RTEMS_ENV_RTEMSBSP,
498[dnl
499AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl
500AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl
501AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl
502AC_BEFORE([$0], [RTEMS_CHECK_MULTIPROCESSING])dnl
503AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl
504
505AC_MSG_CHECKING([for RTEMS_BSP])
506AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
507[dnl
508  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
509])dnl
510if test -z "$rtems_cv_RTEMS_BSP"; then
511  AC_MSG_ERROR([Missing RTEMS_BSP])
512fi
513RTEMS_BSP="$rtems_cv_RTEMS_BSP"
514AC_MSG_RESULT(${RTEMS_BSP})
515AC_SUBST(RTEMS_BSP)
516])
517
518dnl
519dnl $Id$
520dnl
521
522AC_DEFUN(RTEMS_PROJECT_ROOT,
523[dnl
524AC_REQUIRE([RTEMS_TOP])
525if test "$TARGET_SUBDIR" = "." ; then
526PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
527else
528PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
529fi
530AC_SUBST(PROJECT_ROOT)
531
532RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
533AC_SUBST(RTEMS_ROOT)
534
535INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
536AC_SUBST(INSTALL_CHANGE)
537
538PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
539AC_SUBST(PACKHEX)
540])
541
542
543dnl $Id$
544
545dnl Report all available bsps for a target,
546dnl check if a bsp-subdirectory is present for all bsps found
547dnl
548dnl RTEMS_CHECK_BSPS(bsp_list)
549AC_DEFUN(RTEMS_CHECK_BSPS,
550[
551AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
552AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
553AC_MSG_CHECKING([for bsps])
554case "${target}" in
555changequote(,)dnl
556  i[3456]86-go32-rtems*)
557changequote([,])dnl
558    $1="go32 go32_p5"
559    ;;
560  *)
561    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
562    for file in $files; do
563      case $file in
564        shared*);;
565        Makefile*);;
566        READ*);;
567        CVS*);;
568        pxfl*);;
569        go32*);;       # so the i386 port can pick up the other Makefiles
570        # Now account for BSPs with build variants
571        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
572        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
573        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
574        *) $1="[$]$1 $file";;
575      esac;
576    done
577    ;;
578esac
579AC_MSG_RESULT([[$]$1 .. done])
580])dnl
581
582AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
583[dnl
584AC_REQUIRE([RTEMS_TOP])
585
586AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
587if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
588  AC_MSG_RESULT([yes])
589else
590  AC_MSG_ERROR([no])
591fi
592])dnl
593
594dnl
595dnl $Id$
596dnl
597
598AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING,
599[dnl
600AC_REQUIRE([RTEMS_TOP])dnl
601AC_REQUIRE([RTEMS_CHECK_CPU])dnl
602AC_REQUIRE([RTEMS_ENABLE_MULTIPROCESSING])dnl
603
604AC_CACHE_CHECK([whether BSP supports multiprocessing],
605  rtems_cv_HAS_MP,
606  [dnl
607    if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}/${$1}/shmsupp"; then
608      if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then
609        rtems_cv_HAS_MP="yes" ;
610      else
611        rtems_cv_HAS_MP="disabled";
612      fi
613    else
614      rtems_cv_HAS_MP="no";
615    fi])
616if test "$rtems_cv_HAS_MP" = "yes"; then
617HAS_MP="yes"
618else
619HAS_MP="no"
620fi
621AC_SUBST(HAS_MP)
622])
623
624dnl $Id$
625
626AC_DEFUN(RTEMS_CANONICAL_HOST,
627[dnl
628AC_REQUIRE([AC_CANONICAL_HOST])
629RTEMS_HOST=$host_os
630changequote(,)dnl
631case "${target}" in
632  # hpux unix port should go here
633  i[3456]86-pc-linux*)         # unix "simulator" port
634        RTEMS_HOST=Linux
635        ;;
636  i[3456]86-*freebsd2*) # unix "simulator" port
637        RTEMS_HOST=FreeBSD
638        ;;
639  sparc-sun-solaris*)             # unix "simulator" port
640        RTEMS_HOST=Solaris
641        ;;
642  *)
643        ;;
644esac
645changequote([,])dnl
646AC_SUBST(RTEMS_HOST)
647])dnl
648
649dnl
650dnl $Id$
651dnl
652dnl Check for target gcc
653dnl
654dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
655dnl                             Completely reworked
656
657AC_DEFUN(RTEMS_PROG_CC,
658[
659AC_BEFORE([$0], [AC_PROG_CPP])dnl
660AC_BEFORE([$0], [AC_PROG_CC])dnl
661AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
662AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
663
664dnl Only accept gcc and cc
665dnl NOTE: This might be too restrictive for native compilation
666AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
667test -z "$CC_FOR_TARGET" \
668  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
669
670dnl backup
671rtems_save_CC=$CC
672rtems_save_CFLAGS=$CFLAGS
673
674dnl temporarily set CC
675CC=$CC_FOR_TARGET
676
677AC_PROG_CC_WORKS
678AC_PROG_CC_GNU
679
680if test $ac_cv_prog_gcc = yes; then
681  GCC=yes
682dnl Check whether -g works, even if CFLAGS is set, in case the package
683dnl plays around with CFLAGS (such as to build both debugging and
684dnl normal versions of a library), tasteless as that idea is.
685  ac_test_CFLAGS="${CFLAGS+set}"
686  ac_save_CFLAGS="$CFLAGS"
687  CFLAGS=
688  AC_PROG_CC_G
689  if test "$ac_test_CFLAGS" = set; then
690    CFLAGS="$ac_save_CFLAGS"
691  elif test $ac_cv_prog_cc_g = yes; then
692    CFLAGS="-g -O2"
693  else
694    CFLAGS="-O2"
695  fi
696else
697  GCC=
698  test "${CFLAGS+set}" = set || CFLAGS="-g"
699fi
700
701rtems_cv_prog_gcc=$ac_cv_prog_gcc
702rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
703rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
704rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
705
706dnl restore initial values
707CC=$rtems_save_CC
708CFLAGS=$rtems_save_CFLAGS
709
710unset ac_cv_prog_gcc
711unset ac_cv_prog_cc_g
712unset ac_cv_prog_cc_works
713unset ac_cv_prog_cc_cross
714])
715
716AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
717[
718dnl check target cc
719RTEMS_PROG_CC
720dnl check if the compiler supports --specs
721RTEMS_GCC_SPECS
722dnl check if the target compiler may use --pipe
723RTEMS_GCC_PIPE
724dnl check if the compiler supports --specs if gcc28 is requested
725if test "$RTEMS_USE_GCC272" != "yes" ; then
726  if test "$rtems_cv_gcc_specs" = "no"; then
727    AC_MSG_WARN([*** disabling --enable-gcc28])
728      RTEMS_USE_GCC272=yes
729  fi
730fi
731test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
732
733dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
734case $host_os in
735*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
736*) ;;
737esac
738AC_SUBST(GCCSED)
739])
740
741dnl
742dnl $Id$
743dnl
744dnl Set target tools
745dnl
746dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
747dnl             fixing cache/environment variable handling
748dnl             adding checks for cygwin/egcs '\\'-bug
749dnl             adding checks for ranlib/ar -s problem
750dnl
751dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
752dnl
753
754AC_DEFUN(RTEMS_GCC_PRINT,
755[ case $host_os in
756  *cygwin*)
757    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
758    dnl        Should be removed once cygwin/egcs reports '/' only
759    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
760    ;;
761  *)
762    $1=`$CC_FOR_TARGET --print-prog-name=$2`
763    ;;
764  esac
765])
766
767AC_DEFUN(RTEMS_PATH_TOOL,
768[
769AC_MSG_CHECKING([target's $2])
770AC_CACHE_VAL(ac_cv_path_$1,:)
771AC_MSG_RESULT([$ac_cv_path_$1])
772
773if test -n "$ac_cv_path_$1"; then
774  dnl retrieve the value from the cache
775  $1=$ac_cv_path_$1
776else
777  dnl the cache was not set
778  if test -z "[$]$1" ; then
779    if test "$rtems_cv_prog_gcc" = "yes"; then
780      # We are using gcc, ask it about its tool
781      # NOTE: Necessary if gcc was configured to use the target's
782      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
783      RTEMS_GCC_PRINT($1,$2)
784    fi
785  else
786    # The user set an environment variable.
787    # Check whether it is an absolute path, otherwise AC_PATH_PROG
788    # will override the environment variable, which isn't what the user
789    # intends
790    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
791    case "[$]$1" in
792    /*) # valid
793      AC_MSG_RESULT("yes")
794    ;;
795    *)  # invalid for AC_PATH_PROG
796      AC_MSG_RESULT("no")
797      AC_MSG_ERROR([***]
798        [Environment variable $1 should either]
799        [be unset (preferred) or contain an absolute path])
800    ;;
801    esac
802  fi
803
804  AC_PATH_PROG($1,"$program_prefix"$2,$3)
805fi
806])
807
808AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
809[AC_REQUIRE([RTEMS_PROG_CC])dnl
810
811dnl FIXME: What shall be done if these tools are not available?
812  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
813  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
814  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
815  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
816
817dnl special treatment of ranlib
818  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
819  if test "$RANLIB_FOR_TARGET" = "no"; then
820    # ranlib wasn't found; check if ar -s is available
821    RTEMS_AR_FOR_TARGET_S
822    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
823      dnl override RANLIB_FOR_TARGET's cache
824      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
825      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
826    else
827      AC_MSG_ERROR([***]
828        [Can't figure out how to build a library index]
829        [Neither ranlib nor ar -s seem to be available] )
830    fi
831  fi
832
833dnl NOTE: These may not be available if not using gnutools
834  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
835  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
836  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
837])
838
839dnl
840dnl $Id$
841dnl
842
843AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
844[
845AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
846rtems_cv_AR_FOR_TARGET_S,
847[
848cat > conftest.$ac_ext <<EOF
849int foo( int b )
850{ return b; }
851EOF
852if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
853  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
854  && test -s conftest.a ; \
855then
856  rtems_cv_AR_FOR_TARGET_S="yes"
857else
858  rtems_cv_AR_FOR_TARGET_S="no"
859fi
860  rm -f conftest*
861])
862])
863
864
865dnl
866dnl  $Id$
867dnl
868dnl Set program_prefix
869dnl
870dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
871dnl                             Extracted from configure
872
873AC_DEFUN(RTEMS_TOOL_PREFIX,
874[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
875AC_REQUIRE([AC_CANONICAL_BUILD])dnl
876
877changequote(,)dnl
878if [ "${program_prefix}" = "NONE" ] ; then
879  if [ "${target}" = "${host}" ] ; then
880    program_prefix=
881  else
882    program_prefix=${target}-
883  fi
884fi
885changequote([,])dnl
886])
887
888dnl
889dnl $Id$
890dnl
891dnl Check whether the target compiler accepts -specs
892dnl
893
894AC_DEFUN(RTEMS_GCC_SPECS,
895[AC_REQUIRE([RTEMS_PROG_CC])
896AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
897[
898rtems_cv_gcc_specs=no
899if test "$rtems_cv_prog_gcc" = "yes"; then
900  touch confspec
901  echo 'void f(){}' >conftest.c
902  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
903    rtems_cv_gcc_specs=yes
904  fi
905fi
906rm -f confspec conftest*
907])])
908
909dnl
910dnl $Id$
911dnl
912dnl Check whether the target compiler accepts -pipe
913dnl
914dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
915dnl
916
917AC_DEFUN(RTEMS_GCC_PIPE,
918[AC_REQUIRE([RTEMS_PROG_CC])
919AC_REQUIRE([AC_CANONICAL_HOST])
920AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
921[
922rtems_cv_gcc_pipe=no
923if test "$rtems_cv_prog_gcc" = "yes"; then
924case "$host_os" in
925  cygwin*)
926    ;;
927  *)
928    echo 'void f(){}' >conftest.c
929    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
930      rtems_cv_gcc_pipe=yes
931    fi
932    rm -f conftest*
933    ;;
934esac
935fi
936])
937])
938
939dnl
940dnl $Id$
941dnl
942dnl Check for target g++
943dnl
944dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
945dnl                             Completely reworked
946
947AC_DEFUN(RTEMS_PROG_CXX,
948[
949AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
950AC_BEFORE([$0], [AC_PROG_CXX])dnl
951AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
952AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
953
954dnl Only accept g++ and c++
955dnl NOTE: This might be too restrictive for native compilation
956AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
957test -z "$CXX_FOR_TARGET" \
958  && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
959
960dnl backup
961rtems_save_CXX=$CXX
962rtems_save_CXXFLAGS=$CXXFLAGS
963
964dnl temporarily set CXX
965CXX=$CXX_FOR_TARGET
966
967AC_PROG_CXX_WORKS
968AC_PROG_CXX_GNU
969
970if test $ac_cv_prog_gxx = yes; then
971  GXX=yes
972dnl Check whether -g works, even if CXXFLAGS is set, in case the package
973dnl plays around with CXXFLAGS (such as to build both debugging and
974dnl normal versions of a library), tasteless as that idea is.
975  ac_test_CXXFLAGS="${CXXFLAGS+set}"
976  ac_save_CXXFLAGS="$CXXFLAGS"
977  CXXFLAGS=
978  AC_PROG_CXX_G
979  if test "$ac_test_CXXFLAGS" = set; then
980    CXXFLAGS="$ac_save_CXXFLAGS"
981  elif test $ac_cv_prog_cxx_g = yes; then
982    CXXFLAGS="-g -O2"
983  else
984    CXXFLAGS="-O2"
985  fi
986else
987  GXX=
988  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
989fi
990
991rtems_cv_prog_gxx=$ac_cv_prog_gxx
992rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
993rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
994rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
995
996CXX=$rtems_save_CXX
997CXXFLAGS=$rtems_save_CXXFLAGS
998
999dnl restore initial values
1000unset ac_cv_prog_gxx
1001unset ac_cv_prog_cc_g
1002unset ac_cv_prog_cxx_works
1003unset ac_cv_prog_cxx_cross
1004])
1005
1006AC_DEFUN(RTEMS_PROG_CXX_FOR_TARGET,
1007[
1008  RTEMS_PROG_CXX
1009  if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
1010    AC_MSG_ERROR([***]
1011     [Inconsistency in compiler configuration:]
1012     [Target C compiler and Target C++ compiler]
1013     [must both either be cross compilers or native compilers]
1014     [Hint: If building a posix bsp: LD_LIBRARY_PATH?] )
1015  fi
1016])
1017
1018dnl $Id$
1019dnl
1020AC_DEFUN(RTEMS_CHECK_CXX,
1021[dnl
1022AC_REQUIRE([RTEMS_CHECK_CPU])dnl
1023AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl
1024AC_REQUIRE([RTEMS_PROG_CXX_FOR_TARGET])dnl
1025AC_CACHE_CHECK([whether to build rtems++],
1026  rtems_cv_HAS_CPLUSPLUS,
1027  [ if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
1028      if test -n "$CXX_FOR_TARGET"; then
1029        rtems_cv_HAS_CPLUSPLUS="yes"
1030      else
1031        rtems_cv_HAS_CPLUSPLUS="no"
1032      fi
1033    else
1034      rtems_cv_HAS_CPLUSPLUS="no"
1035    fi])
1036HAS_CPLUSPLUS="$rtems_cv_HAS_CPLUSPLUS";
1037AC_SUBST(HAS_CPLUSPLUS)dnl
1038])
1039
Note: See TracBrowser for help on using the repository browser.