source: rtems/c/src/lib/libbsp/powerpc/mpc8260ads/aclocal.m4 @ 5edbffe

4.104.114.84.95
Last change on this file since 5edbffe was 5edbffe, checked in by Joel Sherrill <joel.sherrill@…>, on 10/22/01 at 14:46:02

01-10-22 Andy Dachs <a.dachs@…>

  • mpc8260ads added as new BSP. tm27 reported not to run at this time.
  • ChangeLog?, Makefile.am, README, aclocal.m4, bsp_specs, clock/.cvsignore, clock/Makefile.am, clock/p_clock.c, configure.in, console/Makefile.am, console/console.c, include/Makefile.am, include/bsp.h, include/coverhd.h, irq/.cvsignore, irq/Makefile.am, irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c, network/Makefile.am, network/README, network/if_hdlcsubr.c, network/if_hdlcsubr.h, network/network.c, start/Makefile.am, start/start.S, startup/Makefile.am, startup/bspstart.c, startup/cpuinit.c, startup/linkcmds, startup/setvec.c, times, vectors/.cvsignore, vectors/Makefile.am, vectors/vectors.S, vectors/vectors.h, vectors/vectors_init.c, wrapup/Makefile.am: New files.
  • Property mode set to 100644
File size: 29.5 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
776AC_DEFUN(RTEMS_ENABLE_NETWORKING,
777[
778
779AC_ARG_ENABLE(networking,
780AC_HELP_STRING([--enable-networking],[enable TCP/IP stack]),
781[case "${enableval}" in
782  yes) RTEMS_HAS_NETWORKING=yes ;;
783  no) RTEMS_HAS_NETWORKING=no ;;
784  *)  AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;;
785esac],[RTEMS_HAS_NETWORKING=yes])
786AC_SUBST(RTEMS_HAS_NETWORKING)dnl
787])
788
789dnl $Id$
790
791dnl Pass a single BSP via an environment variable
792dnl used by per BSP configure scripts
793AC_DEFUN(RTEMS_ENV_RTEMSBSP,
794[dnl
795AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl
796AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl
797AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl
798
799AC_ARG_VAR([RTEMS_BSP],[RTEMS_BSP to build])
800AC_MSG_CHECKING([for RTEMS_BSP])
801AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
802[dnl
803  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
804])dnl
805if test -z "$rtems_cv_RTEMS_BSP"; then
806  AC_MSG_ERROR([Missing RTEMS_BSP])
807fi
808RTEMS_BSP="$rtems_cv_RTEMS_BSP"
809AC_MSG_RESULT(${RTEMS_BSP})
810AC_SUBST(RTEMS_BSP)
811
812RTEMS_BSP_SPECS="-specs bsp_specs -qrtems"
813AC_SUBST(RTEMS_BSP_SPECS)
814
815GCC_SPECS="-B\$(PROJECT_ROOT)/ -B\$(PROJECT_ROOT)/$RTEMS_BSP/lib/"
816AC_SUBST(GCC_SPECS)
817
818RTEMS_ROOT=$PROJECT_ROOT/c/$RTEMS_BSP
819AC_SUBST(RTEMS_ROOT)
820
821RTEMS_ENABLE_BARE
822AC_SUBST(BARE_CPU_MODEL)
823AC_SUBST(BARE_CPU_CFLAGS)
824
825AM_CONDITIONAL(RTEMS_CONFIG_PER_BSP, true);
826
827includedir="\${exec_prefix}/\$(RTEMS_BSP)/lib/include"
828])
829
830dnl $Id$
831
832dnl Override the set of BSPs to be built.
833dnl used by the toplevel configure script
834dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
835AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
836[
837AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])dnl
838AC_ARG_ENABLE(rtemsbsp,
839AC_HELP_STRING([--enable-rtemsbsp="bsp1 bsp2 .."],
840[BSPs to include in build]),
841[case "${enableval}" in
842  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
843  *) $1=$enableval;;
844esac],[$1=""])
845])
846
847dnl
848dnl $Id$
849dnl
850
851dnl
852dnl PROJECT_TOPdir     .. relative path to the top of the build-tree
853dnl PROJECT_ROOT       .. relative path to the top of the temporary
854dnl                       installation directory inside the build-tree
855dnl RTEMS_TOPdir       .. relative path of a subpackage's configure.in to the
856dnl                       toplevel configure.in of the source-tree
857dnl RTEMS_ROOT         .. path to the top of a bsp's build directory
858dnl                       [Applied by custom/*.cfg, depredicated otherwise]
859dnl
860
861AC_DEFUN(RTEMS_PROJECT_ROOT,
862[dnl
863AC_REQUIRE([RTEMS_TOP])
864
865PACKHEX="\$(PROJECT_TOPdir)/tools/build/packhex"
866AC_SUBST(PACKHEX)
867
868PROJECT_INCLUDE="\$(PROJECT_ROOT)/$RTEMS_BSP/lib/include"
869AC_SUBST(PROJECT_INCLUDE)
870
871PROJECT_RELEASE="\$(PROJECT_ROOT)/$RTEMS_BSP"
872AC_SUBST(PROJECT_RELEASE)
873])
874
875
876dnl $Id$
877
878dnl Report all available bsps for a target,
879dnl check if a bsp-subdirectory is present for all bsps found
880dnl
881dnl RTEMS_CHECK_BSPS(bsp_list)
882AC_DEFUN(RTEMS_CHECK_BSPS,
883[
884AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
885AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
886AC_MSG_CHECKING([for bsps])
887    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
888    for file in $files; do
889      case $file in
890        ChangeLog*);;
891        shared*);;
892        Makefile*);;
893        READ*);;
894        CVS*);;
895        pxfl*);;
896        ac*);;
897        config*);;
898        # Now account for BSPs with build variants
899        c4xsim)            rtems_bsp="$rtems_bsp c4xsim c3xsim";;
900        gen68360)          rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
901        p4000)             rtems_bsp="$rtems_bsp p4600 p4650";;
902        mvme162)           rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
903        mbx8xx)            rtems_bsp="$rtems_bsp mbx821_001 mbx860_002";;
904        motorola_powerpc)  rtems_bsp="$rtems_bsp mvme2307 mcp750";;
905        pc386)             rtems_bsp="$rtems_bsp pc386 pc386dx pc486 pc586 pc686 pck6";;
906        erc32)             rtems_bsp="$rtems_bsp erc32 erc32nfp";;
907        leon)              rtems_bsp="$rtems_bsp leon1 leon2";;
908        sim68000)          rtems_bsp="$rtems_bsp sim68000 simcpu32";;
909        shsim)             rtems_bsp="$rtems_bsp simsh7032 simsh7045";;
910        *) if test -d $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/$file; then
911             $1="[$]$1 $file"
912           fi;;
913      esac;
914    done
915AC_MSG_RESULT([[$]$1 .. done])
916])dnl
917
918AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
919[dnl
920AC_REQUIRE([RTEMS_TOP])
921
922AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
923if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
924  AC_MSG_RESULT([yes])
925else
926  AC_MSG_ERROR([no])
927fi
928])dnl
929
930dnl $Id$
931
932dnl check if RTEMS support a cpu
933AC_DEFUN(RTEMS_CHECK_CPU,
934[dnl
935AC_REQUIRE([RTEMS_TOP])
936AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
937
938# Is this a supported CPU?
939AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
940if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
941  AC_MSG_RESULT(yes)
942else
943  AC_MSG_ERROR(no)
944fi
945])dnl
946
947
948AC_DEFUN(RTEMS_ENABLE_BARE,
949[
950AC_ARG_ENABLE(bare-cpu-cflags,
951AC_HELP_STRING([--enable-bare-cpu-cflags],[specify a particular cpu cflag (bare bsp specific)]),
952[case "${enableval}" in
953  no) BARE_CPU_CFLAGS="" ;;
954  *)    BARE_CPU_CFLAGS="${enableval}" ;;
955esac],
956[BARE_CPU_CFLAGS=""])
957
958AC_ARG_ENABLE(bare-cpu-model,
959AC_HELP_STRING([--enable-bare-cpu-model],[specify a particular cpu model (bare bsp specific)]),
960[case "${enableval}" in
961  no)   BARE_CPU_MODEL="" ;;
962  *)    BARE_CPU_MODEL="${enableval}" ;;
963esac],
964[BARE_CPU_MODEL=""])
965])
966
967
968dnl $Id$
969
970dnl RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
971AC_DEFUN(RTEMS_CHECK_BSP_CACHE,
972[
973AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
974AC_REQUIRE([RTEMS_ENV_RTEMSBSP])dnl set RTEMS_BSP
975AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
976AC_CACHE_CHECK([for RTEMS_CPU_MODEL], rtems_cv_RTEMS_CPU_MODEL,
977. $RTEMS_TOPdir/c/[$]$1/make/[$]$1.cache)
978RTEMS_CPU_MODEL=$rtems_cv_RTEMS_CPU_MODEL
979AC_SUBST(RTEMS_CPU_MODEL)
980AC_CACHE_CHECK([for RTEMS_BSP_FAMILY], rtems_cv_RTEMS_BSP_FAMILY,
981. $RTEMS_TOPdir/c/[$]$1/make/[$]$1.cache)
982RTEMS_BSP_FAMILY=$rtems_cv_RTEMS_BSP_FAMILY
983AC_SUBST(RTEMS_BSP_FAMILY)
984])dnl
985
986dnl $Id$
987dnl
988AC_DEFUN(RTEMS_CHECK_NETWORKING,
989[dnl
990AC_REQUIRE([RTEMS_CHECK_CPU])dnl
991AC_REQUIRE([RTEMS_ENABLE_NETWORKING])dnl
992
993AC_CACHE_CHECK([whether BSP supports networking],
994  rtems_cv_HAS_NETWORKING,
995  [dnl
996    case "$RTEMS_CPU" in
997    unix*)
998      rtems_cv_HAS_NETWORKING="no"
999      ;;
1000    *)
1001      if test "${RTEMS_HAS_NETWORKING}" = "yes"; then
1002        rtems_cv_HAS_NETWORKING="yes";
1003      else
1004        rtems_cv_HAS_NETWORKING="disabled";
1005      fi
1006      ;;
1007    esac])
1008if test "$rtems_cv_HAS_NETWORKING" = "yes"; then
1009  HAS_NETWORKING="yes";
1010else
1011  HAS_NETWORKING="no";
1012fi
1013AC_SUBST(HAS_NETWORKING)dnl
1014])
1015
1016dnl $Id$
1017
1018AC_DEFUN(RTEMS_CANONICAL_HOST,
1019[dnl
1020AC_REQUIRE([AC_CANONICAL_HOST])
1021RTEMS_HOST=$host_os
1022case "${target}" in
1023  # hpux unix port should go here
1024  i[[34567]]86-*linux*)          # unix "simulator" port
1025        RTEMS_HOST=Linux
1026        ;;
1027  i[[34567]]86-*freebsd*)         # unix "simulator" port
1028        RTEMS_HOST=FreeBSD
1029        ;;
1030  i[[34567]]86-pc-cygwin*)      # Cygwin is just enough unix like :)
1031        RTEMS_HOST=Cygwin
1032        ;;
1033  sparc-sun-solaris*)           # unix "simulator" port
1034        RTEMS_HOST=Solaris
1035        ;;
1036  *)
1037        ;;
1038esac
1039AC_SUBST(RTEMS_HOST)
1040])dnl
1041
Note: See TracBrowser for help on using the repository browser.