source: rtems/c/src/aclocal.m4 @ 3cad2919

4.104.114.84.95
Last change on this file since 3cad2919 was e1d8abb, checked in by Joel Sherrill <joel.sherrill@…>, on 09/07/99 at 13:45:03

Applied patch rtems-rc-19990820-6.diff.gz from
Ralf Corsepius <corsepiu@…> which converted many
Makefile.in's to Makefile.am's. This added a lot of files.

  • Property mode set to 100644
File size: 9.6 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl $Id$
14
15dnl
16dnl RTEMS_TOP($1)
17dnl
18dnl $1 .. relative path from this configure.in to the toplevel configure.in
19dnl
20AC_DEFUN(RTEMS_TOP,
21[dnl
22AC_ARG_WITH(target-subdir,
23[  --with-target-subdir=DIR],
24TARGET_SUBDIR="$withval",
25TARGET_SUBDIR=".")
26
27RTEMS_TOPdir="$1";
28AC_SUBST(RTEMS_TOPdir)
29
30dnl Determine RTEMS Version string from the VERSION file
31dnl Hopefully, Joel never changes its format ;-
32AC_MSG_CHECKING([for RTEMS Version])
33if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
34changequote(,)dnl
35RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \
36sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
37changequote([,])dnl
38else
39AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
40fi
41if test -z "$RTEMS_VERSION"; then
42AC_MSG_ERROR(Unable to determine version)
43fi
44AC_MSG_RESULT($RTEMS_VERSION)
45])dnl
46
47dnl $Id$
48
49AC_DEFUN(RTEMS_ENABLE_CXX,
50[
51AC_ARG_ENABLE(cxx,
52[  --enable-cxx                         enable C++ support,]
53[                                       and build the rtems++ library],
54[case "${enableval}" in
55  yes) RTEMS_HAS_CPLUSPLUS=yes ;;
56  no) RTEMS_HAS_CPLUSPLUS=no   ;;
57  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
58esac], [RTEMS_HAS_CPLUSPLUS=no])
59])
60
61dnl
62dnl $Id$
63dnl
64
65dnl canonicalize target cpu
66dnl NOTE: Most rtems targets do not fullfil autoconf's
67dnl target naming conventions "processor-vendor-os"
68dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
69dnl and we have to fix it for rtems ourselves
70
71AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
72[
73AC_CANONICAL_SYSTEM
74AC_MSG_CHECKING(rtems target cpu)
75changequote(,)dnl
76case "${target}" in
77  # hpux unix port should go here
78  i[3456]86-go32-rtems*)
79        RTEMS_CPU=i386
80        ;;
81  i[3456]86-pc-linux*)          # unix "simulator" port
82        RTEMS_CPU=unix
83        ;;
84  i[3456]86-*freebsd2*)         # unix "simulator" port
85        RTEMS_CPU=unix
86        ;;
87  no_cpu-*rtems*)
88        RTEMS_CPU=no_cpu
89        ;;
90  sparc-sun-solaris*)           # unix "simulator" port
91        RTEMS_CPU=unix
92        ;;
93  *)
94        RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
95        ;;
96esac
97changequote([,])dnl
98AC_SUBST(RTEMS_CPU)
99AC_MSG_RESULT($RTEMS_CPU)
100])
101
102# Do all the work for Automake.  This macro actually does too much --
103# some checks are only needed if your package does certain things.
104# But this isn't really a big deal.
105
106# serial 1
107
108dnl Usage:
109dnl AM_INIT_AUTOMAKE(package,version, [no-define])
110
111AC_DEFUN(AM_INIT_AUTOMAKE,
112[AC_REQUIRE([AC_PROG_INSTALL])
113PACKAGE=[$1]
114AC_SUBST(PACKAGE)
115VERSION=[$2]
116AC_SUBST(VERSION)
117dnl test to see if srcdir already configured
118if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
119  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
120fi
121ifelse([$3],,
122AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
123AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
124AC_REQUIRE([AM_SANITY_CHECK])
125AC_REQUIRE([AC_ARG_PROGRAM])
126dnl FIXME This is truly gross.
127missing_dir=`cd $ac_aux_dir && pwd`
128AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
129AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
130AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
131AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
132AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
133AC_REQUIRE([AC_PROG_MAKE_SET])])
134
135#
136# Check to make sure that the build environment is sane.
137#
138
139AC_DEFUN(AM_SANITY_CHECK,
140[AC_MSG_CHECKING([whether build environment is sane])
141# Just in case
142sleep 1
143echo timestamp > conftestfile
144# Do `set' in a subshell so we don't clobber the current shell's
145# arguments.  Must try -L first in case configure is actually a
146# symlink; some systems play weird games with the mod time of symlinks
147# (eg FreeBSD returns the mod time of the symlink's containing
148# directory).
149if (
150   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
151   if test "[$]*" = "X"; then
152      # -L didn't work.
153      set X `ls -t $srcdir/configure conftestfile`
154   fi
155   if test "[$]*" != "X $srcdir/configure conftestfile" \
156      && test "[$]*" != "X conftestfile $srcdir/configure"; then
157
158      # If neither matched, then we have a broken ls.  This can happen
159      # if, for instance, CONFIG_SHELL is bash and it inherits a
160      # broken ls alias from the environment.  This has actually
161      # happened.  Such a system could not be considered "sane".
162      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
163alias in your environment])
164   fi
165
166   test "[$]2" = conftestfile
167   )
168then
169   # Ok.
170   :
171else
172   AC_MSG_ERROR([newly created file is older than distributed files!
173Check your system clock])
174fi
175rm -f conftest*
176AC_MSG_RESULT(yes)])
177
178dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
179dnl The program must properly implement --version.
180AC_DEFUN(AM_MISSING_PROG,
181[AC_MSG_CHECKING(for working $2)
182# Run test in a subshell; some versions of sh will print an error if
183# an executable is not found, even if stderr is redirected.
184# Redirect stdin to placate older versions of autoconf.  Sigh.
185if ($2 --version) < /dev/null > /dev/null 2>&1; then
186   $1=$2
187   AC_MSG_RESULT(found)
188else
189   $1="$3/missing $2"
190   AC_MSG_RESULT(missing)
191fi
192AC_SUBST($1)])
193
194# Add --enable-maintainer-mode option to configure.
195# From Jim Meyering
196
197# serial 1
198
199AC_DEFUN(AM_MAINTAINER_MODE,
200[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
201  dnl maintainer-mode is disabled by default
202  AC_ARG_ENABLE(maintainer-mode,
203[  --enable-maintainer-mode enable make rules and dependencies not useful
204                          (and sometimes confusing) to the casual installer],
205      USE_MAINTAINER_MODE=$enableval,
206      USE_MAINTAINER_MODE=no)
207  AC_MSG_RESULT($USE_MAINTAINER_MODE)
208  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
209  MAINT=$MAINTAINER_MODE_TRUE
210  AC_SUBST(MAINT)dnl
211]
212)
213
214# Define a conditional.
215
216AC_DEFUN(AM_CONDITIONAL,
217[AC_SUBST($1_TRUE)
218AC_SUBST($1_FALSE)
219if $2; then
220  $1_TRUE=
221  $1_FALSE='#'
222else
223  $1_TRUE='#'
224  $1_FALSE=
225fi])
226
227dnl $Id$
228
229dnl Override the set of BSPs to be built.
230dnl used by the toplevel configure script
231dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
232AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
233[
234AC_ARG_ENABLE(rtemsbsp,
235[  --enable-rtemsbsp=bsp1 bsp2 ..      BSPs to include in build],
236[case "${enableval}" in
237  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
238  *) $1=$enableval;;
239esac],[$1=""])
240])
241
242dnl Pass a single BSP via an environment variable
243dnl used by per BSP configure scripts
244AC_DEFUN(RTEMS_ENV_RTEMSBSP,
245[dnl
246AC_MSG_CHECKING([for RTEMS_BSP])
247AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
248[dnl
249  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
250])dnl
251if test -z "$rtems_cv_RTEMS_BSP"; then
252  AC_MSG_ERROR([Missing RTEMS_BSP])
253fi
254RTEMS_BSP="$rtems_cv_RTEMS_BSP"
255AC_MSG_RESULT(${RTEMS_BSP})
256AC_SUBST(RTEMS_BSP)
257])
258
259dnl $Id$
260
261dnl check if RTEMS support a cpu
262AC_DEFUN(RTEMS_CHECK_CPU,
263[dnl
264AC_REQUIRE([RTEMS_TOP])
265AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
266# Is this a supported CPU?
267AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
268if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
269  AC_MSG_RESULT(yes)
270else
271  AC_MSG_ERROR(no)
272fi
273])dnl
274
275
276dnl $Id$
277
278AC_DEFUN(RTEMS_CANONICAL_HOST,
279[dnl
280AC_REQUIRE([AC_CANONICAL_HOST])
281RTEMS_HOST=$host_os
282changequote(,)dnl
283case "${target}" in
284  # hpux unix port should go here
285  i[3456]86-pc-linux*)         # unix "simulator" port
286        RTEMS_HOST=Linux
287        ;;
288  i[3456]86-*freebsd2*) # unix "simulator" port
289        RTEMS_HOST=FreeBSD
290        ;;
291  sparc-sun-solaris*)             # unix "simulator" port
292        RTEMS_HOST=Solaris
293        ;;
294  *)
295        ;;
296esac
297changequote([,])dnl
298AC_SUBST(RTEMS_HOST)
299])dnl
300
301dnl
302dnl $Id$
303dnl
304
305AC_DEFUN(RTEMS_PROJECT_ROOT,
306[dnl
307AC_REQUIRE([RTEMS_TOP])
308if test "$TARGET_SUBDIR" = "." ; then
309PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
310else
311PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
312fi
313AC_SUBST(PROJECT_ROOT)
314
315RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
316AC_SUBST(RTEMS_ROOT)
317
318INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
319AC_SUBST(INSTALL_CHANGE)
320
321PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
322AC_SUBST(PACKHEX)
323])
324
325
326dnl $Id$
327
328dnl Report all available bsps for a target,
329dnl check if a bsp-subdirectory is present for all bsps found
330dnl
331dnl RTEMS_CHECK_BSPS(bsp_list)
332AC_DEFUN(RTEMS_CHECK_BSPS,
333[
334AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
335AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
336AC_MSG_CHECKING([for bsps])
337case "${target}" in
338changequote(,)dnl
339  i[3456]86-go32-rtems*)
340changequote([,])dnl
341    $1="go32 go32_p5"
342    ;;
343  *)
344    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
345    for file in $files; do
346      case $file in
347        shared*);;
348        Makefile*);;
349        READ*);;
350        CVS*);;
351        pxfl*);;
352        go32*);;       # so the i386 port can pick up the other Makefiles
353        # Now account for BSPs with build variants
354        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
355        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
356        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
357        *) $1="[$]$1 $file";;
358      esac;
359    done
360    ;;
361esac
362AC_MSG_RESULT([[$]$1 .. done])
363])dnl
364
365AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
366[dnl
367AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
368if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
369  AC_MSG_RESULT([yes])
370else
371  AC_MSG_ERROR([no])
372fi
373])dnl
374
Note: See TracBrowser for help on using the repository browser.