1 | dnl aclocal.m4 generated automatically by aclocal 1.4a |
---|
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 | # Add --enable-maintainer-mode option to configure. |
---|
89 | # From Jim Meyering |
---|
90 | |
---|
91 | # serial 1 |
---|
92 | |
---|
93 | AC_DEFUN(AM_MAINTAINER_MODE, |
---|
94 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
95 | dnl maintainer-mode is disabled by default |
---|
96 | AC_ARG_ENABLE(maintainer-mode, |
---|
97 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
98 | (and sometimes confusing) to the casual installer], |
---|
99 | USE_MAINTAINER_MODE=$enableval, |
---|
100 | USE_MAINTAINER_MODE=no) |
---|
101 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
102 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
103 | MAINT=$MAINTAINER_MODE_TRUE |
---|
104 | AC_SUBST(MAINT)dnl |
---|
105 | ] |
---|
106 | ) |
---|
107 | |
---|
108 | # Define a conditional. |
---|
109 | |
---|
110 | AC_DEFUN(AM_CONDITIONAL, |
---|
111 | [AC_SUBST($1_TRUE) |
---|
112 | AC_SUBST($1_FALSE) |
---|
113 | if $2; then |
---|
114 | $1_TRUE= |
---|
115 | $1_FALSE='#' |
---|
116 | else |
---|
117 | $1_TRUE='#' |
---|
118 | $1_FALSE= |
---|
119 | fi]) |
---|
120 | |
---|
121 | dnl $Id$ |
---|
122 | |
---|
123 | AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING, |
---|
124 | [ |
---|
125 | AC_ARG_ENABLE(multiprocessing, |
---|
126 | [ --enable-multiprocessing enable multiprocessing interface], |
---|
127 | [case "${enableval}" in |
---|
128 | yes) RTEMS_HAS_MULTIPROCESSING=yes ;; |
---|
129 | no) RTEMS_HAS_MULTIPROCESSING=no ;; |
---|
130 | *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;; |
---|
131 | esac],[RTEMS_HAS_MULTIPROCESSING=no]) |
---|
132 | AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl |
---|
133 | ]) |
---|
134 | |
---|
135 | dnl $Id$ |
---|
136 | |
---|
137 | AC_DEFUN(RTEMS_ENABLE_NETWORKING, |
---|
138 | [ |
---|
139 | AC_ARG_ENABLE(networking, |
---|
140 | [ --enable-networking enable TCP/IP stack], |
---|
141 | [case "${enableval}" in |
---|
142 | yes) RTEMS_HAS_NETWORKING=yes ;; |
---|
143 | no) RTEMS_HAS_NETWORKING=no ;; |
---|
144 | *) AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;; |
---|
145 | esac],[RTEMS_HAS_NETWORKING=yes]) |
---|
146 | AC_SUBST(RTEMS_HAS_NETWORKING)dnl |
---|
147 | ]) |
---|
148 | |
---|
149 | dnl $Id$ |
---|
150 | |
---|
151 | AC_DEFUN(RTEMS_ENABLE_LIBCDIR, |
---|
152 | [ |
---|
153 | AC_ARG_ENABLE(libcdir, |
---|
154 | [ --enable-libcdir=directory set the directory for the C library], |
---|
155 | [ RTEMS_LIBC_DIR="${enableval}" ; \ |
---|
156 | test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] ) |
---|
157 | AC_SUBST(RTEMS_LIBC_DIR)dnl |
---|
158 | ]) |
---|
159 | |
---|
160 | AC_DEFUN(RTEMS_ENABLE_BARE, |
---|
161 | [ |
---|
162 | AC_ARG_ENABLE(bare-cpu-cflags, |
---|
163 | [ --enable-bare-cpu-cflags specify a particular cpu cflag] |
---|
164 | [ (bare bsp specific)], |
---|
165 | [case "${enableval}" in |
---|
166 | no) BARE_CPU_CFLAGS="" ;; |
---|
167 | *) BARE_CPU_CFLAGS="${enableval}" ;; |
---|
168 | esac], |
---|
169 | [BARE_CPU_CFLAGS=""]) |
---|
170 | |
---|
171 | AC_ARG_ENABLE(bare-cpu-model, |
---|
172 | [ --enable-bare-cpu-model specify a particular cpu model] |
---|
173 | [ (bare bsp specific)], |
---|
174 | [case "${enableval}" in |
---|
175 | no) BARE_CPU_MODEL="" ;; |
---|
176 | *) BARE_CPU_MODEL="${enableval}" ;; |
---|
177 | esac], |
---|
178 | [BARE_CPU_MODEL=""]) |
---|
179 | ]) |
---|
180 | |
---|
181 | |
---|
182 | dnl $Id$ |
---|
183 | |
---|
184 | dnl Override the set of BSPs to be built. |
---|
185 | dnl used by the toplevel configure script |
---|
186 | dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list) |
---|
187 | AC_DEFUN(RTEMS_ENABLE_RTEMSBSP, |
---|
188 | [ |
---|
189 | AC_ARG_ENABLE(rtemsbsp, |
---|
190 | [ --enable-rtemsbsp=bsp1 bsp2 .. BSPs to include in build], |
---|
191 | [case "${enableval}" in |
---|
192 | yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);; |
---|
193 | *) $1=$enableval;; |
---|
194 | esac],[$1=""]) |
---|
195 | ]) |
---|
196 | |
---|
197 | dnl Pass a single BSP via an environment variable |
---|
198 | dnl used by per BSP configure scripts |
---|
199 | AC_DEFUN(RTEMS_ENV_RTEMSBSP, |
---|
200 | [dnl |
---|
201 | AC_MSG_CHECKING([for RTEMS_BSP]) |
---|
202 | AC_CACHE_VAL(rtems_cv_RTEMS_BSP, |
---|
203 | [dnl |
---|
204 | test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; |
---|
205 | ])dnl |
---|
206 | if test -z "$rtems_cv_RTEMS_BSP"; then |
---|
207 | AC_MSG_ERROR([Missing RTEMS_BSP]) |
---|
208 | fi |
---|
209 | RTEMS_BSP="$rtems_cv_RTEMS_BSP" |
---|
210 | AC_MSG_RESULT(${RTEMS_BSP}) |
---|
211 | AC_SUBST(RTEMS_BSP) |
---|
212 | ]) |
---|
213 | |
---|
214 | dnl $Id$ |
---|
215 | |
---|
216 | dnl check if RTEMS support a cpu |
---|
217 | AC_DEFUN(RTEMS_CHECK_CPU, |
---|
218 | [dnl |
---|
219 | AC_REQUIRE([RTEMS_TOP]) |
---|
220 | AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU]) |
---|
221 | # Is this a supported CPU? |
---|
222 | AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) |
---|
223 | if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then |
---|
224 | AC_MSG_RESULT(yes) |
---|
225 | else |
---|
226 | AC_MSG_ERROR(no) |
---|
227 | fi |
---|
228 | ])dnl |
---|
229 | |
---|
230 | |
---|
231 | dnl $Id$ |
---|
232 | |
---|
233 | AC_DEFUN(RTEMS_CANONICAL_HOST, |
---|
234 | [dnl |
---|
235 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
236 | RTEMS_HOST=$host_os |
---|
237 | changequote(,)dnl |
---|
238 | case "${target}" in |
---|
239 | # hpux unix port should go here |
---|
240 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
241 | RTEMS_HOST=Linux |
---|
242 | ;; |
---|
243 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
244 | RTEMS_HOST=FreeBSD |
---|
245 | ;; |
---|
246 | sparc-sun-solaris*) # unix "simulator" port |
---|
247 | RTEMS_HOST=Solaris |
---|
248 | ;; |
---|
249 | *) |
---|
250 | ;; |
---|
251 | esac |
---|
252 | changequote([,])dnl |
---|
253 | AC_SUBST(RTEMS_HOST) |
---|
254 | ])dnl |
---|
255 | |
---|
256 | dnl |
---|
257 | dnl $Id$ |
---|
258 | dnl |
---|
259 | |
---|
260 | AC_DEFUN(RTEMS_PROJECT_ROOT, |
---|
261 | [dnl |
---|
262 | AC_REQUIRE([RTEMS_TOP]) |
---|
263 | if test "$TARGET_SUBDIR" = "." ; then |
---|
264 | PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)'; |
---|
265 | else |
---|
266 | PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)' |
---|
267 | fi |
---|
268 | AC_SUBST(PROJECT_ROOT) |
---|
269 | |
---|
270 | RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP |
---|
271 | AC_SUBST(RTEMS_ROOT) |
---|
272 | |
---|
273 | INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change" |
---|
274 | AC_SUBST(INSTALL_CHANGE) |
---|
275 | |
---|
276 | PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex" |
---|
277 | AC_SUBST(PACKHEX) |
---|
278 | ]) |
---|
279 | |
---|
280 | |
---|
281 | dnl |
---|
282 | dnl $Id$ |
---|
283 | dnl |
---|
284 | dnl Check for target gcc |
---|
285 | dnl |
---|
286 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
287 | dnl Completely reworked |
---|
288 | |
---|
289 | AC_DEFUN(RTEMS_PROG_CC, |
---|
290 | [ |
---|
291 | AC_BEFORE([$0], [AC_PROG_CPP])dnl |
---|
292 | AC_BEFORE([$0], [AC_PROG_CC])dnl |
---|
293 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
294 | |
---|
295 | dnl Only accept gcc and cc |
---|
296 | dnl NOTE: This might be too restrictive for native compilation |
---|
297 | AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc ) |
---|
298 | test -z "$CC_FOR_TARGET" \ |
---|
299 | && AC_MSG_ERROR([no acceptable cc found in \$PATH]) |
---|
300 | |
---|
301 | dnl backup |
---|
302 | rtems_save_CC=$CC |
---|
303 | rtems_save_CFLAGS=$CFLAGS |
---|
304 | |
---|
305 | dnl temporarily set CC |
---|
306 | CC=$CC_FOR_TARGET |
---|
307 | |
---|
308 | AC_PROG_CC_WORKS |
---|
309 | AC_PROG_CC_GNU |
---|
310 | |
---|
311 | if test $ac_cv_prog_gcc = yes; then |
---|
312 | GCC=yes |
---|
313 | dnl Check whether -g works, even if CFLAGS is set, in case the package |
---|
314 | dnl plays around with CFLAGS (such as to build both debugging and |
---|
315 | dnl normal versions of a library), tasteless as that idea is. |
---|
316 | ac_test_CFLAGS="${CFLAGS+set}" |
---|
317 | ac_save_CFLAGS="$CFLAGS" |
---|
318 | CFLAGS= |
---|
319 | AC_PROG_CC_G |
---|
320 | if test "$ac_test_CFLAGS" = set; then |
---|
321 | CFLAGS="$ac_save_CFLAGS" |
---|
322 | elif test $ac_cv_prog_cc_g = yes; then |
---|
323 | CFLAGS="-g -O2" |
---|
324 | else |
---|
325 | CFLAGS="-O2" |
---|
326 | fi |
---|
327 | else |
---|
328 | GCC= |
---|
329 | test "${CFLAGS+set}" = set || CFLAGS="-g" |
---|
330 | fi |
---|
331 | |
---|
332 | rtems_cv_prog_gcc=$ac_cv_prog_gcc |
---|
333 | rtems_cv_prog_cc_g=$ac_cv_prog_cc_g |
---|
334 | rtems_cv_prog_cc_works=$ac_cv_prog_cc_works |
---|
335 | rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross |
---|
336 | |
---|
337 | dnl restore initial values |
---|
338 | CC=$rtems_save_CC |
---|
339 | CFLAGS=$rtems_save_CFLAGS |
---|
340 | |
---|
341 | unset ac_cv_prog_gcc |
---|
342 | unset ac_cv_prog_cc_g |
---|
343 | unset ac_cv_prog_cc_works |
---|
344 | unset ac_cv_prog_cc_cross |
---|
345 | ]) |
---|
346 | |
---|
347 | AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET, |
---|
348 | [ |
---|
349 | dnl check target cc |
---|
350 | RTEMS_PROG_CC |
---|
351 | dnl check if the compiler supports --specs |
---|
352 | RTEMS_GCC_SPECS |
---|
353 | dnl check if the target compiler may use --pipe |
---|
354 | RTEMS_GCC_PIPE |
---|
355 | dnl check if the compiler supports --specs if gcc28 is requested |
---|
356 | if test "$RTEMS_USE_GCC272" != "yes" ; then |
---|
357 | if test "$rtems_cv_gcc_specs" = "no"; then |
---|
358 | AC_MSG_WARN([*** disabling --enable-gcc28]) |
---|
359 | RTEMS_USE_GCC272=yes |
---|
360 | fi |
---|
361 | fi |
---|
362 | test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe" |
---|
363 | |
---|
364 | dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-* |
---|
365 | case $host_os in |
---|
366 | *cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;; |
---|
367 | *) ;; |
---|
368 | esac |
---|
369 | AC_SUBST(GCCSED) |
---|
370 | ]) |
---|
371 | |
---|
372 | dnl |
---|
373 | dnl $Id$ |
---|
374 | dnl |
---|
375 | dnl Set program_prefix |
---|
376 | dnl |
---|
377 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
378 | dnl Extracted from configure |
---|
379 | |
---|
380 | AC_DEFUN(RTEMS_TOOL_PREFIX, |
---|
381 | [AC_REQUIRE([AC_CANONICAL_TARGET])dnl |
---|
382 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
383 | |
---|
384 | changequote(,)dnl |
---|
385 | if [ "${program_prefix}" = "NONE" ] ; then |
---|
386 | if [ "${target}" = "${host}" ] ; then |
---|
387 | program_prefix= |
---|
388 | else |
---|
389 | program_prefix=${target}- |
---|
390 | fi |
---|
391 | fi |
---|
392 | changequote([,])dnl |
---|
393 | ]) |
---|
394 | |
---|
395 | dnl |
---|
396 | dnl $Id$ |
---|
397 | dnl |
---|
398 | dnl Check whether the target compiler accepts -specs |
---|
399 | dnl |
---|
400 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
401 | dnl |
---|
402 | |
---|
403 | AC_DEFUN(RTEMS_GCC_SPECS, |
---|
404 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
405 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs, |
---|
406 | [ |
---|
407 | rtems_cv_gcc_specs=no |
---|
408 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
409 | touch confspec |
---|
410 | echo 'void f(){}' >conftest.c |
---|
411 | if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then |
---|
412 | rtems_cv_gcc_specs=yes |
---|
413 | fi |
---|
414 | fi |
---|
415 | rm -f confspec conftest* |
---|
416 | ])]) |
---|
417 | |
---|
418 | dnl |
---|
419 | dnl $Id$ |
---|
420 | dnl |
---|
421 | dnl Check whether the target compiler accepts -pipe |
---|
422 | dnl |
---|
423 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
424 | dnl |
---|
425 | |
---|
426 | AC_DEFUN(RTEMS_GCC_PIPE, |
---|
427 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
428 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
429 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe, |
---|
430 | [ |
---|
431 | rtems_cv_gcc_pipe=no |
---|
432 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
433 | case "$host_os" in |
---|
434 | cygwin*) |
---|
435 | ;; |
---|
436 | *) |
---|
437 | echo 'void f(){}' >conftest.c |
---|
438 | if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then |
---|
439 | rtems_cv_gcc_pipe=yes |
---|
440 | fi |
---|
441 | rm -f conftest* |
---|
442 | ;; |
---|
443 | esac |
---|
444 | fi |
---|
445 | ]) |
---|
446 | ]) |
---|
447 | |
---|
448 | dnl |
---|
449 | dnl $Id$ |
---|
450 | dnl |
---|
451 | dnl Set target tools |
---|
452 | dnl |
---|
453 | dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
454 | dnl fixing cache/environment variable handling |
---|
455 | dnl adding checks for cygwin/egcs '\\'-bug |
---|
456 | dnl adding checks for ranlib/ar -s problem |
---|
457 | dnl |
---|
458 | dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
459 | dnl |
---|
460 | |
---|
461 | AC_DEFUN(RTEMS_GCC_PRINT, |
---|
462 | [ case $host_os in |
---|
463 | *cygwin*) |
---|
464 | dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/' |
---|
465 | dnl Should be removed once cygwin/egcs reports '/' only |
---|
466 | $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' ` |
---|
467 | ;; |
---|
468 | *) |
---|
469 | $1=`$CC_FOR_TARGET --print-prog-name=$2` |
---|
470 | ;; |
---|
471 | esac |
---|
472 | ]) |
---|
473 | |
---|
474 | AC_DEFUN(RTEMS_PATH_TOOL, |
---|
475 | [ |
---|
476 | AC_MSG_CHECKING([target's $2]) |
---|
477 | AC_CACHE_VAL(ac_cv_path_$1,:) |
---|
478 | AC_MSG_RESULT([$ac_cv_path_$1]) |
---|
479 | |
---|
480 | if test -n "$ac_cv_path_$1"; then |
---|
481 | dnl retrieve the value from the cache |
---|
482 | $1=$ac_cv_path_$1 |
---|
483 | else |
---|
484 | dnl the cache was not set |
---|
485 | if test -z "[$]$1" ; then |
---|
486 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
487 | # We are using gcc, ask it about its tool |
---|
488 | # NOTE: Necessary if gcc was configured to use the target's |
---|
489 | # native tools or uses prefixes for gnutools (e.g. gas instead of as) |
---|
490 | RTEMS_GCC_PRINT($1,$2) |
---|
491 | fi |
---|
492 | else |
---|
493 | # The user set an environment variable. |
---|
494 | # Check whether it is an absolute path, otherwise AC_PATH_PROG |
---|
495 | # will override the environment variable, which isn't what the user |
---|
496 | # intends |
---|
497 | AC_MSG_CHECKING([whether environment variable $1 is an absolute path]) |
---|
498 | case "[$]$1" in |
---|
499 | /*) # valid |
---|
500 | AC_MSG_RESULT("yes") |
---|
501 | ;; |
---|
502 | *) # invalid for AC_PATH_PROG |
---|
503 | AC_MSG_RESULT("no") |
---|
504 | AC_MSG_ERROR([***] |
---|
505 | [Environment variable $1 should either] |
---|
506 | [be unset (preferred) or contain an absolute path]) |
---|
507 | ;; |
---|
508 | esac |
---|
509 | fi |
---|
510 | |
---|
511 | AC_PATH_PROG($1,"$program_prefix"$2,$3) |
---|
512 | fi |
---|
513 | ]) |
---|
514 | |
---|
515 | AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, |
---|
516 | [AC_REQUIRE([RTEMS_PROG_CC])dnl |
---|
517 | |
---|
518 | dnl FIXME: What shall be done if these tools are not available? |
---|
519 | RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no) |
---|
520 | RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no) |
---|
521 | RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no) |
---|
522 | RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no) |
---|
523 | |
---|
524 | dnl special treatment of ranlib |
---|
525 | RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no) |
---|
526 | if test "$RANLIB_FOR_TARGET" = "no"; then |
---|
527 | # ranlib wasn't found; check if ar -s is available |
---|
528 | RTEMS_AR_FOR_TARGET_S |
---|
529 | if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then |
---|
530 | dnl override RANLIB_FOR_TARGET's cache |
---|
531 | ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s" |
---|
532 | RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET |
---|
533 | else |
---|
534 | AC_MSG_ERROR([***] |
---|
535 | [Can't figure out how to build a library index] |
---|
536 | [Neither ranlib nor ar -s seem to be available] ) |
---|
537 | fi |
---|
538 | fi |
---|
539 | |
---|
540 | dnl NOTE: These may not be available if not using gnutools |
---|
541 | RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no) |
---|
542 | RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no) |
---|
543 | RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no) |
---|
544 | ]) |
---|
545 | |
---|
546 | dnl |
---|
547 | dnl $Id$ |
---|
548 | dnl |
---|
549 | |
---|
550 | AC_DEFUN(RTEMS_AR_FOR_TARGET_S, |
---|
551 | [ |
---|
552 | AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works, |
---|
553 | rtems_cv_AR_FOR_TARGET_S, |
---|
554 | [ |
---|
555 | cat > conftest.$ac_ext <<EOF |
---|
556 | int foo( int b ) |
---|
557 | { return b; } |
---|
558 | EOF |
---|
559 | if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \ |
---|
560 | && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \ |
---|
561 | && test -s conftest.a ; \ |
---|
562 | then |
---|
563 | rtems_cv_AR_FOR_TARGET_S="yes" |
---|
564 | else |
---|
565 | rtems_cv_AR_FOR_TARGET_S="no" |
---|
566 | fi |
---|
567 | rm -f conftest* |
---|
568 | ]) |
---|
569 | ]) |
---|
570 | |
---|
571 | |
---|
572 | dnl |
---|
573 | dnl $Id$ |
---|
574 | dnl |
---|
575 | |
---|
576 | dnl check for i386 gas supporting 16 bit mode |
---|
577 | dnl - binutils 2.9.1.0.7 and higher |
---|
578 | |
---|
579 | AC_DEFUN(RTEMS_I386_GAS_CODE16, |
---|
580 | [ if test "${target_cpu}" = "i386"; then |
---|
581 | AC_CACHE_CHECK([for 16 bit mode assembler support], |
---|
582 | rtems_cv_prog_gas_code16, |
---|
583 | [cat > conftest.s << EOF |
---|
584 | .code16 |
---|
585 | data32 |
---|
586 | addr32 |
---|
587 | lgdt 0 |
---|
588 | EOF |
---|
589 | if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then |
---|
590 | rtems_cv_prog_gas_code16=yes |
---|
591 | else |
---|
592 | rtems_cv_prog_gas_code16=no |
---|
593 | fi]) |
---|
594 | RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16" |
---|
595 | fi |
---|
596 | AC_SUBST(RTEMS_GAS_CODE16) |
---|
597 | ]) |
---|
598 | |
---|
599 | |
---|
600 | dnl $Id$ |
---|
601 | |
---|
602 | dnl Report all available bsps for a target, |
---|
603 | dnl check if a bsp-subdirectory is present for all bsps found |
---|
604 | dnl |
---|
605 | dnl RTEMS_CHECK_BSPS(bsp_list) |
---|
606 | AC_DEFUN(RTEMS_CHECK_BSPS, |
---|
607 | [ |
---|
608 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target |
---|
609 | AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir |
---|
610 | AC_MSG_CHECKING([for bsps]) |
---|
611 | case "${target}" in |
---|
612 | changequote(,)dnl |
---|
613 | i[3456]86-go32-rtems*) |
---|
614 | changequote([,])dnl |
---|
615 | $1="go32 go32_p5" |
---|
616 | ;; |
---|
617 | *) |
---|
618 | files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU` |
---|
619 | for file in $files; do |
---|
620 | case $file in |
---|
621 | shared*);; |
---|
622 | Makefile*);; |
---|
623 | READ*);; |
---|
624 | CVS*);; |
---|
625 | pxfl*);; |
---|
626 | go32*);; # so the i386 port can pick up the other Makefiles |
---|
627 | # Now account for BSPs with build variants |
---|
628 | gen68360) rtems_bsp="$rtems_bsp gen68360 gen68360_040";; |
---|
629 | p4000) rtems_bsp="$rtems_bsp p4600 p4650";; |
---|
630 | mvme162) rtems_bsp="$rtems_bsp mvme162 mvme162lx";; |
---|
631 | *) $1="[$]$1 $file";; |
---|
632 | esac; |
---|
633 | done |
---|
634 | ;; |
---|
635 | esac |
---|
636 | AC_MSG_RESULT([[$]$1 .. done]) |
---|
637 | ])dnl |
---|
638 | |
---|
639 | AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP, |
---|
640 | [dnl |
---|
641 | AC_MSG_CHECKING([for make/custom/[$]$1.cfg]) |
---|
642 | if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then |
---|
643 | AC_MSG_RESULT([yes]) |
---|
644 | else |
---|
645 | AC_MSG_ERROR([no]) |
---|
646 | fi |
---|
647 | ])dnl |
---|
648 | |
---|
649 | dnl |
---|
650 | dnl $Id$ |
---|
651 | dnl |
---|
652 | |
---|
653 | AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING, |
---|
654 | [dnl |
---|
655 | AC_REQUIRE([RTEMS_TOP])dnl |
---|
656 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
657 | AC_CACHE_CHECK([whether BSP supports multiprocessing], |
---|
658 | rtems_cv_HAS_MP, |
---|
659 | [dnl |
---|
660 | if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}/${$1}/shmsupp"; then |
---|
661 | if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then |
---|
662 | rtems_cv_HAS_MP="yes" ; |
---|
663 | else |
---|
664 | rtems_cv_HAS_MP="disabled"; |
---|
665 | fi |
---|
666 | else |
---|
667 | rtems_cv_HAS_MP="no"; |
---|
668 | fi]) |
---|
669 | if test "$rtems_cv_HAS_MP" = "yes"; then |
---|
670 | HAS_MP="yes" |
---|
671 | else |
---|
672 | HAS_MP="no" |
---|
673 | fi |
---|
674 | AC_SUBST(HAS_MP) |
---|
675 | ]) |
---|
676 | |
---|
677 | dnl $Id$ |
---|
678 | dnl |
---|
679 | AC_DEFUN(RTEMS_CHECK_NETWORKING, |
---|
680 | [dnl |
---|
681 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
682 | AC_CACHE_CHECK([whether BSP supports networking], |
---|
683 | rtems_cv_HAS_NETWORKING, |
---|
684 | [dnl |
---|
685 | case "$RTEMS_CPU" in |
---|
686 | unix*) |
---|
687 | rtems_cv_HAS_NETWORKING="no" |
---|
688 | ;; |
---|
689 | *) |
---|
690 | if test "${RTEMS_HAS_NETWORKING}" = "yes"; then |
---|
691 | rtems_cv_HAS_NETWORKING="yes"; |
---|
692 | else |
---|
693 | rtems_cv_HAS_NETWORKING="disabled"; |
---|
694 | fi |
---|
695 | ;; |
---|
696 | esac]) |
---|
697 | if test "$rtems_cv_HAS_NETWORKING" = "yes"; then |
---|
698 | HAS_NETWORKING="yes"; |
---|
699 | else |
---|
700 | HAS_NETWORKING="no"; |
---|
701 | fi |
---|
702 | AC_SUBST(HAS_NETWORKING)dnl |
---|
703 | ]) |
---|
704 | |
---|
705 | dnl |
---|
706 | dnl $Id$ |
---|
707 | dnl |
---|
708 | |
---|
709 | dnl RTEMS_BSP_ALIAS(BSP_ALIAS,BSP_RETURNED) |
---|
710 | dnl convert a bsp alias $1 into its bsp directory $2 |
---|
711 | AC_DEFUN(RTEMS_BSP_ALIAS, |
---|
712 | [ |
---|
713 | # account for "aliased" bsps which share source code |
---|
714 | case $1 in |
---|
715 | mvme162lx) $2=mvme162 ;; # mvme162 board variant |
---|
716 | gen68360_040) $2=gen68360 ;; # 68360 in companion mode |
---|
717 | go32_p5) $2=go32 ;; # go32 on Pentium class CPU |
---|
718 | p4600) $2=p4000 ;; # p4000 board with IDT 4600 |
---|
719 | p4650) $2=p4000 ;; # p4000 board with IDT 4650 |
---|
720 | *) $2=$1;; |
---|
721 | esac |
---|
722 | ]) |
---|
723 | |
---|
724 | dnl |
---|
725 | dnl $Id$ |
---|
726 | dnl |
---|
727 | |
---|
728 | dnl RTEMS_CHECK_MAKEFILE(path) |
---|
729 | dnl Search for Makefile.in's within the directory starting |
---|
730 | dnl at path and append an entry for Makefile to global variable |
---|
731 | dnl "makefiles" (from configure.in) for each Makefile.in found |
---|
732 | dnl |
---|
733 | AC_DEFUN(RTEMS_CHECK_MAKEFILE, |
---|
734 | [RTEMS_CHECK_FILES_IN($1,Makefile,makefiles) |
---|
735 | ]) |
---|
736 | |
---|
737 | dnl |
---|
738 | dnl $Id$ |
---|
739 | dnl |
---|
740 | |
---|
741 | dnl RTEMS_CHECK_FILES_IN(path,file,var) |
---|
742 | dnl path .. path relative to srcdir, where to start searching for files |
---|
743 | dnl file .. name of the files to search for |
---|
744 | dnl var .. shell variable to append files found |
---|
745 | |
---|
746 | AC_DEFUN(RTEMS_CHECK_FILES_IN, |
---|
747 | [ |
---|
748 | AC_MSG_CHECKING(for $2.in in $1) |
---|
749 | if test -d $srcdir/$1; then |
---|
750 | rtems_av_save_dir=`pwd`; |
---|
751 | cd $srcdir; |
---|
752 | rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"` |
---|
753 | $3="$$3 $rtems_av_tmp"; |
---|
754 | cd $rtems_av_save_dir; |
---|
755 | AC_MSG_RESULT(done) |
---|
756 | else |
---|
757 | AC_MSG_RESULT(no) |
---|
758 | fi |
---|
759 | ]) |
---|
760 | |
---|
761 | |
---|