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 | dnl $Id$ |
---|
186 | |
---|
187 | AC_DEFUN(RTEMS_CANONICAL_HOST, |
---|
188 | [dnl |
---|
189 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
190 | RTEMS_HOST=$host_os |
---|
191 | changequote(,)dnl |
---|
192 | case "${target}" in |
---|
193 | # hpux unix port should go here |
---|
194 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
195 | RTEMS_HOST=Linux |
---|
196 | ;; |
---|
197 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
198 | RTEMS_HOST=FreeBSD |
---|
199 | ;; |
---|
200 | sparc-sun-solaris*) # unix "simulator" port |
---|
201 | RTEMS_HOST=Solaris |
---|
202 | ;; |
---|
203 | *) |
---|
204 | ;; |
---|
205 | esac |
---|
206 | changequote([,])dnl |
---|
207 | AC_SUBST(RTEMS_HOST) |
---|
208 | ])dnl |
---|
209 | |
---|
210 | # Add --enable-maintainer-mode option to configure. |
---|
211 | # From Jim Meyering |
---|
212 | |
---|
213 | # serial 1 |
---|
214 | |
---|
215 | AC_DEFUN(AM_MAINTAINER_MODE, |
---|
216 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
217 | dnl maintainer-mode is disabled by default |
---|
218 | AC_ARG_ENABLE(maintainer-mode, |
---|
219 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
220 | (and sometimes confusing) to the casual installer], |
---|
221 | USE_MAINTAINER_MODE=$enableval, |
---|
222 | USE_MAINTAINER_MODE=no) |
---|
223 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
224 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
225 | MAINT=$MAINTAINER_MODE_TRUE |
---|
226 | AC_SUBST(MAINT)dnl |
---|
227 | ] |
---|
228 | ) |
---|
229 | |
---|
230 | # Define a conditional. |
---|
231 | |
---|
232 | AC_DEFUN(AM_CONDITIONAL, |
---|
233 | [AC_SUBST($1_TRUE) |
---|
234 | AC_SUBST($1_FALSE) |
---|
235 | if $2; then |
---|
236 | $1_TRUE= |
---|
237 | $1_FALSE='#' |
---|
238 | else |
---|
239 | $1_TRUE='#' |
---|
240 | $1_FALSE= |
---|
241 | fi]) |
---|
242 | |
---|
243 | dnl $Id$ |
---|
244 | |
---|
245 | AC_DEFUN(RTEMS_ENABLE_CXX, |
---|
246 | [ |
---|
247 | AC_ARG_ENABLE(cxx, |
---|
248 | [ --enable-cxx enable C++ support,] |
---|
249 | [ and build the rtems++ library], |
---|
250 | [case "${enableval}" in |
---|
251 | yes) RTEMS_HAS_CPLUSPLUS=yes ;; |
---|
252 | no) RTEMS_HAS_CPLUSPLUS=no ;; |
---|
253 | *) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;; |
---|
254 | esac], [RTEMS_HAS_CPLUSPLUS=no]) |
---|
255 | ]) |
---|
256 | |
---|
257 | dnl $Id$ |
---|
258 | |
---|
259 | AC_DEFUN(RTEMS_ENABLE_LIBCDIR, |
---|
260 | [ |
---|
261 | AC_ARG_ENABLE(libcdir, |
---|
262 | [ --enable-libcdir=directory set the directory for the C library], |
---|
263 | [ RTEMS_LIBC_DIR="${enableval}" ; \ |
---|
264 | test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] ) |
---|
265 | AC_SUBST(RTEMS_LIBC_DIR)dnl |
---|
266 | ]) |
---|
267 | |
---|
268 | dnl $Id$ |
---|
269 | |
---|
270 | dnl Override the set of BSPs to be built. |
---|
271 | dnl used by the toplevel configure script |
---|
272 | dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list) |
---|
273 | AC_DEFUN(RTEMS_ENABLE_RTEMSBSP, |
---|
274 | [ |
---|
275 | AC_BEFORE([$0], [RTEMS_ENV_RTEMSBSP])dnl |
---|
276 | AC_ARG_ENABLE(rtemsbsp, |
---|
277 | [ --enable-rtemsbsp=bsp1 bsp2 .. BSPs to include in build], |
---|
278 | [case "${enableval}" in |
---|
279 | yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);; |
---|
280 | *) $1=$enableval;; |
---|
281 | esac],[$1=""]) |
---|
282 | ]) |
---|
283 | |
---|
284 | dnl Pass a single BSP via an environment variable |
---|
285 | dnl used by per BSP configure scripts |
---|
286 | AC_DEFUN(RTEMS_ENV_RTEMSBSP, |
---|
287 | [dnl |
---|
288 | AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl |
---|
289 | AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl |
---|
290 | AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl |
---|
291 | AC_BEFORE([$0], [RTEMS_CHECK_MULTIPROCESSING])dnl |
---|
292 | AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl |
---|
293 | |
---|
294 | AC_MSG_CHECKING([for RTEMS_BSP]) |
---|
295 | AC_CACHE_VAL(rtems_cv_RTEMS_BSP, |
---|
296 | [dnl |
---|
297 | test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; |
---|
298 | ])dnl |
---|
299 | if test -z "$rtems_cv_RTEMS_BSP"; then |
---|
300 | AC_MSG_ERROR([Missing RTEMS_BSP]) |
---|
301 | fi |
---|
302 | RTEMS_BSP="$rtems_cv_RTEMS_BSP" |
---|
303 | AC_MSG_RESULT(${RTEMS_BSP}) |
---|
304 | AC_SUBST(RTEMS_BSP) |
---|
305 | ]) |
---|
306 | |
---|
307 | dnl |
---|
308 | dnl $Id$ |
---|
309 | dnl |
---|
310 | |
---|
311 | AC_DEFUN(RTEMS_PROJECT_ROOT, |
---|
312 | [dnl |
---|
313 | AC_REQUIRE([RTEMS_TOP]) |
---|
314 | if test "$TARGET_SUBDIR" = "." ; then |
---|
315 | PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)'; |
---|
316 | else |
---|
317 | PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)' |
---|
318 | fi |
---|
319 | AC_SUBST(PROJECT_ROOT) |
---|
320 | |
---|
321 | RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP |
---|
322 | AC_SUBST(RTEMS_ROOT) |
---|
323 | |
---|
324 | INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change" |
---|
325 | AC_SUBST(INSTALL_CHANGE) |
---|
326 | |
---|
327 | PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex" |
---|
328 | AC_SUBST(PACKHEX) |
---|
329 | ]) |
---|
330 | |
---|
331 | |
---|
332 | dnl $Id$ |
---|
333 | |
---|
334 | dnl Report all available bsps for a target, |
---|
335 | dnl check if a bsp-subdirectory is present for all bsps found |
---|
336 | dnl |
---|
337 | dnl RTEMS_CHECK_BSPS(bsp_list) |
---|
338 | AC_DEFUN(RTEMS_CHECK_BSPS, |
---|
339 | [ |
---|
340 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target |
---|
341 | AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir |
---|
342 | AC_MSG_CHECKING([for bsps]) |
---|
343 | case "${target}" in |
---|
344 | changequote(,)dnl |
---|
345 | i[3456]86-go32-rtems*) |
---|
346 | changequote([,])dnl |
---|
347 | $1="go32 go32_p5" |
---|
348 | ;; |
---|
349 | *) |
---|
350 | files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU` |
---|
351 | for file in $files; do |
---|
352 | case $file in |
---|
353 | shared*);; |
---|
354 | Makefile*);; |
---|
355 | READ*);; |
---|
356 | CVS*);; |
---|
357 | pxfl*);; |
---|
358 | go32*);; # so the i386 port can pick up the other Makefiles |
---|
359 | # Now account for BSPs with build variants |
---|
360 | gen68360) rtems_bsp="$rtems_bsp gen68360 gen68360_040";; |
---|
361 | p4000) rtems_bsp="$rtems_bsp p4600 p4650";; |
---|
362 | mvme162) rtems_bsp="$rtems_bsp mvme162 mvme162lx";; |
---|
363 | *) $1="[$]$1 $file";; |
---|
364 | esac; |
---|
365 | done |
---|
366 | ;; |
---|
367 | esac |
---|
368 | AC_MSG_RESULT([[$]$1 .. done]) |
---|
369 | ])dnl |
---|
370 | |
---|
371 | AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP, |
---|
372 | [dnl |
---|
373 | AC_REQUIRE([RTEMS_TOP]) |
---|
374 | |
---|
375 | AC_MSG_CHECKING([for make/custom/[$]$1.cfg]) |
---|
376 | if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then |
---|
377 | AC_MSG_RESULT([yes]) |
---|
378 | else |
---|
379 | AC_MSG_ERROR([no]) |
---|
380 | fi |
---|
381 | ])dnl |
---|
382 | |
---|
383 | dnl $Id$ |
---|
384 | |
---|
385 | dnl check if RTEMS support a cpu |
---|
386 | AC_DEFUN(RTEMS_CHECK_CPU, |
---|
387 | [dnl |
---|
388 | AC_REQUIRE([RTEMS_TOP]) |
---|
389 | AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU]) |
---|
390 | AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl |
---|
391 | |
---|
392 | # Is this a supported CPU? |
---|
393 | AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) |
---|
394 | if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then |
---|
395 | AC_MSG_RESULT(yes) |
---|
396 | else |
---|
397 | AC_MSG_ERROR(no) |
---|
398 | fi |
---|
399 | ])dnl |
---|
400 | |
---|
401 | |
---|
402 | dnl $Id$ |
---|
403 | dnl |
---|
404 | AC_DEFUN(RTEMS_CHECK_POSIX_API, |
---|
405 | [dnl |
---|
406 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
407 | AC_REQUIRE([RTEMS_ENABLE_POSIX])dnl |
---|
408 | |
---|
409 | AC_CACHE_CHECK([whether BSP supports libposix], |
---|
410 | rtems_cv_HAS_POSIX_API, |
---|
411 | [dnl |
---|
412 | case "$RTEMS_CPU" in |
---|
413 | unix*) |
---|
414 | rtems_cv_HAS_POSIX_API="no" |
---|
415 | ;; |
---|
416 | *) |
---|
417 | if test "${RTEMS_HAS_POSIX_API}" = "yes"; then |
---|
418 | rtems_cv_HAS_POSIX_API="yes"; |
---|
419 | else |
---|
420 | rtems_cv_HAS_POSIX_API="disabled"; |
---|
421 | fi |
---|
422 | ;; |
---|
423 | esac]) |
---|
424 | if test "$rtems_cv_HAS_POSIX_API" = "yes"; then |
---|
425 | HAS_POSIX_API="yes"; |
---|
426 | else |
---|
427 | HAS_POSIX_API="no"; |
---|
428 | fi |
---|
429 | AC_SUBST(HAS_POSIX_API)dnl |
---|
430 | ]) |
---|
431 | |
---|
432 | dnl $Id$ |
---|
433 | |
---|
434 | AC_DEFUN(RTEMS_ENABLE_POSIX, |
---|
435 | [ |
---|
436 | AC_BEFORE([$0], [RTEMS_CHECK_POSIX_API])dnl |
---|
437 | |
---|
438 | AC_ARG_ENABLE(posix, |
---|
439 | [ --enable-posix enable posix interface], |
---|
440 | [case "${enableval}" in |
---|
441 | yes) RTEMS_HAS_POSIX_API=yes ;; |
---|
442 | no) RTEMS_HAS_POSIX_API=no ;; |
---|
443 | *) AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;; |
---|
444 | esac],[RTEMS_HAS_POSIX_API=yes]) |
---|
445 | AC_SUBST(RTEMS_HAS_POSIX_API) |
---|
446 | |
---|
447 | changequote(,)dnl |
---|
448 | case "${target}" in |
---|
449 | # hpux unix port should go here |
---|
450 | i[3456]86-go32-rtems*) |
---|
451 | RTEMS_HAS_POSIX_API=no |
---|
452 | ;; |
---|
453 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
454 | RTEMS_HAS_POSIX_API=no |
---|
455 | ;; |
---|
456 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
457 | RTEMS_HAS_POSIX_API=no |
---|
458 | ;; |
---|
459 | no_cpu-*rtems*) |
---|
460 | RTEMS_HAS_POSIX_API=no |
---|
461 | ;; |
---|
462 | sparc-sun-solaris*) # unix "simulator" port |
---|
463 | RTEMS_HAS_POSIX_API=no |
---|
464 | ;; |
---|
465 | *) |
---|
466 | ;; |
---|
467 | esac |
---|
468 | changequote([,])dnl |
---|
469 | AC_SUBST(RTEMS_HAS_POSIX_API) |
---|
470 | ]) |
---|
471 | |
---|
472 | dnl |
---|
473 | dnl $Id$ |
---|
474 | dnl |
---|
475 | |
---|
476 | AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING, |
---|
477 | [dnl |
---|
478 | AC_REQUIRE([RTEMS_TOP])dnl |
---|
479 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
480 | AC_REQUIRE([RTEMS_ENABLE_MULTIPROCESSING])dnl |
---|
481 | |
---|
482 | AC_CACHE_CHECK([whether BSP supports multiprocessing], |
---|
483 | rtems_cv_HAS_MP, |
---|
484 | [dnl |
---|
485 | if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}/${$1}/shmsupp"; then |
---|
486 | if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then |
---|
487 | rtems_cv_HAS_MP="yes" ; |
---|
488 | else |
---|
489 | rtems_cv_HAS_MP="disabled"; |
---|
490 | fi |
---|
491 | else |
---|
492 | rtems_cv_HAS_MP="no"; |
---|
493 | fi]) |
---|
494 | if test "$rtems_cv_HAS_MP" = "yes"; then |
---|
495 | HAS_MP="yes" |
---|
496 | else |
---|
497 | HAS_MP="no" |
---|
498 | fi |
---|
499 | AC_SUBST(HAS_MP) |
---|
500 | ]) |
---|
501 | |
---|
502 | dnl $Id$ |
---|
503 | |
---|
504 | AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING, |
---|
505 | [ |
---|
506 | AC_ARG_ENABLE(multiprocessing, |
---|
507 | [ --enable-multiprocessing enable multiprocessing interface], |
---|
508 | [case "${enableval}" in |
---|
509 | yes) RTEMS_HAS_MULTIPROCESSING=yes ;; |
---|
510 | no) RTEMS_HAS_MULTIPROCESSING=no ;; |
---|
511 | *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;; |
---|
512 | esac],[RTEMS_HAS_MULTIPROCESSING=no]) |
---|
513 | AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl |
---|
514 | ]) |
---|
515 | |
---|
516 | dnl $Id$ |
---|
517 | dnl |
---|
518 | AC_DEFUN(RTEMS_CHECK_CXX, |
---|
519 | [dnl |
---|
520 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
521 | AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl |
---|
522 | AC_REQUIRE([RTEMS_PROG_CXX_FOR_TARGET])dnl |
---|
523 | AC_CACHE_CHECK([whether to build rtems++], |
---|
524 | rtems_cv_HAS_CPLUSPLUS, |
---|
525 | [ if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then |
---|
526 | if test -n "$CXX_FOR_TARGET"; then |
---|
527 | rtems_cv_HAS_CPLUSPLUS="yes" |
---|
528 | else |
---|
529 | rtems_cv_HAS_CPLUSPLUS="no" |
---|
530 | fi |
---|
531 | else |
---|
532 | rtems_cv_HAS_CPLUSPLUS="no" |
---|
533 | fi]) |
---|
534 | HAS_CPLUSPLUS="$rtems_cv_HAS_CPLUSPLUS"; |
---|
535 | AC_SUBST(HAS_CPLUSPLUS)dnl |
---|
536 | ]) |
---|
537 | |
---|
538 | dnl |
---|
539 | dnl $Id$ |
---|
540 | dnl |
---|
541 | dnl Check for target gcc |
---|
542 | dnl |
---|
543 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
544 | dnl Completely reworked |
---|
545 | |
---|
546 | AC_DEFUN(RTEMS_PROG_CC, |
---|
547 | [ |
---|
548 | AC_BEFORE([$0], [AC_PROG_CPP])dnl |
---|
549 | AC_BEFORE([$0], [AC_PROG_CC])dnl |
---|
550 | AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl |
---|
551 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
552 | |
---|
553 | dnl Only accept gcc and cc |
---|
554 | dnl NOTE: This might be too restrictive for native compilation |
---|
555 | AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc ) |
---|
556 | test -z "$CC_FOR_TARGET" \ |
---|
557 | && AC_MSG_ERROR([no acceptable cc found in \$PATH]) |
---|
558 | |
---|
559 | dnl backup |
---|
560 | rtems_save_CC=$CC |
---|
561 | rtems_save_CFLAGS=$CFLAGS |
---|
562 | |
---|
563 | dnl temporarily set CC |
---|
564 | CC=$CC_FOR_TARGET |
---|
565 | |
---|
566 | AC_PROG_CC_WORKS |
---|
567 | AC_PROG_CC_GNU |
---|
568 | |
---|
569 | if test $ac_cv_prog_gcc = yes; then |
---|
570 | GCC=yes |
---|
571 | dnl Check whether -g works, even if CFLAGS is set, in case the package |
---|
572 | dnl plays around with CFLAGS (such as to build both debugging and |
---|
573 | dnl normal versions of a library), tasteless as that idea is. |
---|
574 | ac_test_CFLAGS="${CFLAGS+set}" |
---|
575 | ac_save_CFLAGS="$CFLAGS" |
---|
576 | CFLAGS= |
---|
577 | AC_PROG_CC_G |
---|
578 | if test "$ac_test_CFLAGS" = set; then |
---|
579 | CFLAGS="$ac_save_CFLAGS" |
---|
580 | elif test $ac_cv_prog_cc_g = yes; then |
---|
581 | CFLAGS="-g -O2" |
---|
582 | else |
---|
583 | CFLAGS="-O2" |
---|
584 | fi |
---|
585 | else |
---|
586 | GCC= |
---|
587 | test "${CFLAGS+set}" = set || CFLAGS="-g" |
---|
588 | fi |
---|
589 | |
---|
590 | rtems_cv_prog_gcc=$ac_cv_prog_gcc |
---|
591 | rtems_cv_prog_cc_g=$ac_cv_prog_cc_g |
---|
592 | rtems_cv_prog_cc_works=$ac_cv_prog_cc_works |
---|
593 | rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross |
---|
594 | |
---|
595 | dnl restore initial values |
---|
596 | CC=$rtems_save_CC |
---|
597 | CFLAGS=$rtems_save_CFLAGS |
---|
598 | |
---|
599 | unset ac_cv_prog_gcc |
---|
600 | unset ac_cv_prog_cc_g |
---|
601 | unset ac_cv_prog_cc_works |
---|
602 | unset ac_cv_prog_cc_cross |
---|
603 | ]) |
---|
604 | |
---|
605 | AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET, |
---|
606 | [ |
---|
607 | dnl check target cc |
---|
608 | RTEMS_PROG_CC |
---|
609 | dnl check if the compiler supports --specs |
---|
610 | RTEMS_GCC_SPECS |
---|
611 | dnl check if the target compiler may use --pipe |
---|
612 | RTEMS_GCC_PIPE |
---|
613 | dnl check if the compiler supports --specs if gcc28 is requested |
---|
614 | if test "$RTEMS_USE_GCC272" != "yes" ; then |
---|
615 | if test "$rtems_cv_gcc_specs" = "no"; then |
---|
616 | AC_MSG_WARN([*** disabling --enable-gcc28]) |
---|
617 | RTEMS_USE_GCC272=yes |
---|
618 | fi |
---|
619 | fi |
---|
620 | test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe" |
---|
621 | |
---|
622 | dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-* |
---|
623 | case $host_os in |
---|
624 | *cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;; |
---|
625 | *) ;; |
---|
626 | esac |
---|
627 | AC_SUBST(GCCSED) |
---|
628 | ]) |
---|
629 | |
---|
630 | dnl |
---|
631 | dnl $Id$ |
---|
632 | dnl |
---|
633 | dnl Set target tools |
---|
634 | dnl |
---|
635 | dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
636 | dnl fixing cache/environment variable handling |
---|
637 | dnl adding checks for cygwin/egcs '\\'-bug |
---|
638 | dnl adding checks for ranlib/ar -s problem |
---|
639 | dnl |
---|
640 | dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
641 | dnl |
---|
642 | |
---|
643 | AC_DEFUN(RTEMS_GCC_PRINT, |
---|
644 | [ case $host_os in |
---|
645 | *cygwin*) |
---|
646 | dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/' |
---|
647 | dnl Should be removed once cygwin/egcs reports '/' only |
---|
648 | $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' ` |
---|
649 | ;; |
---|
650 | *) |
---|
651 | $1=`$CC_FOR_TARGET --print-prog-name=$2` |
---|
652 | ;; |
---|
653 | esac |
---|
654 | ]) |
---|
655 | |
---|
656 | AC_DEFUN(RTEMS_PATH_TOOL, |
---|
657 | [ |
---|
658 | AC_MSG_CHECKING([target's $2]) |
---|
659 | AC_CACHE_VAL(ac_cv_path_$1,:) |
---|
660 | AC_MSG_RESULT([$ac_cv_path_$1]) |
---|
661 | |
---|
662 | if test -n "$ac_cv_path_$1"; then |
---|
663 | dnl retrieve the value from the cache |
---|
664 | $1=$ac_cv_path_$1 |
---|
665 | else |
---|
666 | dnl the cache was not set |
---|
667 | if test -z "[$]$1" ; then |
---|
668 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
669 | # We are using gcc, ask it about its tool |
---|
670 | # NOTE: Necessary if gcc was configured to use the target's |
---|
671 | # native tools or uses prefixes for gnutools (e.g. gas instead of as) |
---|
672 | RTEMS_GCC_PRINT($1,$2) |
---|
673 | fi |
---|
674 | else |
---|
675 | # The user set an environment variable. |
---|
676 | # Check whether it is an absolute path, otherwise AC_PATH_PROG |
---|
677 | # will override the environment variable, which isn't what the user |
---|
678 | # intends |
---|
679 | AC_MSG_CHECKING([whether environment variable $1 is an absolute path]) |
---|
680 | case "[$]$1" in |
---|
681 | /*) # valid |
---|
682 | AC_MSG_RESULT("yes") |
---|
683 | ;; |
---|
684 | *) # invalid for AC_PATH_PROG |
---|
685 | AC_MSG_RESULT("no") |
---|
686 | AC_MSG_ERROR([***] |
---|
687 | [Environment variable $1 should either] |
---|
688 | [be unset (preferred) or contain an absolute path]) |
---|
689 | ;; |
---|
690 | esac |
---|
691 | fi |
---|
692 | |
---|
693 | AC_PATH_PROG($1,"$program_prefix"$2,$3) |
---|
694 | fi |
---|
695 | ]) |
---|
696 | |
---|
697 | AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, |
---|
698 | [AC_REQUIRE([RTEMS_PROG_CC])dnl |
---|
699 | |
---|
700 | dnl FIXME: What shall be done if these tools are not available? |
---|
701 | RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no) |
---|
702 | RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no) |
---|
703 | RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no) |
---|
704 | RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no) |
---|
705 | |
---|
706 | dnl special treatment of ranlib |
---|
707 | RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no) |
---|
708 | if test "$RANLIB_FOR_TARGET" = "no"; then |
---|
709 | # ranlib wasn't found; check if ar -s is available |
---|
710 | RTEMS_AR_FOR_TARGET_S |
---|
711 | if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then |
---|
712 | dnl override RANLIB_FOR_TARGET's cache |
---|
713 | ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s" |
---|
714 | RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET |
---|
715 | else |
---|
716 | AC_MSG_ERROR([***] |
---|
717 | [Can't figure out how to build a library index] |
---|
718 | [Neither ranlib nor ar -s seem to be available] ) |
---|
719 | fi |
---|
720 | fi |
---|
721 | |
---|
722 | dnl NOTE: These may not be available if not using gnutools |
---|
723 | RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no) |
---|
724 | RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no) |
---|
725 | RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no) |
---|
726 | ]) |
---|
727 | |
---|
728 | dnl |
---|
729 | dnl $Id$ |
---|
730 | dnl |
---|
731 | |
---|
732 | AC_DEFUN(RTEMS_AR_FOR_TARGET_S, |
---|
733 | [ |
---|
734 | AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works, |
---|
735 | rtems_cv_AR_FOR_TARGET_S, |
---|
736 | [ |
---|
737 | cat > conftest.$ac_ext <<EOF |
---|
738 | int foo( int b ) |
---|
739 | { return b; } |
---|
740 | EOF |
---|
741 | if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \ |
---|
742 | && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \ |
---|
743 | && test -s conftest.a ; \ |
---|
744 | then |
---|
745 | rtems_cv_AR_FOR_TARGET_S="yes" |
---|
746 | else |
---|
747 | rtems_cv_AR_FOR_TARGET_S="no" |
---|
748 | fi |
---|
749 | rm -f conftest* |
---|
750 | ]) |
---|
751 | ]) |
---|
752 | |
---|
753 | |
---|
754 | dnl |
---|
755 | dnl $Id$ |
---|
756 | dnl |
---|
757 | dnl Set program_prefix |
---|
758 | dnl |
---|
759 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
760 | dnl Extracted from configure |
---|
761 | |
---|
762 | AC_DEFUN(RTEMS_TOOL_PREFIX, |
---|
763 | [AC_REQUIRE([AC_CANONICAL_TARGET])dnl |
---|
764 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
765 | |
---|
766 | changequote(,)dnl |
---|
767 | if [ "${program_prefix}" = "NONE" ] ; then |
---|
768 | if [ "${target}" = "${host}" ] ; then |
---|
769 | program_prefix= |
---|
770 | else |
---|
771 | program_prefix=${target}- |
---|
772 | fi |
---|
773 | fi |
---|
774 | changequote([,])dnl |
---|
775 | ]) |
---|
776 | |
---|
777 | dnl |
---|
778 | dnl $Id$ |
---|
779 | dnl |
---|
780 | dnl Check whether the target compiler accepts -specs |
---|
781 | dnl |
---|
782 | |
---|
783 | AC_DEFUN(RTEMS_GCC_SPECS, |
---|
784 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
785 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs, |
---|
786 | [ |
---|
787 | rtems_cv_gcc_specs=no |
---|
788 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
789 | touch confspec |
---|
790 | echo 'void f(){}' >conftest.c |
---|
791 | if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then |
---|
792 | rtems_cv_gcc_specs=yes |
---|
793 | fi |
---|
794 | fi |
---|
795 | rm -f confspec conftest* |
---|
796 | ])]) |
---|
797 | |
---|
798 | dnl |
---|
799 | dnl $Id$ |
---|
800 | dnl |
---|
801 | dnl Check whether the target compiler accepts -pipe |
---|
802 | dnl |
---|
803 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
804 | dnl |
---|
805 | |
---|
806 | AC_DEFUN(RTEMS_GCC_PIPE, |
---|
807 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
808 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
809 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe, |
---|
810 | [ |
---|
811 | rtems_cv_gcc_pipe=no |
---|
812 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
813 | case "$host_os" in |
---|
814 | cygwin*) |
---|
815 | ;; |
---|
816 | *) |
---|
817 | echo 'void f(){}' >conftest.c |
---|
818 | if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then |
---|
819 | rtems_cv_gcc_pipe=yes |
---|
820 | fi |
---|
821 | rm -f conftest* |
---|
822 | ;; |
---|
823 | esac |
---|
824 | fi |
---|
825 | ]) |
---|
826 | ]) |
---|
827 | |
---|
828 | dnl |
---|
829 | dnl $Id$ |
---|
830 | dnl |
---|
831 | dnl Check for target g++ |
---|
832 | dnl |
---|
833 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
834 | dnl Completely reworked |
---|
835 | |
---|
836 | AC_DEFUN(RTEMS_PROG_CXX, |
---|
837 | [ |
---|
838 | AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl |
---|
839 | AC_BEFORE([$0], [AC_PROG_CXX])dnl |
---|
840 | AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl |
---|
841 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
842 | |
---|
843 | dnl Only accept g++ and c++ |
---|
844 | dnl NOTE: This might be too restrictive for native compilation |
---|
845 | AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++) |
---|
846 | test -z "$CXX_FOR_TARGET" \ |
---|
847 | && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) |
---|
848 | |
---|
849 | dnl backup |
---|
850 | rtems_save_CXX=$CXX |
---|
851 | rtems_save_CXXFLAGS=$CXXFLAGS |
---|
852 | |
---|
853 | dnl temporarily set CXX |
---|
854 | CXX=$CXX_FOR_TARGET |
---|
855 | |
---|
856 | AC_PROG_CXX_WORKS |
---|
857 | AC_PROG_CXX_GNU |
---|
858 | |
---|
859 | if test $ac_cv_prog_gxx = yes; then |
---|
860 | GXX=yes |
---|
861 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package |
---|
862 | dnl plays around with CXXFLAGS (such as to build both debugging and |
---|
863 | dnl normal versions of a library), tasteless as that idea is. |
---|
864 | ac_test_CXXFLAGS="${CXXFLAGS+set}" |
---|
865 | ac_save_CXXFLAGS="$CXXFLAGS" |
---|
866 | CXXFLAGS= |
---|
867 | AC_PROG_CXX_G |
---|
868 | if test "$ac_test_CXXFLAGS" = set; then |
---|
869 | CXXFLAGS="$ac_save_CXXFLAGS" |
---|
870 | elif test $ac_cv_prog_cxx_g = yes; then |
---|
871 | CXXFLAGS="-g -O2" |
---|
872 | else |
---|
873 | CXXFLAGS="-O2" |
---|
874 | fi |
---|
875 | else |
---|
876 | GXX= |
---|
877 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" |
---|
878 | fi |
---|
879 | |
---|
880 | rtems_cv_prog_gxx=$ac_cv_prog_gxx |
---|
881 | rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g |
---|
882 | rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works |
---|
883 | rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross |
---|
884 | |
---|
885 | CXX=$rtems_save_CXX |
---|
886 | CXXFLAGS=$rtems_save_CXXFLAGS |
---|
887 | |
---|
888 | dnl restore initial values |
---|
889 | unset ac_cv_prog_gxx |
---|
890 | unset ac_cv_prog_cc_g |
---|
891 | unset ac_cv_prog_cxx_works |
---|
892 | unset ac_cv_prog_cxx_cross |
---|
893 | ]) |
---|
894 | |
---|
895 | AC_DEFUN(RTEMS_PROG_CXX_FOR_TARGET, |
---|
896 | [ |
---|
897 | RTEMS_PROG_CXX |
---|
898 | if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then |
---|
899 | AC_MSG_ERROR([***] |
---|
900 | [Inconsistency in compiler configuration:] |
---|
901 | [Target C compiler and Target C++ compiler] |
---|
902 | [must both either be cross compilers or native compilers] |
---|
903 | [Hint: If building a posix bsp: LD_LIBRARY_PATH?] ) |
---|
904 | fi |
---|
905 | ]) |
---|
906 | |
---|