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