source: rtems/c/aclocal.m4 @ b62a92c

4.104.114.84.95
Last change on this file since b62a92c was 473b4e5, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 4, 1999 at 1:30:15 PM

Regenerated.

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