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_BEFORE([$0], [AC_CONFIG_AUX_DIR])dnl |
---|
23 | AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl |
---|
24 | |
---|
25 | AC_ARG_WITH(target-subdir, |
---|
26 | [ --with-target-subdir=DIR], |
---|
27 | TARGET_SUBDIR="$withval", |
---|
28 | TARGET_SUBDIR=".") |
---|
29 | |
---|
30 | RTEMS_TOPdir="$1"; |
---|
31 | AC_SUBST(RTEMS_TOPdir) |
---|
32 | |
---|
33 | dnl Determine RTEMS Version string from the VERSION file |
---|
34 | dnl Hopefully, Joel never changes its format ;- |
---|
35 | AC_MSG_CHECKING([for RTEMS Version]) |
---|
36 | if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then |
---|
37 | changequote(,)dnl |
---|
38 | RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \ |
---|
39 | sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'` |
---|
40 | changequote([,])dnl |
---|
41 | else |
---|
42 | AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION) |
---|
43 | fi |
---|
44 | if test -z "$RTEMS_VERSION"; then |
---|
45 | AC_MSG_ERROR(Unable to determine version) |
---|
46 | fi |
---|
47 | AC_MSG_RESULT($RTEMS_VERSION) |
---|
48 | ])dnl |
---|
49 | |
---|
50 | # Do all the work for Automake. This macro actually does too much -- |
---|
51 | # some checks are only needed if your package does certain things. |
---|
52 | # But this isn't really a big deal. |
---|
53 | |
---|
54 | # serial 1 |
---|
55 | |
---|
56 | dnl Usage: |
---|
57 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) |
---|
58 | |
---|
59 | AC_DEFUN(AM_INIT_AUTOMAKE, |
---|
60 | [AC_REQUIRE([AC_PROG_INSTALL]) |
---|
61 | dnl We require 2.13 because we rely on SHELL being computed by configure. |
---|
62 | AC_PREREQ([2.13]) |
---|
63 | PACKAGE=[$1] |
---|
64 | AC_SUBST(PACKAGE) |
---|
65 | VERSION=[$2] |
---|
66 | AC_SUBST(VERSION) |
---|
67 | dnl test to see if srcdir already configured |
---|
68 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then |
---|
69 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
70 | fi |
---|
71 | ifelse([$3],, |
---|
72 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
73 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
74 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
75 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
76 | dnl FIXME This is truly gross. |
---|
77 | missing_dir=`cd $ac_aux_dir && pwd` |
---|
78 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
---|
79 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
---|
80 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
---|
81 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
---|
82 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
---|
83 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
---|
84 | |
---|
85 | # |
---|
86 | # Check to make sure that the build environment is sane. |
---|
87 | # |
---|
88 | |
---|
89 | AC_DEFUN(AM_SANITY_CHECK, |
---|
90 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
91 | # Just in case |
---|
92 | sleep 1 |
---|
93 | echo timestamp > conftestfile |
---|
94 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
95 | # arguments. Must try -L first in case configure is actually a |
---|
96 | # symlink; some systems play weird games with the mod time of symlinks |
---|
97 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
98 | # directory). |
---|
99 | if ( |
---|
100 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
101 | if test "[$]*" = "X"; then |
---|
102 | # -L didn't work. |
---|
103 | set X `ls -t $srcdir/configure conftestfile` |
---|
104 | fi |
---|
105 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
106 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
107 | |
---|
108 | # If neither matched, then we have a broken ls. This can happen |
---|
109 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
110 | # broken ls alias from the environment. This has actually |
---|
111 | # happened. Such a system could not be considered "sane". |
---|
112 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
113 | alias in your environment]) |
---|
114 | fi |
---|
115 | |
---|
116 | test "[$]2" = conftestfile |
---|
117 | ) |
---|
118 | then |
---|
119 | # Ok. |
---|
120 | : |
---|
121 | else |
---|
122 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
123 | Check your system clock]) |
---|
124 | fi |
---|
125 | rm -f conftest* |
---|
126 | AC_MSG_RESULT(yes)]) |
---|
127 | |
---|
128 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
---|
129 | dnl The program must properly implement --version. |
---|
130 | AC_DEFUN(AM_MISSING_PROG, |
---|
131 | [AC_MSG_CHECKING(for working $2) |
---|
132 | # Run test in a subshell; some versions of sh will print an error if |
---|
133 | # an executable is not found, even if stderr is redirected. |
---|
134 | # Redirect stdin to placate older versions of autoconf. Sigh. |
---|
135 | if ($2 --version) < /dev/null > /dev/null 2>&1; then |
---|
136 | $1=$2 |
---|
137 | AC_MSG_RESULT(found) |
---|
138 | else |
---|
139 | $1="$3/missing $2" |
---|
140 | AC_MSG_RESULT(missing) |
---|
141 | fi |
---|
142 | AC_SUBST($1)]) |
---|
143 | |
---|
144 | dnl |
---|
145 | dnl $Id$ |
---|
146 | dnl |
---|
147 | |
---|
148 | dnl canonicalize target cpu |
---|
149 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
150 | dnl target naming conventions "processor-vendor-os" |
---|
151 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
152 | dnl and we have to fix it for rtems ourselves |
---|
153 | |
---|
154 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
155 | [ |
---|
156 | AC_CANONICAL_SYSTEM |
---|
157 | AC_MSG_CHECKING(rtems target cpu) |
---|
158 | changequote(,)dnl |
---|
159 | case "${target}" in |
---|
160 | # hpux unix port should go here |
---|
161 | i[3456]86-go32-rtems*) |
---|
162 | RTEMS_CPU=i386 |
---|
163 | ;; |
---|
164 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
165 | RTEMS_CPU=unix |
---|
166 | ;; |
---|
167 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
168 | RTEMS_CPU=unix |
---|
169 | ;; |
---|
170 | no_cpu-*rtems*) |
---|
171 | RTEMS_CPU=no_cpu |
---|
172 | ;; |
---|
173 | sparc-sun-solaris*) # unix "simulator" port |
---|
174 | RTEMS_CPU=unix |
---|
175 | ;; |
---|
176 | *) |
---|
177 | RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` |
---|
178 | ;; |
---|
179 | esac |
---|
180 | changequote([,])dnl |
---|
181 | AC_SUBST(RTEMS_CPU) |
---|
182 | AC_MSG_RESULT($RTEMS_CPU) |
---|
183 | ]) |
---|
184 | |
---|
185 | # Add --enable-maintainer-mode option to configure. |
---|
186 | # From Jim Meyering |
---|
187 | |
---|
188 | # serial 1 |
---|
189 | |
---|
190 | AC_DEFUN(AM_MAINTAINER_MODE, |
---|
191 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
192 | dnl maintainer-mode is disabled by default |
---|
193 | AC_ARG_ENABLE(maintainer-mode, |
---|
194 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
195 | (and sometimes confusing) to the casual installer], |
---|
196 | USE_MAINTAINER_MODE=$enableval, |
---|
197 | USE_MAINTAINER_MODE=no) |
---|
198 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
199 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
200 | MAINT=$MAINTAINER_MODE_TRUE |
---|
201 | AC_SUBST(MAINT)dnl |
---|
202 | ] |
---|
203 | ) |
---|
204 | |
---|
205 | # Define a conditional. |
---|
206 | |
---|
207 | AC_DEFUN(AM_CONDITIONAL, |
---|
208 | [AC_SUBST($1_TRUE) |
---|
209 | AC_SUBST($1_FALSE) |
---|
210 | if $2; then |
---|
211 | $1_TRUE= |
---|
212 | $1_FALSE='#' |
---|
213 | else |
---|
214 | $1_TRUE='#' |
---|
215 | $1_FALSE= |
---|
216 | fi]) |
---|
217 | |
---|
218 | dnl $Id$ |
---|
219 | |
---|
220 | AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING, |
---|
221 | [ |
---|
222 | AC_ARG_ENABLE(multiprocessing, |
---|
223 | [ --enable-multiprocessing enable multiprocessing interface], |
---|
224 | [case "${enableval}" in |
---|
225 | yes) RTEMS_HAS_MULTIPROCESSING=yes ;; |
---|
226 | no) RTEMS_HAS_MULTIPROCESSING=no ;; |
---|
227 | *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;; |
---|
228 | esac],[RTEMS_HAS_MULTIPROCESSING=no]) |
---|
229 | AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl |
---|
230 | ]) |
---|
231 | |
---|
232 | dnl $Id$ |
---|
233 | |
---|
234 | AC_DEFUN(RTEMS_ENABLE_POSIX, |
---|
235 | [ |
---|
236 | AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl |
---|
237 | |
---|
238 | AC_ARG_ENABLE(posix, |
---|
239 | [ --enable-posix enable posix interface], |
---|
240 | [case "${enableval}" in |
---|
241 | yes) RTEMS_HAS_POSIX_API=yes ;; |
---|
242 | no) RTEMS_HAS_POSIX_API=no ;; |
---|
243 | *) AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;; |
---|
244 | esac],[RTEMS_HAS_POSIX_API=yes]) |
---|
245 | AC_SUBST(RTEMS_HAS_POSIX_API) |
---|
246 | |
---|
247 | changequote(,)dnl |
---|
248 | case "${target}" in |
---|
249 | # hpux unix port should go here |
---|
250 | i[3456]86-go32-rtems*) |
---|
251 | RTEMS_HAS_POSIX_API=no |
---|
252 | ;; |
---|
253 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
254 | RTEMS_HAS_POSIX_API=no |
---|
255 | ;; |
---|
256 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
257 | RTEMS_HAS_POSIX_API=no |
---|
258 | ;; |
---|
259 | no_cpu-*rtems*) |
---|
260 | RTEMS_HAS_POSIX_API=no |
---|
261 | ;; |
---|
262 | sparc-sun-solaris*) # unix "simulator" port |
---|
263 | RTEMS_HAS_POSIX_API=no |
---|
264 | ;; |
---|
265 | *) |
---|
266 | ;; |
---|
267 | esac |
---|
268 | changequote([,])dnl |
---|
269 | AC_SUBST(RTEMS_HAS_POSIX_API) |
---|
270 | ]) |
---|
271 | |
---|
272 | dnl $Id$ |
---|
273 | dnl |
---|
274 | AC_DEFUN(RTEMS_CHECK_POSIX_API, |
---|
275 | [dnl |
---|
276 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
277 | AC_REQUIRE([RTEMS_ENABLE_POSIX])dnl |
---|
278 | |
---|
279 | AC_CACHE_CHECK([whether BSP supports libposix], |
---|
280 | rtems_cv_HAS_POSIX_API, |
---|
281 | [dnl |
---|
282 | case "$RTEMS_CPU" in |
---|
283 | unix*) |
---|
284 | rtems_cv_HAS_POSIX_API="no" |
---|
285 | ;; |
---|
286 | *) |
---|
287 | if test "${RTEMS_HAS_POSIX_API}" = "yes"; then |
---|
288 | rtems_cv_HAS_POSIX_API="yes"; |
---|
289 | else |
---|
290 | rtems_cv_HAS_POSIX_API="disabled"; |
---|
291 | fi |
---|
292 | ;; |
---|
293 | esac]) |
---|
294 | if test "$rtems_cv_HAS_POSIX_API" = "yes"; then |
---|
295 | HAS_POSIX_API="yes"; |
---|
296 | else |
---|
297 | HAS_POSIX_API="no"; |
---|
298 | fi |
---|
299 | AC_SUBST(HAS_POSIX_API)dnl |
---|
300 | ]) |
---|
301 | |
---|
302 | dnl $Id$ |
---|
303 | |
---|
304 | dnl check if RTEMS support a cpu |
---|
305 | AC_DEFUN(RTEMS_CHECK_CPU, |
---|
306 | [dnl |
---|
307 | AC_REQUIRE([RTEMS_TOP]) |
---|
308 | AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU]) |
---|
309 | AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl |
---|
310 | |
---|
311 | # Is this a supported CPU? |
---|
312 | AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) |
---|
313 | if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then |
---|
314 | AC_MSG_RESULT(yes) |
---|
315 | else |
---|
316 | AC_MSG_ERROR(no) |
---|
317 | fi |
---|
318 | ])dnl |
---|
319 | |
---|
320 | |
---|
321 | dnl $Id$ |
---|
322 | |
---|
323 | AC_DEFUN(RTEMS_ENABLE_NETWORKING, |
---|
324 | [ |
---|
325 | AC_BEFORE([$0], [RTEMS_CHECK_NETWORKING])dnl |
---|
326 | |
---|
327 | AC_ARG_ENABLE(networking, |
---|
328 | [ --enable-networking enable TCP/IP stack], |
---|
329 | [case "${enableval}" in |
---|
330 | yes) RTEMS_HAS_NETWORKING=yes ;; |
---|
331 | no) RTEMS_HAS_NETWORKING=no ;; |
---|
332 | *) AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;; |
---|
333 | esac],[RTEMS_HAS_NETWORKING=yes]) |
---|
334 | AC_SUBST(RTEMS_HAS_NETWORKING)dnl |
---|
335 | ]) |
---|
336 | |
---|
337 | dnl $Id$ |
---|
338 | dnl |
---|
339 | AC_DEFUN(RTEMS_CHECK_NETWORKING, |
---|
340 | [dnl |
---|
341 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
342 | AC_REQUIRE([RTEMS_ENABLE_NETWORKING])dnl |
---|
343 | AC_BEFORE([$0], [RTEMS_CHECK_RDBG])dnl |
---|
344 | |
---|
345 | AC_CACHE_CHECK([whether BSP supports networking], |
---|
346 | rtems_cv_HAS_NETWORKING, |
---|
347 | [dnl |
---|
348 | case "$RTEMS_CPU" in |
---|
349 | unix*) |
---|
350 | rtems_cv_HAS_NETWORKING="no" |
---|
351 | ;; |
---|
352 | *) |
---|
353 | if test "${RTEMS_HAS_NETWORKING}" = "yes"; then |
---|
354 | rtems_cv_HAS_NETWORKING="yes"; |
---|
355 | else |
---|
356 | rtems_cv_HAS_NETWORKING="disabled"; |
---|
357 | fi |
---|
358 | ;; |
---|
359 | esac]) |
---|
360 | if test "$rtems_cv_HAS_NETWORKING" = "yes"; then |
---|
361 | HAS_NETWORKING="yes"; |
---|
362 | else |
---|
363 | HAS_NETWORKING="no"; |
---|
364 | fi |
---|
365 | AC_SUBST(HAS_NETWORKING)dnl |
---|
366 | ]) |
---|
367 | |
---|
368 | dnl $Id$ |
---|
369 | dnl |
---|
370 | AC_DEFUN(RTEMS_CHECK_RDBG, |
---|
371 | [dnl |
---|
372 | AC_REQUIRE([RTEMS_TOP])dnl |
---|
373 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
374 | AC_REQUIRE([RTEMS_CHECK_NETWORKING])dnl |
---|
375 | AC_REQUIRE([RTEMS_ENABLE_RDBG])dnl |
---|
376 | AC_CACHE_CHECK([whether BSP supports librdbg], |
---|
377 | rtems_cv_HAS_RDBG, |
---|
378 | [ |
---|
379 | if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/librdbg/${RTEMS_CPU}/${$1}"; then |
---|
380 | rtems_cv_HAS_RDBG="yes" ; |
---|
381 | else |
---|
382 | rtems_cv_HAS_RDBG="no"; |
---|
383 | fi |
---|
384 | ]) |
---|
385 | HAS_RDBG="$rtems_cv_HAS_RDBG" |
---|
386 | AC_SUBST(HAS_RDBG) |
---|
387 | ]) |
---|
388 | |
---|
389 | dnl $Id$ |
---|
390 | |
---|
391 | AC_DEFUN(RTEMS_ENABLE_RDBG, |
---|
392 | [ |
---|
393 | AC_BEFORE([$0], [RTEMS_CHECK_RDBG])dnl |
---|
394 | |
---|
395 | AC_ARG_ENABLE(rdbg, |
---|
396 | [ --enable-rdbg enable remote debugger], |
---|
397 | [case "${enableval}" in |
---|
398 | yes) RTEMS_HAS_RDBG=yes ;; |
---|
399 | no) RTEMS_HAS_RDBG=no ;; |
---|
400 | *) AC_MSG_ERROR(bad value ${enableval} for enable-rdbg option) ;; |
---|
401 | esac],[RTEMS_HAS_RDBG=no]) |
---|
402 | AC_SUBST(RTEMS_HAS_RDBG)dnl |
---|
403 | ]) |
---|
404 | |
---|
405 | dnl $Id$ |
---|
406 | |
---|
407 | AC_DEFUN(RTEMS_ENABLE_INLINES, |
---|
408 | [AC_ARG_ENABLE(rtems-inlines, |
---|
409 | [ --enable-rtems-inlines enable RTEMS inline functions] |
---|
410 | [ (default:enabled, disable to use macros)], |
---|
411 | [case "${enableval}" in |
---|
412 | yes) RTEMS_USE_MACROS=no ;; |
---|
413 | no) RTEMS_USE_MACROS=yes ;; |
---|
414 | *) AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;; |
---|
415 | esac],[RTEMS_USE_MACROS=no]) |
---|
416 | AC_SUBST(RTEMS_USE_MACROS)dnl |
---|
417 | ]) |
---|
418 | |
---|
419 | dnl $Id$ |
---|
420 | |
---|
421 | AC_DEFUN(RTEMS_ENABLE_CXX, |
---|
422 | [ |
---|
423 | AC_ARG_ENABLE(cxx, |
---|
424 | [ --enable-cxx enable C++ support,] |
---|
425 | [ and build the rtems++ library], |
---|
426 | [case "${enableval}" in |
---|
427 | yes) RTEMS_HAS_CPLUSPLUS=yes ;; |
---|
428 | no) RTEMS_HAS_CPLUSPLUS=no ;; |
---|
429 | *) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;; |
---|
430 | esac], [RTEMS_HAS_CPLUSPLUS=no]) |
---|
431 | ]) |
---|
432 | |
---|
433 | dnl $Id$ |
---|
434 | |
---|
435 | AC_DEFUN(RTEMS_ENABLE_GCC28, |
---|
436 | [ |
---|
437 | AC_ARG_ENABLE(gcc28, |
---|
438 | [ --enable-gcc28 enable use of gcc 2.8.x features], |
---|
439 | [case "${enableval}" in |
---|
440 | yes) RTEMS_USE_GCC272=no ;; |
---|
441 | no) RTEMS_USE_GCC272=yes ;; |
---|
442 | *) AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;; |
---|
443 | esac],[RTEMS_USE_GCC272=no]) |
---|
444 | ]) |
---|
445 | |
---|
446 | dnl $Id$ |
---|
447 | |
---|
448 | AC_DEFUN(RTEMS_ENABLE_LIBCDIR, |
---|
449 | [ |
---|
450 | AC_ARG_ENABLE(libcdir, |
---|
451 | [ --enable-libcdir=directory set the directory for the C library], |
---|
452 | [ RTEMS_LIBC_DIR="${enableval}" ; \ |
---|
453 | test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] ) |
---|
454 | AC_SUBST(RTEMS_LIBC_DIR)dnl |
---|
455 | ]) |
---|
456 | |
---|
457 | AC_DEFUN(RTEMS_ENABLE_BARE, |
---|
458 | [ |
---|
459 | AC_ARG_ENABLE(bare-cpu-cflags, |
---|
460 | [ --enable-bare-cpu-cflags specify a particular cpu cflag] |
---|
461 | [ (bare bsp specific)], |
---|
462 | [case "${enableval}" in |
---|
463 | no) BARE_CPU_CFLAGS="" ;; |
---|
464 | *) BARE_CPU_CFLAGS="${enableval}" ;; |
---|
465 | esac], |
---|
466 | [BARE_CPU_CFLAGS=""]) |
---|
467 | |
---|
468 | AC_ARG_ENABLE(bare-cpu-model, |
---|
469 | [ --enable-bare-cpu-model specify a particular cpu model] |
---|
470 | [ (bare bsp specific)], |
---|
471 | [case "${enableval}" in |
---|
472 | no) BARE_CPU_MODEL="" ;; |
---|
473 | *) BARE_CPU_MODEL="${enableval}" ;; |
---|
474 | esac], |
---|
475 | [BARE_CPU_MODEL=""]) |
---|
476 | ]) |
---|
477 | |
---|
478 | |
---|
479 | dnl $Id$ |
---|
480 | |
---|
481 | AC_DEFUN(RTEMS_ENABLE_TESTS, |
---|
482 | [ |
---|
483 | # If the tests are enabled, then find all the test suite Makefiles |
---|
484 | AC_MSG_CHECKING([if the test suites are enabled? ]) |
---|
485 | AC_ARG_ENABLE(tests, |
---|
486 | [ --enable-tests enable tests (default:disabled)], |
---|
487 | [case "${enableval}" in |
---|
488 | yes) tests_enabled=yes ;; |
---|
489 | no) tests_enabled=no ;; |
---|
490 | *) AC_MSG_ERROR(bad value ${enableval} for tests option) ;; |
---|
491 | esac], [tests_enabled=no]) |
---|
492 | AC_MSG_RESULT([$tests_enabled]) |
---|
493 | ]) |
---|
494 | |
---|
495 | dnl $Id$ |
---|
496 | |
---|
497 | dnl Override the set of BSPs to be built. |
---|
498 | dnl used by the toplevel configure script |
---|
499 | dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list) |
---|
500 | AC_DEFUN(RTEMS_ENABLE_RTEMSBSP, |
---|
501 | [ |
---|
502 | AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])dnl |
---|
503 | AC_ARG_ENABLE(rtemsbsp, |
---|
504 | [ --enable-rtemsbsp=bsp1 bsp2 .. BSPs to include in build], |
---|
505 | [case "${enableval}" in |
---|
506 | yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);; |
---|
507 | *) $1=$enableval;; |
---|
508 | esac],[$1=""]) |
---|
509 | ]) |
---|
510 | |
---|
511 | dnl Pass a single BSP via an environment variable |
---|
512 | dnl used by per BSP configure scripts |
---|
513 | AC_DEFUN(RTEMS_ENV_RTEMSBSP, |
---|
514 | [dnl |
---|
515 | AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl |
---|
516 | AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl |
---|
517 | AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl |
---|
518 | AC_BEFORE([$0], [RTEMS_CHECK_MULTIPROCESSING])dnl |
---|
519 | AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl |
---|
520 | |
---|
521 | AC_MSG_CHECKING([for RTEMS_BSP]) |
---|
522 | AC_CACHE_VAL(rtems_cv_RTEMS_BSP, |
---|
523 | [dnl |
---|
524 | test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; |
---|
525 | ])dnl |
---|
526 | if test -z "$rtems_cv_RTEMS_BSP"; then |
---|
527 | AC_MSG_ERROR([Missing RTEMS_BSP]) |
---|
528 | fi |
---|
529 | RTEMS_BSP="$rtems_cv_RTEMS_BSP" |
---|
530 | AC_MSG_RESULT(${RTEMS_BSP}) |
---|
531 | AC_SUBST(RTEMS_BSP) |
---|
532 | ]) |
---|
533 | |
---|
534 | dnl |
---|
535 | dnl $Id$ |
---|
536 | dnl |
---|
537 | |
---|
538 | AC_DEFUN(RTEMS_PROJECT_ROOT, |
---|
539 | [dnl |
---|
540 | AC_REQUIRE([RTEMS_TOP]) |
---|
541 | if test "$TARGET_SUBDIR" = "." ; then |
---|
542 | PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)'; |
---|
543 | else |
---|
544 | PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)' |
---|
545 | fi |
---|
546 | AC_SUBST(PROJECT_ROOT) |
---|
547 | |
---|
548 | RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP |
---|
549 | AC_SUBST(RTEMS_ROOT) |
---|
550 | |
---|
551 | INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change" |
---|
552 | AC_SUBST(INSTALL_CHANGE) |
---|
553 | |
---|
554 | PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex" |
---|
555 | AC_SUBST(PACKHEX) |
---|
556 | ]) |
---|
557 | |
---|
558 | |
---|
559 | dnl $Id$ |
---|
560 | |
---|
561 | dnl Report all available bsps for a target, |
---|
562 | dnl check if a bsp-subdirectory is present for all bsps found |
---|
563 | dnl |
---|
564 | dnl RTEMS_CHECK_BSPS(bsp_list) |
---|
565 | AC_DEFUN(RTEMS_CHECK_BSPS, |
---|
566 | [ |
---|
567 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target |
---|
568 | AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir |
---|
569 | AC_MSG_CHECKING([for bsps]) |
---|
570 | case "${target}" in |
---|
571 | changequote(,)dnl |
---|
572 | i[3456]86-go32-rtems*) |
---|
573 | changequote([,])dnl |
---|
574 | $1="go32 go32_p5" |
---|
575 | ;; |
---|
576 | *) |
---|
577 | files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU` |
---|
578 | for file in $files; do |
---|
579 | case $file in |
---|
580 | shared*);; |
---|
581 | Makefile*);; |
---|
582 | READ*);; |
---|
583 | CVS*);; |
---|
584 | pxfl*);; |
---|
585 | go32*);; # so the i386 port can pick up the other Makefiles |
---|
586 | # Now account for BSPs with build variants |
---|
587 | gen68360) rtems_bsp="$rtems_bsp gen68360 gen68360_040";; |
---|
588 | p4000) rtems_bsp="$rtems_bsp p4600 p4650";; |
---|
589 | mvme162) rtems_bsp="$rtems_bsp mvme162 mvme162lx";; |
---|
590 | *) $1="[$]$1 $file";; |
---|
591 | esac; |
---|
592 | done |
---|
593 | ;; |
---|
594 | esac |
---|
595 | AC_MSG_RESULT([[$]$1 .. done]) |
---|
596 | ])dnl |
---|
597 | |
---|
598 | AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP, |
---|
599 | [dnl |
---|
600 | AC_REQUIRE([RTEMS_TOP]) |
---|
601 | |
---|
602 | AC_MSG_CHECKING([for make/custom/[$]$1.cfg]) |
---|
603 | if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then |
---|
604 | AC_MSG_RESULT([yes]) |
---|
605 | else |
---|
606 | AC_MSG_ERROR([no]) |
---|
607 | fi |
---|
608 | ])dnl |
---|
609 | |
---|
610 | dnl |
---|
611 | dnl $Id$ |
---|
612 | dnl |
---|
613 | |
---|
614 | AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING, |
---|
615 | [dnl |
---|
616 | AC_REQUIRE([RTEMS_TOP])dnl |
---|
617 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
618 | AC_REQUIRE([RTEMS_ENABLE_MULTIPROCESSING])dnl |
---|
619 | |
---|
620 | AC_CACHE_CHECK([whether BSP supports multiprocessing], |
---|
621 | rtems_cv_HAS_MP, |
---|
622 | [dnl |
---|
623 | if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}/${$1}/shmsupp"; then |
---|
624 | if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then |
---|
625 | rtems_cv_HAS_MP="yes" ; |
---|
626 | else |
---|
627 | rtems_cv_HAS_MP="disabled"; |
---|
628 | fi |
---|
629 | else |
---|
630 | rtems_cv_HAS_MP="no"; |
---|
631 | fi]) |
---|
632 | if test "$rtems_cv_HAS_MP" = "yes"; then |
---|
633 | HAS_MP="yes" |
---|
634 | else |
---|
635 | HAS_MP="no" |
---|
636 | fi |
---|
637 | AC_SUBST(HAS_MP) |
---|
638 | ]) |
---|
639 | |
---|
640 | dnl $Id$ |
---|
641 | |
---|
642 | AC_DEFUN(RTEMS_CANONICAL_HOST, |
---|
643 | [dnl |
---|
644 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
645 | RTEMS_HOST=$host_os |
---|
646 | changequote(,)dnl |
---|
647 | case "${target}" in |
---|
648 | # hpux unix port should go here |
---|
649 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
650 | RTEMS_HOST=Linux |
---|
651 | ;; |
---|
652 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
653 | RTEMS_HOST=FreeBSD |
---|
654 | ;; |
---|
655 | sparc-sun-solaris*) # unix "simulator" port |
---|
656 | RTEMS_HOST=Solaris |
---|
657 | ;; |
---|
658 | *) |
---|
659 | ;; |
---|
660 | esac |
---|
661 | changequote([,])dnl |
---|
662 | AC_SUBST(RTEMS_HOST) |
---|
663 | ])dnl |
---|
664 | |
---|
665 | dnl |
---|
666 | dnl $Id$ |
---|
667 | dnl |
---|
668 | dnl Check for target gcc |
---|
669 | dnl |
---|
670 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
671 | dnl Completely reworked |
---|
672 | |
---|
673 | AC_DEFUN(RTEMS_PROG_CC, |
---|
674 | [ |
---|
675 | AC_BEFORE([$0], [AC_PROG_CPP])dnl |
---|
676 | AC_BEFORE([$0], [AC_PROG_CC])dnl |
---|
677 | AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl |
---|
678 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
679 | |
---|
680 | dnl Only accept gcc and cc |
---|
681 | dnl NOTE: This might be too restrictive for native compilation |
---|
682 | AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc ) |
---|
683 | test -z "$CC_FOR_TARGET" \ |
---|
684 | && AC_MSG_ERROR([no acceptable cc found in \$PATH]) |
---|
685 | |
---|
686 | dnl backup |
---|
687 | rtems_save_CC=$CC |
---|
688 | rtems_save_CFLAGS=$CFLAGS |
---|
689 | |
---|
690 | dnl temporarily set CC |
---|
691 | CC=$CC_FOR_TARGET |
---|
692 | |
---|
693 | AC_PROG_CC_WORKS |
---|
694 | AC_PROG_CC_GNU |
---|
695 | |
---|
696 | if test $ac_cv_prog_gcc = yes; then |
---|
697 | GCC=yes |
---|
698 | dnl Check whether -g works, even if CFLAGS is set, in case the package |
---|
699 | dnl plays around with CFLAGS (such as to build both debugging and |
---|
700 | dnl normal versions of a library), tasteless as that idea is. |
---|
701 | ac_test_CFLAGS="${CFLAGS+set}" |
---|
702 | ac_save_CFLAGS="$CFLAGS" |
---|
703 | CFLAGS= |
---|
704 | AC_PROG_CC_G |
---|
705 | if test "$ac_test_CFLAGS" = set; then |
---|
706 | CFLAGS="$ac_save_CFLAGS" |
---|
707 | elif test $ac_cv_prog_cc_g = yes; then |
---|
708 | CFLAGS="-g -O2" |
---|
709 | else |
---|
710 | CFLAGS="-O2" |
---|
711 | fi |
---|
712 | else |
---|
713 | GCC= |
---|
714 | test "${CFLAGS+set}" = set || CFLAGS="-g" |
---|
715 | fi |
---|
716 | |
---|
717 | rtems_cv_prog_gcc=$ac_cv_prog_gcc |
---|
718 | rtems_cv_prog_cc_g=$ac_cv_prog_cc_g |
---|
719 | rtems_cv_prog_cc_works=$ac_cv_prog_cc_works |
---|
720 | rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross |
---|
721 | |
---|
722 | dnl restore initial values |
---|
723 | CC=$rtems_save_CC |
---|
724 | CFLAGS=$rtems_save_CFLAGS |
---|
725 | |
---|
726 | unset ac_cv_prog_gcc |
---|
727 | unset ac_cv_prog_cc_g |
---|
728 | unset ac_cv_prog_cc_works |
---|
729 | unset ac_cv_prog_cc_cross |
---|
730 | ]) |
---|
731 | |
---|
732 | AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET, |
---|
733 | [ |
---|
734 | dnl check target cc |
---|
735 | RTEMS_PROG_CC |
---|
736 | dnl check if the compiler supports --specs |
---|
737 | RTEMS_GCC_SPECS |
---|
738 | dnl check if the target compiler may use --pipe |
---|
739 | RTEMS_GCC_PIPE |
---|
740 | dnl check if the compiler supports --specs if gcc28 is requested |
---|
741 | if test "$RTEMS_USE_GCC272" != "yes" ; then |
---|
742 | if test "$rtems_cv_gcc_specs" = "no"; then |
---|
743 | AC_MSG_WARN([*** disabling --enable-gcc28]) |
---|
744 | RTEMS_USE_GCC272=yes |
---|
745 | fi |
---|
746 | fi |
---|
747 | test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe" |
---|
748 | |
---|
749 | dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-* |
---|
750 | case $host_os in |
---|
751 | *cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;; |
---|
752 | *) ;; |
---|
753 | esac |
---|
754 | AC_SUBST(GCCSED) |
---|
755 | ]) |
---|
756 | |
---|
757 | dnl |
---|
758 | dnl $Id$ |
---|
759 | dnl |
---|
760 | dnl Set target tools |
---|
761 | dnl |
---|
762 | dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
763 | dnl fixing cache/environment variable handling |
---|
764 | dnl adding checks for cygwin/egcs '\\'-bug |
---|
765 | dnl adding checks for ranlib/ar -s problem |
---|
766 | dnl |
---|
767 | dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
768 | dnl |
---|
769 | |
---|
770 | AC_DEFUN(RTEMS_GCC_PRINT, |
---|
771 | [ case $host_os in |
---|
772 | *cygwin*) |
---|
773 | dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/' |
---|
774 | dnl Should be removed once cygwin/egcs reports '/' only |
---|
775 | $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' ` |
---|
776 | ;; |
---|
777 | *) |
---|
778 | $1=`$CC_FOR_TARGET --print-prog-name=$2` |
---|
779 | ;; |
---|
780 | esac |
---|
781 | ]) |
---|
782 | |
---|
783 | AC_DEFUN(RTEMS_PATH_TOOL, |
---|
784 | [ |
---|
785 | AC_MSG_CHECKING([target's $2]) |
---|
786 | AC_CACHE_VAL(ac_cv_path_$1,:) |
---|
787 | AC_MSG_RESULT([$ac_cv_path_$1]) |
---|
788 | |
---|
789 | if test -n "$ac_cv_path_$1"; then |
---|
790 | dnl retrieve the value from the cache |
---|
791 | $1=$ac_cv_path_$1 |
---|
792 | else |
---|
793 | dnl the cache was not set |
---|
794 | if test -z "[$]$1" ; then |
---|
795 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
796 | # We are using gcc, ask it about its tool |
---|
797 | # NOTE: Necessary if gcc was configured to use the target's |
---|
798 | # native tools or uses prefixes for gnutools (e.g. gas instead of as) |
---|
799 | RTEMS_GCC_PRINT($1,$2) |
---|
800 | fi |
---|
801 | else |
---|
802 | # The user set an environment variable. |
---|
803 | # Check whether it is an absolute path, otherwise AC_PATH_PROG |
---|
804 | # will override the environment variable, which isn't what the user |
---|
805 | # intends |
---|
806 | AC_MSG_CHECKING([whether environment variable $1 is an absolute path]) |
---|
807 | case "[$]$1" in |
---|
808 | /*) # valid |
---|
809 | AC_MSG_RESULT("yes") |
---|
810 | ;; |
---|
811 | *) # invalid for AC_PATH_PROG |
---|
812 | AC_MSG_RESULT("no") |
---|
813 | AC_MSG_ERROR([***] |
---|
814 | [Environment variable $1 should either] |
---|
815 | [be unset (preferred) or contain an absolute path]) |
---|
816 | ;; |
---|
817 | esac |
---|
818 | fi |
---|
819 | |
---|
820 | AC_PATH_PROG($1,"$program_prefix"$2,$3) |
---|
821 | fi |
---|
822 | ]) |
---|
823 | |
---|
824 | AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, |
---|
825 | [AC_REQUIRE([RTEMS_PROG_CC])dnl |
---|
826 | |
---|
827 | dnl FIXME: What shall be done if these tools are not available? |
---|
828 | RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no) |
---|
829 | RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no) |
---|
830 | RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no) |
---|
831 | RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no) |
---|
832 | |
---|
833 | dnl special treatment of ranlib |
---|
834 | RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no) |
---|
835 | if test "$RANLIB_FOR_TARGET" = "no"; then |
---|
836 | # ranlib wasn't found; check if ar -s is available |
---|
837 | RTEMS_AR_FOR_TARGET_S |
---|
838 | if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then |
---|
839 | dnl override RANLIB_FOR_TARGET's cache |
---|
840 | ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s" |
---|
841 | RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET |
---|
842 | else |
---|
843 | AC_MSG_ERROR([***] |
---|
844 | [Can't figure out how to build a library index] |
---|
845 | [Neither ranlib nor ar -s seem to be available] ) |
---|
846 | fi |
---|
847 | fi |
---|
848 | |
---|
849 | dnl NOTE: These may not be available if not using gnutools |
---|
850 | RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no) |
---|
851 | RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no) |
---|
852 | RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no) |
---|
853 | ]) |
---|
854 | |
---|
855 | dnl |
---|
856 | dnl $Id$ |
---|
857 | dnl |
---|
858 | |
---|
859 | AC_DEFUN(RTEMS_AR_FOR_TARGET_S, |
---|
860 | [ |
---|
861 | AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works, |
---|
862 | rtems_cv_AR_FOR_TARGET_S, |
---|
863 | [ |
---|
864 | cat > conftest.$ac_ext <<EOF |
---|
865 | int foo( int b ) |
---|
866 | { return b; } |
---|
867 | EOF |
---|
868 | if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \ |
---|
869 | && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \ |
---|
870 | && test -s conftest.a ; \ |
---|
871 | then |
---|
872 | rtems_cv_AR_FOR_TARGET_S="yes" |
---|
873 | else |
---|
874 | rtems_cv_AR_FOR_TARGET_S="no" |
---|
875 | fi |
---|
876 | rm -f conftest* |
---|
877 | ]) |
---|
878 | ]) |
---|
879 | |
---|
880 | |
---|
881 | dnl |
---|
882 | dnl $Id$ |
---|
883 | dnl |
---|
884 | dnl Set program_prefix |
---|
885 | dnl |
---|
886 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
887 | dnl Extracted from configure |
---|
888 | |
---|
889 | AC_DEFUN(RTEMS_TOOL_PREFIX, |
---|
890 | [AC_REQUIRE([AC_CANONICAL_TARGET])dnl |
---|
891 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
892 | |
---|
893 | changequote(,)dnl |
---|
894 | if [ "${program_prefix}" = "NONE" ] ; then |
---|
895 | if [ "${target}" = "${host}" ] ; then |
---|
896 | program_prefix= |
---|
897 | else |
---|
898 | program_prefix=${target}- |
---|
899 | fi |
---|
900 | fi |
---|
901 | changequote([,])dnl |
---|
902 | ]) |
---|
903 | |
---|
904 | dnl |
---|
905 | dnl $Id$ |
---|
906 | dnl |
---|
907 | dnl Check whether the target compiler accepts -specs |
---|
908 | dnl |
---|
909 | |
---|
910 | AC_DEFUN(RTEMS_GCC_SPECS, |
---|
911 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
912 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs, |
---|
913 | [ |
---|
914 | rtems_cv_gcc_specs=no |
---|
915 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
916 | touch confspec |
---|
917 | echo 'void f(){}' >conftest.c |
---|
918 | if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then |
---|
919 | rtems_cv_gcc_specs=yes |
---|
920 | fi |
---|
921 | fi |
---|
922 | rm -f confspec conftest* |
---|
923 | ])]) |
---|
924 | |
---|
925 | dnl |
---|
926 | dnl $Id$ |
---|
927 | dnl |
---|
928 | dnl Check whether the target compiler accepts -pipe |
---|
929 | dnl |
---|
930 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
931 | dnl |
---|
932 | |
---|
933 | AC_DEFUN(RTEMS_GCC_PIPE, |
---|
934 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
935 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
936 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe, |
---|
937 | [ |
---|
938 | rtems_cv_gcc_pipe=no |
---|
939 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
940 | case "$host_os" in |
---|
941 | cygwin*) |
---|
942 | ;; |
---|
943 | *) |
---|
944 | echo 'void f(){}' >conftest.c |
---|
945 | if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then |
---|
946 | rtems_cv_gcc_pipe=yes |
---|
947 | fi |
---|
948 | rm -f conftest* |
---|
949 | ;; |
---|
950 | esac |
---|
951 | fi |
---|
952 | ]) |
---|
953 | ]) |
---|
954 | |
---|
955 | dnl |
---|
956 | dnl $Id$ |
---|
957 | dnl |
---|
958 | dnl Check for target g++ |
---|
959 | dnl |
---|
960 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
961 | dnl Completely reworked |
---|
962 | |
---|
963 | AC_DEFUN(RTEMS_PROG_CXX, |
---|
964 | [ |
---|
965 | AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl |
---|
966 | AC_BEFORE([$0], [AC_PROG_CXX])dnl |
---|
967 | AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl |
---|
968 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
969 | |
---|
970 | dnl Only accept g++ and c++ |
---|
971 | dnl NOTE: This might be too restrictive for native compilation |
---|
972 | AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++) |
---|
973 | test -z "$CXX_FOR_TARGET" \ |
---|
974 | && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) |
---|
975 | |
---|
976 | dnl backup |
---|
977 | rtems_save_CXX=$CXX |
---|
978 | rtems_save_CXXFLAGS=$CXXFLAGS |
---|
979 | |
---|
980 | dnl temporarily set CXX |
---|
981 | CXX=$CXX_FOR_TARGET |
---|
982 | |
---|
983 | AC_PROG_CXX_WORKS |
---|
984 | AC_PROG_CXX_GNU |
---|
985 | |
---|
986 | if test $ac_cv_prog_gxx = yes; then |
---|
987 | GXX=yes |
---|
988 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package |
---|
989 | dnl plays around with CXXFLAGS (such as to build both debugging and |
---|
990 | dnl normal versions of a library), tasteless as that idea is. |
---|
991 | ac_test_CXXFLAGS="${CXXFLAGS+set}" |
---|
992 | ac_save_CXXFLAGS="$CXXFLAGS" |
---|
993 | CXXFLAGS= |
---|
994 | AC_PROG_CXX_G |
---|
995 | if test "$ac_test_CXXFLAGS" = set; then |
---|
996 | CXXFLAGS="$ac_save_CXXFLAGS" |
---|
997 | elif test $ac_cv_prog_cxx_g = yes; then |
---|
998 | CXXFLAGS="-g -O2" |
---|
999 | else |
---|
1000 | CXXFLAGS="-O2" |
---|
1001 | fi |
---|
1002 | else |
---|
1003 | GXX= |
---|
1004 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" |
---|
1005 | fi |
---|
1006 | |
---|
1007 | rtems_cv_prog_gxx=$ac_cv_prog_gxx |
---|
1008 | rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g |
---|
1009 | rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works |
---|
1010 | rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross |
---|
1011 | |
---|
1012 | CXX=$rtems_save_CXX |
---|
1013 | CXXFLAGS=$rtems_save_CXXFLAGS |
---|
1014 | |
---|
1015 | dnl restore initial values |
---|
1016 | unset ac_cv_prog_gxx |
---|
1017 | unset ac_cv_prog_cc_g |
---|
1018 | unset ac_cv_prog_cxx_works |
---|
1019 | unset ac_cv_prog_cxx_cross |
---|
1020 | ]) |
---|
1021 | |
---|
1022 | AC_DEFUN(RTEMS_PROG_CXX_FOR_TARGET, |
---|
1023 | [ |
---|
1024 | RTEMS_PROG_CXX |
---|
1025 | if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then |
---|
1026 | AC_MSG_ERROR([***] |
---|
1027 | [Inconsistency in compiler configuration:] |
---|
1028 | [Target C compiler and Target C++ compiler] |
---|
1029 | [must both either be cross compilers or native compilers] |
---|
1030 | [Hint: If building a posix bsp: LD_LIBRARY_PATH?] ) |
---|
1031 | fi |
---|
1032 | ]) |
---|
1033 | |
---|