source: rtems/c/src/lib/libbsp/powerpc/mpc8260ads/aclocal.m4 @ 22afde51

4.104.114.84.95
Last change on this file since 22afde51 was 22afde51, checked in by Joel Sherrill <joel.sherrill@…>, on 10/24/01 at 23:50:01

2001-10-23 Ralf Corsepius <corsepiu@…>

  • aclocal.m4: Regenerated.
  • configure.ac, include/Makefile.am, irq/Makefile.am, vectors/Makefile.am: Updated to autoconf 2.52.
  • include/.cvsignore: Added newly generated files.
  • include/bsp.h: Added include of bspopts.h.
  • Property mode set to 100644
File size: 30.8 KB
Line 
1# aclocal.m4 generated automatically by aclocal 1.5
2
3# Copyright 1996, 1997, 1998, 1999, 2000, 2001
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14dnl $Id$
15
16dnl
17dnl RTEMS_TOP($1)
18dnl
19dnl $1 .. relative path from this configure.in to the toplevel configure.in
20dnl
21AC_DEFUN(RTEMS_TOP,
22[dnl
23AC_CHECK_PROGS(MAKE, gmake make)
24AC_BEFORE([$0], [AC_CONFIG_AUX_DIR])dnl
25AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
26
27AC_PREFIX_DEFAULT([/opt/rtems])
28
29ENDIF=endif
30AC_SUBST(ENDIF)
31
32RTEMS_TOPdir="$1";
33AC_SUBST(RTEMS_TOPdir)
34
35test -n "$with_target_subdir" || with_target_subdir="."
36
37if test "$with_target_subdir" = "." ; then
38# Native
39PROJECT_TOPdir=${RTEMS_TOPdir}/'$(top_builddir)'
40else
41# Cross
42dots=`echo $with_target_subdir|\
43sed -e 's%^\./%%' -e 's%[[^/]]$%&/%' -e 's%[[^/]]*/%../%g'`
44PROJECT_TOPdir=${dots}${RTEMS_TOPdir}/'$(top_builddir)'
45fi
46AC_SUBST(PROJECT_TOPdir)
47
48if test "$with_target_subdir" = "." ; then
49# Native
50PROJECT_ROOT=${RTEMS_TOPdir}/'$(top_builddir)';
51else
52# Cross
53PROJECT_ROOT=${RTEMS_TOPdir}/'$(top_builddir)'
54fi
55AC_SUBST(PROJECT_ROOT)
56
57dnl Determine RTEMS Version string from the VERSION file
58dnl Hopefully, Joel never changes its format ;-
59AC_MSG_CHECKING([for RTEMS Version])
60if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
61RTEMS_VERSION=`grep 'RTEMS Version' ${srcdir}/${RTEMS_TOPdir}/VERSION | \
62sed -e 's%RTEMS[[       ]]*Version[[    ]]*\(.*\)[[     ]]*%\1%g'`
63else
64AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
65fi
66if test -z "$RTEMS_VERSION"; then
67AC_MSG_ERROR(Unable to determine version)
68fi
69AC_MSG_RESULT($RTEMS_VERSION)
70])dnl
71
72# Do all the work for Automake.  This macro actually does too much --
73# some checks are only needed if your package does certain things.
74# But this isn't really a big deal.
75
76# serial 5
77
78# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
79# written in clear, in which case automake, when reading aclocal.m4,
80# will think it sees a *use*, and therefore will trigger all it's
81# C support machinery.  Also note that it means that autoscan, seeing
82# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
83
84
85# We require 2.13 because we rely on SHELL being computed by configure.
86AC_PREREQ([2.13])
87
88# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
89# -----------------------------------------------------------
90# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
91# The purpose of this macro is to provide the user with a means to
92# check macros which are provided without letting her know how the
93# information is coded.
94# If this macro is not defined by Autoconf, define it here.
95ifdef([AC_PROVIDE_IFELSE],
96      [],
97      [define([AC_PROVIDE_IFELSE],
98              [ifdef([AC_PROVIDE_$1],
99                     [$2], [$3])])])
100
101
102# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
103# ----------------------------------------------
104AC_DEFUN([AM_INIT_AUTOMAKE],
105[AC_REQUIRE([AC_PROG_INSTALL])dnl
106# test to see if srcdir already configured
107if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
108   test -f $srcdir/config.status; then
109  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
110fi
111
112# Define the identity of the package.
113PACKAGE=$1
114AC_SUBST(PACKAGE)dnl
115VERSION=$2
116AC_SUBST(VERSION)dnl
117ifelse([$3],,
118[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
119AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
120
121# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
122# the ones we care about.
123ifdef([m4_pattern_allow],
124      [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
125
126# Autoconf 2.50 always computes EXEEXT.  However we need to be
127# compatible with 2.13, for now.  So we always define EXEEXT, but we
128# don't compute it.
129AC_SUBST(EXEEXT)
130# Similar for OBJEXT -- only we only use OBJEXT if the user actually
131# requests that it be used.  This is a bit dumb.
132: ${OBJEXT=o}
133AC_SUBST(OBJEXT)
134
135# Some tools Automake needs.
136AC_REQUIRE([AM_SANITY_CHECK])dnl
137AC_REQUIRE([AC_ARG_PROGRAM])dnl
138AM_MISSING_PROG(ACLOCAL, aclocal)
139AM_MISSING_PROG(AUTOCONF, autoconf)
140AM_MISSING_PROG(AUTOMAKE, automake)
141AM_MISSING_PROG(AUTOHEADER, autoheader)
142AM_MISSING_PROG(MAKEINFO, makeinfo)
143AM_MISSING_PROG(AMTAR, tar)
144AM_PROG_INSTALL_SH
145AM_PROG_INSTALL_STRIP
146# We need awk for the "check" target.  The system "awk" is bad on
147# some platforms.
148AC_REQUIRE([AC_PROG_AWK])dnl
149AC_REQUIRE([AC_PROG_MAKE_SET])dnl
150AC_REQUIRE([AM_DEP_TRACK])dnl
151AC_REQUIRE([AM_SET_DEPDIR])dnl
152AC_PROVIDE_IFELSE([AC_PROG_][CC],
153                  [_AM_DEPENDENCIES(CC)],
154                  [define([AC_PROG_][CC],
155                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
156AC_PROVIDE_IFELSE([AC_PROG_][CXX],
157                  [_AM_DEPENDENCIES(CXX)],
158                  [define([AC_PROG_][CXX],
159                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
160])
161
162#
163# Check to make sure that the build environment is sane.
164#
165
166# serial 3
167
168# AM_SANITY_CHECK
169# ---------------
170AC_DEFUN([AM_SANITY_CHECK],
171[AC_MSG_CHECKING([whether build environment is sane])
172# Just in case
173sleep 1
174echo timestamp > conftest.file
175# Do `set' in a subshell so we don't clobber the current shell's
176# arguments.  Must try -L first in case configure is actually a
177# symlink; some systems play weird games with the mod time of symlinks
178# (eg FreeBSD returns the mod time of the symlink's containing
179# directory).
180if (
181   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
182   if test "$[*]" = "X"; then
183      # -L didn't work.
184      set X `ls -t $srcdir/configure conftest.file`
185   fi
186   rm -f conftest.file
187   if test "$[*]" != "X $srcdir/configure conftest.file" \
188      && test "$[*]" != "X conftest.file $srcdir/configure"; then
189
190      # If neither matched, then we have a broken ls.  This can happen
191      # if, for instance, CONFIG_SHELL is bash and it inherits a
192      # broken ls alias from the environment.  This has actually
193      # happened.  Such a system could not be considered "sane".
194      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
195alias in your environment])
196   fi
197
198   test "$[2]" = conftest.file
199   )
200then
201   # Ok.
202   :
203else
204   AC_MSG_ERROR([newly created file is older than distributed files!
205Check your system clock])
206fi
207AC_MSG_RESULT(yes)])
208
209
210# serial 2
211
212# AM_MISSING_PROG(NAME, PROGRAM)
213# ------------------------------
214AC_DEFUN([AM_MISSING_PROG],
215[AC_REQUIRE([AM_MISSING_HAS_RUN])
216$1=${$1-"${am_missing_run}$2"}
217AC_SUBST($1)])
218
219
220# AM_MISSING_HAS_RUN
221# ------------------
222# Define MISSING if not defined so far and test if it supports --run.
223# If it does, set am_missing_run to use it, otherwise, to nothing.
224AC_DEFUN([AM_MISSING_HAS_RUN],
225[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
226test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
227# Use eval to expand $SHELL
228if eval "$MISSING --run true"; then
229  am_missing_run="$MISSING --run "
230else
231  am_missing_run=
232  am_backtick='`'
233  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
234fi
235])
236
237# AM_AUX_DIR_EXPAND
238
239# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
240# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
241# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
242#
243# Of course, Automake must honor this variable whenever it calls a
244# tool from the auxiliary directory.  The problem is that $srcdir (and
245# therefore $ac_aux_dir as well) can be either absolute or relative,
246# depending on how configure is run.  This is pretty annoying, since
247# it makes $ac_aux_dir quite unusable in subdirectories: in the top
248# source directory, any form will work fine, but in subdirectories a
249# relative path needs to be adjusted first.
250#
251# $ac_aux_dir/missing
252#    fails when called from a subdirectory if $ac_aux_dir is relative
253# $top_srcdir/$ac_aux_dir/missing
254#    fails if $ac_aux_dir is absolute,
255#    fails when called from a subdirectory in a VPATH build with
256#          a relative $ac_aux_dir
257#
258# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
259# are both prefixed by $srcdir.  In an in-source build this is usually
260# harmless because $srcdir is `.', but things will broke when you
261# start a VPATH build or use an absolute $srcdir.
262#
263# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
264# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
265#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
266# and then we would define $MISSING as
267#   MISSING="\${SHELL} $am_aux_dir/missing"
268# This will work as long as MISSING is not called from configure, because
269# unfortunately $(top_srcdir) has no meaning in configure.
270# However there are other variables, like CC, which are often used in
271# configure, and could therefore not use this "fixed" $ac_aux_dir.
272#
273# Another solution, used here, is to always expand $ac_aux_dir to an
274# absolute PATH.  The drawback is that using absolute paths prevent a
275# configured tree to be moved without reconfiguration.
276
277AC_DEFUN([AM_AUX_DIR_EXPAND], [
278# expand $ac_aux_dir to an absolute path
279am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
280])
281
282# AM_PROG_INSTALL_SH
283# ------------------
284# Define $install_sh.
285AC_DEFUN([AM_PROG_INSTALL_SH],
286[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
287install_sh=${install_sh-"$am_aux_dir/install-sh"}
288AC_SUBST(install_sh)])
289
290# One issue with vendor `install' (even GNU) is that you can't
291# specify the program used to strip binaries.  This is especially
292# annoying in cross-compiling environments, where the build's strip
293# is unlikely to handle the host's binaries.
294# Fortunately install-sh will honor a STRIPPROG variable, so we
295# always use install-sh in `make install-strip', and initialize
296# STRIPPROG with the value of the STRIP variable (set by the user).
297AC_DEFUN([AM_PROG_INSTALL_STRIP],
298[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
299INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
300AC_SUBST([INSTALL_STRIP_PROGRAM])])
301
302# serial 4                                              -*- Autoconf -*-
303
304
305
306# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
307# written in clear, in which case automake, when reading aclocal.m4,
308# will think it sees a *use*, and therefore will trigger all it's
309# C support machinery.  Also note that it means that autoscan, seeing
310# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
311
312
313
314# _AM_DEPENDENCIES(NAME)
315# ---------------------
316# See how the compiler implements dependency checking.
317# NAME is "CC", "CXX" or "OBJC".
318# We try a few techniques and use that to set a single cache variable.
319#
320# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
321# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
322# dependency, and given that the user is not expected to run this macro,
323# just rely on AC_PROG_CC.
324AC_DEFUN([_AM_DEPENDENCIES],
325[AC_REQUIRE([AM_SET_DEPDIR])dnl
326AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
327AC_REQUIRE([AM_MAKE_INCLUDE])dnl
328AC_REQUIRE([AM_DEP_TRACK])dnl
329
330ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
331       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
332       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
333       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
334                   [depcc="$$1"   am_compiler_list=])
335
336AC_CACHE_CHECK([dependency style of $depcc],
337               [am_cv_$1_dependencies_compiler_type],
338[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
339  # We make a subdir and do the tests there.  Otherwise we can end up
340  # making bogus files that we don't know about and never remove.  For
341  # instance it was reported that on HP-UX the gcc test will end up
342  # making a dummy file named `D' -- because `-MD' means `put the output
343  # in D'.
344  mkdir conftest.dir
345  # Copy depcomp to subdir because otherwise we won't find it if we're
346  # using a relative directory.
347  cp "$am_depcomp" conftest.dir
348  cd conftest.dir
349
350  am_cv_$1_dependencies_compiler_type=none
351  if test "$am_compiler_list" = ""; then
352     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
353  fi
354  for depmode in $am_compiler_list; do
355    # We need to recreate these files for each test, as the compiler may
356    # overwrite some of them when testing with obscure command lines.
357    # This happens at least with the AIX C compiler.
358    echo '#include "conftest.h"' > conftest.c
359    echo 'int i;' > conftest.h
360    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
361
362    case $depmode in
363    nosideeffect)
364      # after this tag, mechanisms are not by side-effect, so they'll
365      # only be used when explicitly requested
366      if test "x$enable_dependency_tracking" = xyes; then
367        continue
368      else
369        break
370      fi
371      ;;
372    none) break ;;
373    esac
374    # We check with `-c' and `-o' for the sake of the "dashmstdout"
375    # mode.  It turns out that the SunPro C++ compiler does not properly
376    # handle `-M -o', and we need to detect this.
377    if depmode=$depmode \
378       source=conftest.c object=conftest.o \
379       depfile=conftest.Po tmpdepfile=conftest.TPo \
380       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
381       grep conftest.h conftest.Po > /dev/null 2>&1 &&
382       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
383      am_cv_$1_dependencies_compiler_type=$depmode
384      break
385    fi
386  done
387
388  cd ..
389  rm -rf conftest.dir
390else
391  am_cv_$1_dependencies_compiler_type=none
392fi
393])
394$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
395AC_SUBST([$1DEPMODE])
396])
397
398
399# AM_SET_DEPDIR
400# -------------
401# Choose a directory name for dependency files.
402# This macro is AC_REQUIREd in _AM_DEPENDENCIES
403AC_DEFUN([AM_SET_DEPDIR],
404[rm -f .deps 2>/dev/null
405mkdir .deps 2>/dev/null
406if test -d .deps; then
407  DEPDIR=.deps
408else
409  # MS-DOS does not allow filenames that begin with a dot.
410  DEPDIR=_deps
411fi
412rmdir .deps 2>/dev/null
413AC_SUBST(DEPDIR)
414])
415
416
417# AM_DEP_TRACK
418# ------------
419AC_DEFUN([AM_DEP_TRACK],
420[AC_ARG_ENABLE(dependency-tracking,
421[  --disable-dependency-tracking Speeds up one-time builds
422  --enable-dependency-tracking  Do not reject slow dependency extractors])
423if test "x$enable_dependency_tracking" != xno; then
424  am_depcomp="$ac_aux_dir/depcomp"
425  AMDEPBACKSLASH='\'
426fi
427AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
428pushdef([subst], defn([AC_SUBST]))
429subst(AMDEPBACKSLASH)
430popdef([subst])
431])
432
433# Generate code to set up dependency tracking.
434# This macro should only be invoked once -- use via AC_REQUIRE.
435# Usage:
436# AM_OUTPUT_DEPENDENCY_COMMANDS
437
438#
439# This code is only required when automatic dependency tracking
440# is enabled.  FIXME.  This creates each `.P' file that we will
441# need in order to bootstrap the dependency handling code.
442AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
443AC_OUTPUT_COMMANDS([
444test x"$AMDEP_TRUE" != x"" ||
445for mf in $CONFIG_FILES; do
446  case "$mf" in
447  Makefile) dirpart=.;;
448  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
449  *) continue;;
450  esac
451  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
452  # Extract the definition of DEP_FILES from the Makefile without
453  # running `make'.
454  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
455  test -z "$DEPDIR" && continue
456  # When using ansi2knr, U may be empty or an underscore; expand it
457  U=`sed -n -e '/^U = / s///p' < "$mf"`
458  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
459  # We invoke sed twice because it is the simplest approach to
460  # changing $(DEPDIR) to its actual value in the expansion.
461  for file in `sed -n -e '
462    /^DEP_FILES = .*\\\\$/ {
463      s/^DEP_FILES = //
464      :loop
465        s/\\\\$//
466        p
467        n
468        /\\\\$/ b loop
469      p
470    }
471    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
472       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
473    # Make sure the directory exists.
474    test -f "$dirpart/$file" && continue
475    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
476    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
477    # echo "creating $dirpart/$file"
478    echo '# dummy' > "$dirpart/$file"
479  done
480done
481], [AMDEP_TRUE="$AMDEP_TRUE"
482ac_aux_dir="$ac_aux_dir"])])
483
484# AM_MAKE_INCLUDE()
485# -----------------
486# Check to see how make treats includes.
487AC_DEFUN([AM_MAKE_INCLUDE],
488[am_make=${MAKE-make}
489cat > confinc << 'END'
490doit:
491        @echo done
492END
493# If we don't find an include directive, just comment out the code.
494AC_MSG_CHECKING([for style of include used by $am_make])
495am__include='#'
496am__quote=
497_am_result=none
498# First try GNU make style include.
499echo "include confinc" > confmf
500# We grep out `Entering directory' and `Leaving directory'
501# messages which can occur if `w' ends up in MAKEFLAGS.
502# In particular we don't look at `^make:' because GNU make might
503# be invoked under some other name (usually "gmake"), in which
504# case it prints its new name instead of `make'.
505if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
506   am__include=include
507   am__quote=
508   _am_result=GNU
509fi
510# Now try BSD make style include.
511if test "$am__include" = "#"; then
512   echo '.include "confinc"' > confmf
513   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
514      am__include=.include
515      am__quote='"'
516      _am_result=BSD
517   fi
518fi
519AC_SUBST(am__include)
520AC_SUBST(am__quote)
521AC_MSG_RESULT($_am_result)
522rm -f confinc confmf
523])
524
525# serial 3
526
527# AM_CONDITIONAL(NAME, SHELL-CONDITION)
528# -------------------------------------
529# Define a conditional.
530#
531# FIXME: Once using 2.50, use this:
532# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
533AC_DEFUN([AM_CONDITIONAL],
534[ifelse([$1], [TRUE],
535        [errprint(__file__:__line__: [$0: invalid condition: $1
536])dnl
537m4exit(1)])dnl
538ifelse([$1], [FALSE],
539       [errprint(__file__:__line__: [$0: invalid condition: $1
540])dnl
541m4exit(1)])dnl
542AC_SUBST([$1_TRUE])
543AC_SUBST([$1_FALSE])
544if $2; then
545  $1_TRUE=
546  $1_FALSE='#'
547else
548  $1_TRUE='#'
549  $1_FALSE=
550fi])
551
552dnl
553dnl $Id$
554dnl
555
556dnl canonicalize target cpu
557dnl NOTE: Most rtems targets do not fullfil autoconf's
558dnl target naming conventions "processor-vendor-os"
559dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
560dnl and we have to fix it for rtems ourselves
561
562AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
563[
564AC_CANONICAL_TARGET
565AC_MSG_CHECKING(rtems target cpu)
566case "${target}" in
567  # hpux unix port should go here
568  i[[34567]]86-*linux*)         # unix "simulator" port
569        RTEMS_CPU=unix
570        ;;
571  i[[34567]]86-*freebsd*)       # unix "simulator" port
572        RTEMS_CPU=unix
573        ;;
574  i[[34567]]86-pc-cygwin*)      # Cygwin is just enough unix like :)
575        RTEMS_CPU=unix
576        ;;
577  no_cpu-*rtems*)
578        RTEMS_CPU=no_cpu
579        ;;
580  sparc-sun-solaris*)           # unix "simulator" port
581        RTEMS_CPU=unix
582        ;;
583  *)
584        RTEMS_CPU=`echo $target | sed 's%^\([[^-]]*\)-\(.*\)$%\1%'`
585        ;;
586esac
587AC_SUBST(RTEMS_CPU)
588AC_MSG_RESULT($RTEMS_CPU)
589])
590
591# Add --enable-maintainer-mode option to configure.
592# From Jim Meyering
593
594# serial 1
595
596AC_DEFUN([AM_MAINTAINER_MODE],
597[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
598  dnl maintainer-mode is disabled by default
599  AC_ARG_ENABLE(maintainer-mode,
600[  --enable-maintainer-mode enable make rules and dependencies not useful
601                          (and sometimes confusing) to the casual installer],
602      USE_MAINTAINER_MODE=$enableval,
603      USE_MAINTAINER_MODE=no)
604  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
605  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
606  MAINT=$MAINTAINER_MODE_TRUE
607  AC_SUBST(MAINT)dnl
608]
609)
610
611dnl
612dnl $Id$
613dnl
614dnl Check for target gcc
615dnl
616
617AC_DEFUN(RTEMS_PROG_CC,
618[
619AC_BEFORE([$0], [AC_PROG_CPP])dnl
620AC_BEFORE([$0], [AC_PROG_CC])dnl
621AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
622AC_REQUIRE([RTEMS_ENABLE_LIBCDIR])dnl
623AC_REQUIRE([RTEMS_ENABLE_GCC28])dnl
624
625RTEMS_CHECK_TOOL(CC,gcc)
626test -z "$CC" && \
627  AC_MSG_ERROR([no acceptable cc found in \$PATH])
628AC_PROG_CC
629AC_PROG_CPP
630
631AM_CONDITIONAL(RTEMS_USE_GCC,test x"$GCC" = x"yes")
632])
633
634AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
635[
636dnl check target cc
637RTEMS_PROG_CC
638dnl check if the compiler supports --specs
639RTEMS_GCC_SPECS
640dnl check if the target compiler may use --pipe
641RTEMS_GCC_PIPE
642dnl check if the compiler supports --specs if gcc28 is requested
643if test "$RTEMS_USE_GCC272" != "yes" ; then
644  if test "$rtems_cv_gcc_specs" = "no"; then
645    AC_MSG_WARN([*** disabling --enable-gcc28])
646      RTEMS_USE_GCC272=yes
647  fi
648fi
649test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe"
650
651if test "$GCC" = yes; then
652]
653ifelse([$1],,[],[CPPFLAGS="$CPPFLAGS $1"])
654[
655CFLAGS="-g -Wall"
656fi
657AM_CONDITIONAL(RTEMS_USE_GCC272, test x"$RTEMS_USE_GCC272" = x"yes")
658AC_SUBST(RTEMS_USE_GCC272)
659
660dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
661case $build_os in
662*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
663*) ;;
664esac
665AC_SUBST(GCCSED)
666])
667
668dnl
669dnl $Id$
670dnl
671dnl Set target tools
672dnl
673
674AC_DEFUN(RTEMS_GCC_PRINT,
675[
676    $1=`$CC --print-prog-name=$2`
677])
678
679AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
680[AC_REQUIRE([RTEMS_PROG_CC])dnl
681
682dnl FIXME: What shall be done if these tools are not available?
683  RTEMS_CHECK_TOOL(AR,ar,no)
684  RTEMS_CHECK_TOOL(AS,as,no)
685  RTEMS_CHECK_TOOL(LD,ld,no)
686  RTEMS_CHECK_TOOL(NM,nm,no)
687
688dnl special treatment of ranlib
689  RTEMS_CHECK_TOOL(RANLIB,ranlib,:)
690
691dnl NOTE: These may not be available if not using gnutools
692  RTEMS_CHECK_TOOL(OBJCOPY,objcopy,no)
693  RTEMS_CHECK_TOOL(SIZE,size,no)
694  RTEMS_CHECK_TOOL(STRIP,strip,:)
695])
696
697dnl $Id$
698
699dnl RTEMS_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
700AC_DEFUN(RTEMS_CHECK_TOOL,
701[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
702AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2, $3, $4)
703])
704
705dnl $Id$
706
707AC_DEFUN(RTEMS_ENABLE_LIBCDIR,
708[
709AC_ARG_ENABLE(libcdir,
710AC_HELP_STRING([--enable-libcdir=directory],
711[set the directory for the C library]),
712[ RTEMS_LIBC_DIR="${enableval}" ; \
713test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
714AC_SUBST(RTEMS_LIBC_DIR)dnl
715])
716
717
718dnl $Id$
719
720AC_DEFUN(RTEMS_ENABLE_GCC28,
721[
722AC_ARG_ENABLE(gcc28,
723AC_HELP_STRING([--enable-gcc28],[enable use of gcc 2.8.x features]),
724[case "${enableval}" in
725  yes) RTEMS_USE_GCC272=no ;;
726  no) RTEMS_USE_GCC272=yes ;;
727  *)  AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
728esac],[RTEMS_USE_GCC272=no])
729])
730
731dnl
732dnl $Id$
733dnl
734dnl Check whether the target compiler accepts -specs
735dnl
736
737AC_DEFUN(RTEMS_GCC_SPECS,
738[AC_REQUIRE([RTEMS_PROG_CC])
739AC_CACHE_CHECK(whether $CC accepts -specs,rtems_cv_gcc_specs,
740[
741rtems_cv_gcc_specs=no
742if test x"$GCC" = x"yes"; then
743  touch confspec
744  echo 'void f(){}' >conftest.c
745  if test -z "`${CC} -specs confspec -c conftest.c 2>&1`";then
746    rtems_cv_gcc_specs=yes
747  fi
748fi
749rm -f confspec conftest*
750])])
751
752dnl
753dnl $Id$
754dnl
755dnl Check whether the target compiler accepts -pipe
756dnl
757
758AC_DEFUN(RTEMS_GCC_PIPE,
759[AC_REQUIRE([RTEMS_PROG_CC])
760AC_REQUIRE([AC_CANONICAL_HOST])
761AC_CACHE_CHECK(whether $CC accepts --pipe,rtems_cv_gcc_pipe,
762[
763rtems_cv_gcc_pipe=no
764if test x"$GCC" = x"yes"; then
765    echo 'void f(){}' >conftest.c
766    if test -z "`${CC} --pipe -c conftest.c 2>&1`";then
767      rtems_cv_gcc_pipe=yes
768    fi
769    rm -f conftest*
770fi
771])
772])
773
774dnl $Id$
775
776dnl Pass a single BSP via an environment variable
777dnl used by per BSP configure scripts
778AC_DEFUN(RTEMS_ENV_RTEMSBSP,
779[dnl
780AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl
781AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl
782AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl
783
784AC_ARG_VAR([RTEMS_BSP],[RTEMS_BSP to build])
785AC_MSG_CHECKING([for RTEMS_BSP])
786AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
787[dnl
788  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
789])dnl
790if test -z "$rtems_cv_RTEMS_BSP"; then
791  AC_MSG_ERROR([Missing RTEMS_BSP])
792fi
793RTEMS_BSP="$rtems_cv_RTEMS_BSP"
794AC_MSG_RESULT(${RTEMS_BSP})
795AC_SUBST(RTEMS_BSP)
796
797RTEMS_BSP_SPECS="-specs bsp_specs -qrtems"
798AC_SUBST(RTEMS_BSP_SPECS)
799
800GCC_SPECS="-B\$(PROJECT_ROOT)/ -B\$(PROJECT_ROOT)/$RTEMS_BSP/lib/"
801AC_SUBST(GCC_SPECS)
802
803RTEMS_ROOT=$PROJECT_ROOT/c/$RTEMS_BSP
804AC_SUBST(RTEMS_ROOT)
805
806RTEMS_ENABLE_BARE
807AC_SUBST(BARE_CPU_MODEL)
808AC_SUBST(BARE_CPU_CFLAGS)
809
810AM_CONDITIONAL(RTEMS_CONFIG_PER_BSP, true);
811
812includedir="\${exec_prefix}/\$(RTEMS_BSP)/lib/include"
813])
814
815dnl $Id$
816
817dnl Override the set of BSPs to be built.
818dnl used by the toplevel configure script
819dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
820AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
821[
822AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])dnl
823AC_ARG_ENABLE(rtemsbsp,
824AC_HELP_STRING([--enable-rtemsbsp="bsp1 bsp2 .."],
825[BSPs to include in build]),
826[case "${enableval}" in
827  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
828  *) $1=$enableval;;
829esac],[$1=""])
830])
831
832dnl
833dnl $Id$
834dnl
835
836dnl
837dnl PROJECT_TOPdir     .. relative path to the top of the build-tree
838dnl PROJECT_ROOT       .. relative path to the top of the temporary
839dnl                       installation directory inside the build-tree
840dnl RTEMS_TOPdir       .. relative path of a subpackage's configure.in to the
841dnl                       toplevel configure.in of the source-tree
842dnl RTEMS_ROOT         .. path to the top of a bsp's build directory
843dnl                       [Applied by custom/*.cfg, depredicated otherwise]
844dnl
845
846AC_DEFUN(RTEMS_PROJECT_ROOT,
847[dnl
848AC_REQUIRE([RTEMS_TOP])
849
850PACKHEX="\$(PROJECT_TOPdir)/tools/build/packhex"
851AC_SUBST(PACKHEX)
852
853PROJECT_INCLUDE="\$(PROJECT_ROOT)/$RTEMS_BSP/lib/include"
854AC_SUBST(PROJECT_INCLUDE)
855
856PROJECT_RELEASE="\$(PROJECT_ROOT)/$RTEMS_BSP"
857AC_SUBST(PROJECT_RELEASE)
858])
859
860
861dnl $Id$
862
863dnl Report all available bsps for a target,
864dnl check if a bsp-subdirectory is present for all bsps found
865dnl
866dnl RTEMS_CHECK_BSPS(bsp_list)
867AC_DEFUN(RTEMS_CHECK_BSPS,
868[
869AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
870AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
871AC_MSG_CHECKING([for bsps])
872    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
873    for file in $files; do
874      case $file in
875        ChangeLog*);;
876        shared*);;
877        Makefile*);;
878        READ*);;
879        CVS*);;
880        pxfl*);;
881        ac*);;
882        config*);;
883        # Now account for BSPs with build variants
884        c4xsim)            rtems_bsp="$rtems_bsp c4xsim c3xsim";;
885        gen68360)          rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
886        p4000)             rtems_bsp="$rtems_bsp p4600 p4650";;
887        mvme162)           rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
888        mbx8xx)            rtems_bsp="$rtems_bsp mbx821_001 mbx860_002";;
889        motorola_powerpc)  rtems_bsp="$rtems_bsp mvme2307 mcp750";;
890        pc386)             rtems_bsp="$rtems_bsp pc386 pc386dx pc486 pc586 pc686 pck6";;
891        erc32)             rtems_bsp="$rtems_bsp erc32 erc32nfp";;
892        leon)              rtems_bsp="$rtems_bsp leon1 leon2";;
893        sim68000)          rtems_bsp="$rtems_bsp sim68000 simcpu32";;
894        shsim)             rtems_bsp="$rtems_bsp simsh7032 simsh7045";;
895        *) if test -d $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/$file; then
896             $1="[$]$1 $file"
897           fi;;
898      esac;
899    done
900AC_MSG_RESULT([[$]$1 .. done])
901])dnl
902
903AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
904[dnl
905AC_REQUIRE([RTEMS_TOP])
906
907AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
908if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
909  AC_MSG_RESULT([yes])
910else
911  AC_MSG_ERROR([no])
912fi
913])dnl
914
915dnl $Id$
916
917dnl check if RTEMS support a cpu
918AC_DEFUN(RTEMS_CHECK_CPU,
919[dnl
920AC_REQUIRE([RTEMS_TOP])
921AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
922
923# Is this a supported CPU?
924AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
925if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
926  AC_MSG_RESULT(yes)
927else
928  AC_MSG_ERROR(no)
929fi
930])dnl
931
932
933AC_DEFUN(RTEMS_ENABLE_BARE,
934[
935AC_ARG_ENABLE(bare-cpu-cflags,
936AC_HELP_STRING([--enable-bare-cpu-cflags],[specify a particular cpu cflag (bare bsp specific)]),
937[case "${enableval}" in
938  no) BARE_CPU_CFLAGS="" ;;
939  *)    BARE_CPU_CFLAGS="${enableval}" ;;
940esac],
941[BARE_CPU_CFLAGS=""])
942
943AC_ARG_ENABLE(bare-cpu-model,
944AC_HELP_STRING([--enable-bare-cpu-model],[specify a particular cpu model (bare bsp specific)]),
945[case "${enableval}" in
946  no)   BARE_CPU_MODEL="" ;;
947  *)    BARE_CPU_MODEL="${enableval}" ;;
948esac],
949[BARE_CPU_MODEL=""])
950])
951
952
953dnl $Id$
954
955dnl RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
956AC_DEFUN(RTEMS_CHECK_BSP_CACHE,
957[
958AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
959AC_REQUIRE([RTEMS_ENV_RTEMSBSP])dnl set RTEMS_BSP
960AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
961AC_CACHE_CHECK([for RTEMS_CPU_MODEL], rtems_cv_RTEMS_CPU_MODEL,
962. $RTEMS_TOPdir/c/[$]$1/make/[$]$1.cache)
963RTEMS_CPU_MODEL=$rtems_cv_RTEMS_CPU_MODEL
964AC_SUBST(RTEMS_CPU_MODEL)
965AC_CACHE_CHECK([for RTEMS_BSP_FAMILY], rtems_cv_RTEMS_BSP_FAMILY,
966. $RTEMS_TOPdir/c/[$]$1/make/[$]$1.cache)
967RTEMS_BSP_FAMILY=$rtems_cv_RTEMS_BSP_FAMILY
968AC_SUBST(RTEMS_BSP_FAMILY)
969])dnl
970
971dnl $Id$
972
973AC_DEFUN(RTEMS_CANONICAL_HOST,
974[dnl
975AC_REQUIRE([AC_CANONICAL_HOST])
976RTEMS_HOST=$host_os
977case "${target}" in
978  # hpux unix port should go here
979  i[[34567]]86-*linux*)          # unix "simulator" port
980        RTEMS_HOST=Linux
981        ;;
982  i[[34567]]86-*freebsd*)         # unix "simulator" port
983        RTEMS_HOST=FreeBSD
984        ;;
985  i[[34567]]86-pc-cygwin*)      # Cygwin is just enough unix like :)
986        RTEMS_HOST=Cygwin
987        ;;
988  sparc-sun-solaris*)           # unix "simulator" port
989        RTEMS_HOST=Solaris
990        ;;
991  *)
992        ;;
993esac
994AC_SUBST(RTEMS_HOST)
995])dnl
996
997# Like AC_CONFIG_HEADER, but automatically create stamp file.
998
999# serial 3
1000
1001# When config.status generates a header, we must update the stamp-h file.
1002# This file resides in the same directory as the config header
1003# that is generated.  We must strip everything past the first ":",
1004# and everything past the last "/".
1005
1006AC_PREREQ([2.12])
1007
1008AC_DEFUN([AM_CONFIG_HEADER],
1009[ifdef([AC_FOREACH],dnl
1010         [dnl init our file count if it isn't already
1011         m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
1012         dnl prepare to store our destination file list for use in config.status
1013         AC_FOREACH([_AM_File], [$1],
1014                    [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
1015                    m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
1016                    dnl and add it to the list of files AC keeps track of, along
1017                    dnl with our hook
1018                    AC_CONFIG_HEADERS(_AM_File,
1019dnl COMMANDS, [, INIT-CMDS]
1020[# update the timestamp
1021echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
1022][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
1023                    m4_popdef([_AM_Dest])])],dnl
1024[AC_CONFIG_HEADER([$1])
1025  AC_OUTPUT_COMMANDS(
1026   ifelse(patsubst([$1], [[^ ]], []),
1027          [],
1028          [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
1029           patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
1030[am_indx=1
1031for am_file in $1; do
1032  case " \$CONFIG_HEADERS " in
1033  *" \$am_file "*)
1034    am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
1035    if test -n "\$am_dir"; then
1036      am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
1037      for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
1038        am_tmpdir=\$am_tmpdir\$am_subdir/
1039        if test ! -d \$am_tmpdir; then
1040          mkdir \$am_tmpdir
1041        fi
1042      done
1043    fi
1044    echo timestamp > "\$am_dir"stamp-h\$am_indx
1045    ;;
1046  esac
1047  am_indx=\`expr \$am_indx + 1\`
1048done])
1049])]) # AM_CONFIG_HEADER
1050
1051# _AM_DIRNAME(PATH)
1052# -----------------
1053# Like AS_DIRNAME, only do it during macro expansion
1054AC_DEFUN([_AM_DIRNAME],
1055       [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
1056              m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
1057                    m4_if(m4_regexp([$1], [^/.*]), -1,
1058                          [.],
1059                          m4_patsubst([$1], [^\(/\).*], [\1])),
1060                    m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
1061              m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
1062]) # _AM_DIRNAME
1063
Note: See TracBrowser for help on using the repository browser.