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