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 | PROJECT_ROOT=`pwd`/$RTEMS_TOPdir; |
---|
31 | test "$TARGET_SUBDIR" = "." || PROJECT_ROOT="$PROJECT_ROOT/.." |
---|
32 | AC_SUBST(PROJECT_ROOT) |
---|
33 | |
---|
34 | dnl Determine RTEMS Version string from the VERSION file |
---|
35 | dnl Hopefully, Joel never changes its format ;- |
---|
36 | AC_MSG_CHECKING([for RTEMS Version]) |
---|
37 | if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then |
---|
38 | changequote(,)dnl |
---|
39 | RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \ |
---|
40 | sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'` |
---|
41 | changequote([,])dnl |
---|
42 | else |
---|
43 | AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION) |
---|
44 | fi |
---|
45 | if test -z "$RTEMS_VERSION"; then |
---|
46 | AC_MSG_ERROR(Unable to determine version) |
---|
47 | fi |
---|
48 | AC_MSG_RESULT($RTEMS_VERSION) |
---|
49 | |
---|
50 | RTEMS_ROOT='$(top_srcdir)'/$RTEMS_TOPdir; |
---|
51 | AC_SUBST(RTEMS_ROOT) |
---|
52 | ])dnl |
---|
53 | |
---|
54 | dnl $Id$ |
---|
55 | dnl |
---|
56 | dnl Note: This option is considered obsolete |
---|
57 | |
---|
58 | AC_DEFUN(RTEMS_ENABLE_GMAKE_PRINT, |
---|
59 | [ |
---|
60 | AC_ARG_ENABLE(gmake-print-directory, |
---|
61 | [ --enable-gmake-print-directory enable GNU Make's print directory], |
---|
62 | [case "${enableval}" in |
---|
63 | yes) RTEMS_USE_OWN_PDIR=no ;; |
---|
64 | no) RTEMS_USE_OWN_PDIR=yes ;; |
---|
65 | *) AC_MSG_ERROR(bad value ${enableval} for gmake-print-directory option) |
---|
66 | ;; |
---|
67 | esac],[RTEMS_USE_OWN_PDIR=yes]) |
---|
68 | AC_SUBST(RTEMS_USE_OWN_PDIR)dnl |
---|
69 | ]) |
---|
70 | |
---|
71 | dnl $Id$ |
---|
72 | |
---|
73 | AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING, |
---|
74 | [ |
---|
75 | AC_ARG_ENABLE(multiprocessing, |
---|
76 | [ --enable-multiprocessing enable multiprocessing interface], |
---|
77 | [case "${enableval}" in |
---|
78 | yes) RTEMS_HAS_MULTIPROCESSING=yes ;; |
---|
79 | no) RTEMS_HAS_MULTIPROCESSING=no ;; |
---|
80 | *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;; |
---|
81 | esac],[RTEMS_HAS_MULTIPROCESSING=no]) |
---|
82 | AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl |
---|
83 | ]) |
---|
84 | |
---|
85 | dnl $Id$ |
---|
86 | |
---|
87 | AC_DEFUN(RTEMS_ENABLE_POSIX, |
---|
88 | [ |
---|
89 | AC_ARG_ENABLE(posix, |
---|
90 | [ --enable-posix enable posix interface], |
---|
91 | [case "${enableval}" in |
---|
92 | yes) RTEMS_HAS_POSIX_API=yes ;; |
---|
93 | no) RTEMS_HAS_POSIX_API=no ;; |
---|
94 | *) AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;; |
---|
95 | esac],[RTEMS_HAS_POSIX_API=yes]) |
---|
96 | AC_SUBST(RTEMS_HAS_POSIX_API) |
---|
97 | |
---|
98 | changequote(,)dnl |
---|
99 | case "${target}" in |
---|
100 | # hpux unix port should go here |
---|
101 | i[3456]86-go32-rtems*) |
---|
102 | RTEMS_HAS_POSIX_API=no |
---|
103 | ;; |
---|
104 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
105 | RTEMS_HAS_POSIX_API=no |
---|
106 | ;; |
---|
107 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
108 | RTEMS_HAS_POSIX_API=no |
---|
109 | ;; |
---|
110 | no_cpu-*rtems*) |
---|
111 | RTEMS_HAS_POSIX_API=no |
---|
112 | ;; |
---|
113 | sparc-sun-solaris*) # unix "simulator" port |
---|
114 | RTEMS_HAS_POSIX_API=no |
---|
115 | ;; |
---|
116 | *) |
---|
117 | ;; |
---|
118 | esac |
---|
119 | changequote([,])dnl |
---|
120 | AC_SUBST(RTEMS_HAS_POSIX_API) |
---|
121 | ]) |
---|
122 | |
---|
123 | dnl $Id$ |
---|
124 | |
---|
125 | AC_DEFUN(RTEMS_ENABLE_NETWORKING, |
---|
126 | [ |
---|
127 | AC_ARG_ENABLE(networking, |
---|
128 | [ --enable-networking enable TCP/IP stack], |
---|
129 | [case "${enableval}" in |
---|
130 | yes) RTEMS_HAS_NETWORKING=yes ;; |
---|
131 | no) RTEMS_HAS_NETWORKING=no ;; |
---|
132 | *) AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;; |
---|
133 | esac],[RTEMS_HAS_NETWORKING=yes]) |
---|
134 | AC_SUBST(RTEMS_HAS_NETWORKING)dnl |
---|
135 | ]) |
---|
136 | |
---|
137 | dnl $Id$ |
---|
138 | |
---|
139 | AC_DEFUN(RTEMS_ENABLE_RDBG, |
---|
140 | [ |
---|
141 | AC_ARG_ENABLE(rdbg, |
---|
142 | [ --enable-rdbg enable remote debugger], |
---|
143 | [case "${enableval}" in |
---|
144 | yes) RTEMS_HAS_RDBG=yes ;; |
---|
145 | no) RTEMS_HAS_RDBG=no ;; |
---|
146 | *) AC_MSG_ERROR(bad value ${enableval} for enable-rdbg option) ;; |
---|
147 | esac],[RTEMS_HAS_RDBG=no]) |
---|
148 | AC_SUBST(RTEMS_HAS_RDBG)dnl |
---|
149 | ]) |
---|
150 | |
---|
151 | dnl $Id$ |
---|
152 | |
---|
153 | AC_DEFUN(RTEMS_ENABLE_INLINES, |
---|
154 | [AC_ARG_ENABLE(rtems-inlines, |
---|
155 | [ --enable-rtems-inlines enable RTEMS inline functions] |
---|
156 | [ (default:enabled, disable to use macros)], |
---|
157 | [case "${enableval}" in |
---|
158 | yes) RTEMS_USE_MACROS=no ;; |
---|
159 | no) RTEMS_USE_MACROS=yes ;; |
---|
160 | *) AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;; |
---|
161 | esac],[RTEMS_USE_MACROS=no]) |
---|
162 | AC_SUBST(RTEMS_USE_MACROS)dnl |
---|
163 | ]) |
---|
164 | |
---|
165 | dnl $Id$ |
---|
166 | |
---|
167 | AC_DEFUN(RTEMS_ENABLE_CXX, |
---|
168 | [ |
---|
169 | AC_ARG_ENABLE(cxx, |
---|
170 | [ --enable-cxx enable C++ support,] |
---|
171 | [ and build the rtems++ library], |
---|
172 | [case "${enableval}" in |
---|
173 | yes) RTEMS_HAS_CPLUSPLUS=yes ;; |
---|
174 | no) RTEMS_HAS_CPLUSPLUS=no ;; |
---|
175 | *) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;; |
---|
176 | esac], [RTEMS_HAS_CPLUSPLUS=no]) |
---|
177 | ]) |
---|
178 | |
---|
179 | dnl $Id$ |
---|
180 | |
---|
181 | AC_DEFUN(RTEMS_ENABLE_GCC28, |
---|
182 | [ |
---|
183 | AC_ARG_ENABLE(gcc28, |
---|
184 | [ --enable-gcc28 enable use of gcc 2.8.x features], |
---|
185 | [case "${enableval}" in |
---|
186 | yes) RTEMS_USE_GCC272=no ;; |
---|
187 | no) RTEMS_USE_GCC272=yes ;; |
---|
188 | *) AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;; |
---|
189 | esac],[RTEMS_USE_GCC272=no]) |
---|
190 | ]) |
---|
191 | |
---|
192 | dnl $Id$ |
---|
193 | |
---|
194 | AC_DEFUN(RTEMS_ENABLE_LIBCDIR, |
---|
195 | [ |
---|
196 | AC_ARG_ENABLE(libcdir, |
---|
197 | [ --enable-libcdir=directory set the directory for the C library], |
---|
198 | [ RTEMS_LIBC_DIR="${enableval}" ; \ |
---|
199 | test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] ) |
---|
200 | AC_SUBST(RTEMS_LIBC_DIR)dnl |
---|
201 | ]) |
---|
202 | |
---|
203 | AC_DEFUN(RTEMS_ENABLE_BARE, |
---|
204 | [ |
---|
205 | AC_ARG_ENABLE(bare-cpu-cflags, |
---|
206 | [ --enable-bare-cpu-cflags specify a particular cpu cflag] |
---|
207 | [ (bare bsp specific)], |
---|
208 | [case "${enableval}" in |
---|
209 | no) BARE_CPU_CFLAGS="" ;; |
---|
210 | *) BARE_CPU_CFLAGS="${enableval}" ;; |
---|
211 | esac], |
---|
212 | [BARE_CPU_CFLAGS=""]) |
---|
213 | |
---|
214 | AC_ARG_ENABLE(bare-cpu-model, |
---|
215 | [ --enable-bare-cpu-model specify a particular cpu model] |
---|
216 | [ (bare bsp specific)], |
---|
217 | [case "${enableval}" in |
---|
218 | no) BARE_CPU_MODEL="" ;; |
---|
219 | *) BARE_CPU_MODEL="${enableval}" ;; |
---|
220 | esac], |
---|
221 | [BARE_CPU_MODEL=""]) |
---|
222 | ]) |
---|
223 | |
---|
224 | |
---|
225 | dnl $Id$ |
---|
226 | |
---|
227 | AC_DEFUN(RTEMS_PATH_PERL, |
---|
228 | [ |
---|
229 | AC_PATH_PROG(PERL,perl) |
---|
230 | if test -z "$PERL" ; then |
---|
231 | AC_MSG_WARN( |
---|
232 | [***] |
---|
233 | [ perl was not found] |
---|
234 | [ Note: Some tools will not be built.]) |
---|
235 | fi |
---|
236 | ]) |
---|
237 | |
---|
238 | dnl |
---|
239 | dnl $Id$ |
---|
240 | dnl |
---|
241 | |
---|
242 | dnl macro to detect mkdir |
---|
243 | AC_DEFUN(RTEMS_PATH_MKDIR, |
---|
244 | [AC_PATH_PROG(MKDIR,mkdir) |
---|
245 | ]) |
---|
246 | |
---|
247 | dnl macro to check for mkdir -p |
---|
248 | AC_DEFUN(RTEMS_PROG_MKDIR_P, |
---|
249 | [ |
---|
250 | AC_REQUIRE([RTEMS_PATH_MKDIR]) |
---|
251 | AC_MSG_CHECKING([for working $MKDIR -p]) |
---|
252 | AC_CACHE_VAL(rtems_cv_prog_mkdir_p, |
---|
253 | [rm -rf conftestdata |
---|
254 | if $MKDIR -p conftestdata 2>/dev/null ;then |
---|
255 | rtems_cv_prog_MKDIR_P="yes" |
---|
256 | else |
---|
257 | rtems_cv_prog_MKDIR_P="no" |
---|
258 | fi])dnl |
---|
259 | rm -rf conftestdata |
---|
260 | AC_MSG_RESULT($rtems_cv_prog_MKDIR_P) |
---|
261 | ]) |
---|
262 | |
---|
263 | dnl macro to check for mkdir -m 0755 |
---|
264 | AC_DEFUN(RTEMS_PROG_MKDIR_M, |
---|
265 | [ |
---|
266 | AC_REQUIRE([RTEMS_PATH_MKDIR]) |
---|
267 | AC_MSG_CHECKING([for working $MKDIR -m 0755]) |
---|
268 | AC_CACHE_VAL(rtems_cv_prog_MKDIR_P, |
---|
269 | [rm -rf conftestdata |
---|
270 | if $MKDIR -m 0775 conftestdata 2>/dev/null; then |
---|
271 | rtems_cv_prog_MKDIR_M="yes" |
---|
272 | else |
---|
273 | rtems_cv_prog_MKDIR_M="no" |
---|
274 | fi])dnl |
---|
275 | rm -rf conftestdata |
---|
276 | AC_MSG_RESULT($rtems_cv_prog_MKDIR_M) |
---|
277 | ]) |
---|
278 | |
---|
279 | |
---|
280 | dnl $Id$ |
---|
281 | |
---|
282 | AC_DEFUN(RTEMS_PATH_KSH, |
---|
283 | [ |
---|
284 | dnl NOTE: prefer bash over ksh over sh |
---|
285 | AC_PATH_PROGS(KSH,bash ksh sh) |
---|
286 | if test -z "$KSH"; then |
---|
287 | dnl NOTE: This cannot happen -- /bin/sh must always exist |
---|
288 | AC_MSG_ERROR( |
---|
289 | [***] |
---|
290 | [ Cannot determine a usable shell bash/ksh/sh] |
---|
291 | [ Please contact your system administrator] ); |
---|
292 | fi |
---|
293 | ]) |
---|
294 | |
---|
295 | dnl |
---|
296 | dnl $Id$ |
---|
297 | dnl |
---|
298 | |
---|
299 | dnl canonicalize target cpu |
---|
300 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
301 | dnl target naming conventions "processor-vendor-os" |
---|
302 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
303 | dnl and we have to fix it for rtems ourselves |
---|
304 | |
---|
305 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
306 | [ |
---|
307 | AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
---|
308 | AC_MSG_CHECKING(rtems target cpu) |
---|
309 | changequote(,)dnl |
---|
310 | case "${target}" in |
---|
311 | # hpux unix port should go here |
---|
312 | i[3456]86-go32-rtems*) |
---|
313 | target_cpu=i386 |
---|
314 | ;; |
---|
315 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
316 | target_cpu=unix |
---|
317 | ;; |
---|
318 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
319 | target_cpu=unix |
---|
320 | ;; |
---|
321 | no_cpu-*rtems*) |
---|
322 | target_cpu=no_cpu |
---|
323 | ;; |
---|
324 | ppc*-*rtems*) |
---|
325 | target_cpu=powerpc |
---|
326 | ;; |
---|
327 | sparc-sun-solaris*) # unix "simulator" port |
---|
328 | target_cpu=unix |
---|
329 | ;; |
---|
330 | *) |
---|
331 | target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` |
---|
332 | ;; |
---|
333 | esac |
---|
334 | changequote([,])dnl |
---|
335 | AC_MSG_RESULT($target_cpu) |
---|
336 | ]) |
---|
337 | |
---|
338 | dnl $Id$ |
---|
339 | |
---|
340 | dnl check if RTEMS support a cpu |
---|
341 | AC_DEFUN(RTEMS_CHECK_CPU, |
---|
342 | [dnl |
---|
343 | AC_REQUIRE([RTEMS_TOP]) |
---|
344 | AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU]) |
---|
345 | # Is this a supported CPU? |
---|
346 | AC_MSG_CHECKING([if cpu $target_cpu is supported]) |
---|
347 | if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$target_cpu"; then |
---|
348 | AC_MSG_RESULT(yes) |
---|
349 | else |
---|
350 | AC_MSG_ERROR(no) |
---|
351 | fi |
---|
352 | ])dnl |
---|
353 | |
---|
354 | |
---|
355 | dnl $Id$ |
---|
356 | |
---|
357 | AC_DEFUN(RTEMS_CANONICAL_HOST, |
---|
358 | [dnl |
---|
359 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
360 | RTEMS_HOST=$host_os |
---|
361 | changequote(,)dnl |
---|
362 | case "${target}" in |
---|
363 | # hpux unix port should go here |
---|
364 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
365 | RTEMS_HOST=Linux |
---|
366 | ;; |
---|
367 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
368 | RTEMS_HOST=FreeBSD |
---|
369 | ;; |
---|
370 | sparc-sun-solaris*) # unix "simulator" port |
---|
371 | RTEMS_HOST=Solaris |
---|
372 | ;; |
---|
373 | *) |
---|
374 | ;; |
---|
375 | esac |
---|
376 | changequote([,])dnl |
---|
377 | AC_SUBST(RTEMS_HOST) |
---|
378 | ])dnl |
---|
379 | |
---|
380 | dnl |
---|
381 | dnl $Id$ |
---|
382 | dnl |
---|
383 | dnl Set program_prefix |
---|
384 | dnl |
---|
385 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
386 | dnl Extracted from configure |
---|
387 | |
---|
388 | AC_DEFUN(RTEMS_TOOL_PREFIX, |
---|
389 | [AC_REQUIRE([AC_CANONICAL_TARGET])dnl |
---|
390 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
391 | |
---|
392 | if [[ "${program_prefix}" = "NONE" ]] ; then |
---|
393 | if [[ "${target}" = "${host}" ]] ; then |
---|
394 | program_prefix= |
---|
395 | else |
---|
396 | program_prefix=${target}- |
---|
397 | fi |
---|
398 | fi |
---|
399 | ]) |
---|
400 | |
---|
401 | dnl |
---|
402 | dnl $Id$ |
---|
403 | dnl |
---|
404 | dnl Check for target gcc |
---|
405 | dnl |
---|
406 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
407 | dnl Completely reworked |
---|
408 | |
---|
409 | AC_DEFUN(RTEMS_PROG_CC, |
---|
410 | [ |
---|
411 | AC_BEFORE([$0], [AC_PROG_CPP])dnl |
---|
412 | AC_BEFORE([$0], [AC_PROG_CC])dnl |
---|
413 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
414 | |
---|
415 | dnl Only accept gcc and cc |
---|
416 | dnl NOTE: This might be too restrictive for native compilation |
---|
417 | AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc ) |
---|
418 | test -z "$CC_FOR_TARGET" \ |
---|
419 | && AC_MSG_ERROR([no acceptable cc found in \$PATH]) |
---|
420 | |
---|
421 | dnl backup |
---|
422 | rtems_save_CC=$CC |
---|
423 | rtems_save_CFLAGS=$CFLAGS |
---|
424 | |
---|
425 | dnl temporarily set CC |
---|
426 | CC=$CC_FOR_TARGET |
---|
427 | |
---|
428 | AC_PROG_CC_WORKS |
---|
429 | AC_PROG_CC_GNU |
---|
430 | |
---|
431 | if test $ac_cv_prog_gcc = yes; then |
---|
432 | GCC=yes |
---|
433 | dnl Check whether -g works, even if CFLAGS is set, in case the package |
---|
434 | dnl plays around with CFLAGS (such as to build both debugging and |
---|
435 | dnl normal versions of a library), tasteless as that idea is. |
---|
436 | ac_test_CFLAGS="${CFLAGS+set}" |
---|
437 | ac_save_CFLAGS="$CFLAGS" |
---|
438 | CFLAGS= |
---|
439 | AC_PROG_CC_G |
---|
440 | if test "$ac_test_CFLAGS" = set; then |
---|
441 | CFLAGS="$ac_save_CFLAGS" |
---|
442 | elif test $ac_cv_prog_cc_g = yes; then |
---|
443 | CFLAGS="-g -O2" |
---|
444 | else |
---|
445 | CFLAGS="-O2" |
---|
446 | fi |
---|
447 | else |
---|
448 | GCC= |
---|
449 | test "${CFLAGS+set}" = set || CFLAGS="-g" |
---|
450 | fi |
---|
451 | |
---|
452 | rtems_cv_prog_gcc=$ac_cv_prog_gcc |
---|
453 | rtems_cv_prog_cc_g=$ac_cv_prog_cc_g |
---|
454 | rtems_cv_prog_cc_works=$ac_cv_prog_cc_works |
---|
455 | rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross |
---|
456 | |
---|
457 | dnl restore initial values |
---|
458 | CC=$rtems_save_CC |
---|
459 | CFLAGS=$rtems_save_CFLAGS |
---|
460 | |
---|
461 | unset ac_cv_prog_gcc |
---|
462 | unset ac_cv_prog_cc_g |
---|
463 | unset ac_cv_prog_cc_works |
---|
464 | unset ac_cv_prog_cc_cross |
---|
465 | ]) |
---|
466 | |
---|
467 | dnl |
---|
468 | dnl $Id$ |
---|
469 | dnl |
---|
470 | dnl Check whether the target compiler accepts -specs |
---|
471 | dnl |
---|
472 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
473 | dnl |
---|
474 | |
---|
475 | AC_DEFUN(RTEMS_GCC_SPECS, |
---|
476 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
477 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs, |
---|
478 | [ |
---|
479 | rtems_cv_gcc_specs=no |
---|
480 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
481 | touch confspec |
---|
482 | echo 'void f(){}' >conftest.c |
---|
483 | if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then |
---|
484 | rtems_cv_gcc_specs=yes |
---|
485 | fi |
---|
486 | fi |
---|
487 | rm -f confspec conftest* |
---|
488 | ])]) |
---|
489 | |
---|
490 | dnl |
---|
491 | dnl $Id$ |
---|
492 | dnl |
---|
493 | dnl Check whether the target compiler accepts -pipe |
---|
494 | dnl |
---|
495 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
496 | dnl |
---|
497 | |
---|
498 | AC_DEFUN(RTEMS_GCC_PIPE, |
---|
499 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
500 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
501 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe, |
---|
502 | [ |
---|
503 | rtems_cv_gcc_pipe=no |
---|
504 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
505 | case "$host_os" in |
---|
506 | cygwin32*) |
---|
507 | ;; |
---|
508 | *) |
---|
509 | echo 'void f(){}' >conftest.c |
---|
510 | if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then |
---|
511 | rtems_cv_gcc_pipe=yes |
---|
512 | fi |
---|
513 | rm -f conftest* |
---|
514 | ;; |
---|
515 | esac |
---|
516 | fi |
---|
517 | ]) |
---|
518 | ]) |
---|
519 | |
---|
520 | dnl |
---|
521 | dnl $Id$ |
---|
522 | dnl |
---|
523 | dnl Check for target g++ |
---|
524 | dnl |
---|
525 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
526 | dnl Completely reworked |
---|
527 | |
---|
528 | AC_DEFUN(RTEMS_PROG_CXX, |
---|
529 | [ |
---|
530 | AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl |
---|
531 | AC_BEFORE([$0], [AC_PROG_CXX])dnl |
---|
532 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
533 | |
---|
534 | dnl Only accept g++ and c++ |
---|
535 | dnl NOTE: This might be too restrictive for native compilation |
---|
536 | AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++) |
---|
537 | test -z "$CXX_FOR_TARGET" \ |
---|
538 | && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) |
---|
539 | |
---|
540 | dnl backup |
---|
541 | rtems_save_CXX=$CXX |
---|
542 | rtems_save_CXXFLAGS=$CXXFLAGS |
---|
543 | |
---|
544 | dnl temporarily set CXX |
---|
545 | CXX=$CXX_FOR_TARGET |
---|
546 | |
---|
547 | AC_PROG_CXX_WORKS |
---|
548 | AC_PROG_CXX_GNU |
---|
549 | |
---|
550 | if test $ac_cv_prog_gxx = yes; then |
---|
551 | GXX=yes |
---|
552 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package |
---|
553 | dnl plays around with CXXFLAGS (such as to build both debugging and |
---|
554 | dnl normal versions of a library), tasteless as that idea is. |
---|
555 | ac_test_CXXFLAGS="${CXXFLAGS+set}" |
---|
556 | ac_save_CXXFLAGS="$CXXFLAGS" |
---|
557 | CXXFLAGS= |
---|
558 | AC_PROG_CXX_G |
---|
559 | if test "$ac_test_CXXFLAGS" = set; then |
---|
560 | CXXFLAGS="$ac_save_CXXFLAGS" |
---|
561 | elif test $ac_cv_prog_cxx_g = yes; then |
---|
562 | CXXFLAGS="-g -O2" |
---|
563 | else |
---|
564 | CXXFLAGS="-O2" |
---|
565 | fi |
---|
566 | else |
---|
567 | GXX= |
---|
568 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" |
---|
569 | fi |
---|
570 | |
---|
571 | rtems_cv_prog_gxx=$ac_cv_prog_gxx |
---|
572 | rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g |
---|
573 | rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works |
---|
574 | rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross |
---|
575 | |
---|
576 | CXX=$rtems_save_CXX |
---|
577 | CXXFLAGS=$rtems_save_CXXFLAGS |
---|
578 | |
---|
579 | dnl restore initial values |
---|
580 | unset ac_cv_prog_gxx |
---|
581 | unset ac_cv_prog_cc_g |
---|
582 | unset ac_cv_prog_cxx_works |
---|
583 | unset ac_cv_prog_cxx_cross |
---|
584 | ]) |
---|
585 | |
---|
586 | dnl |
---|
587 | dnl $Id$ |
---|
588 | dnl |
---|
589 | dnl Set target tools |
---|
590 | dnl |
---|
591 | dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
592 | dnl fixing cache/environment variable handling |
---|
593 | dnl adding checks for cygwin/egcs '\\'-bug |
---|
594 | dnl adding checks for ranlib/ar -s problem |
---|
595 | dnl |
---|
596 | dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
597 | dnl |
---|
598 | |
---|
599 | AC_DEFUN(RTEMS_GCC_PRINT, |
---|
600 | [ case $host_os in |
---|
601 | *cygwin32*) |
---|
602 | dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/' |
---|
603 | dnl Should be removed once cygwin/egcs reports '/' only |
---|
604 | $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' ` |
---|
605 | ;; |
---|
606 | *) |
---|
607 | $1=`$CC_FOR_TARGET --print-prog-name=$2` |
---|
608 | ;; |
---|
609 | esac |
---|
610 | ]) |
---|
611 | |
---|
612 | AC_DEFUN(RTEMS_PATH_TOOL, |
---|
613 | [ |
---|
614 | AC_MSG_CHECKING([target's $2]) |
---|
615 | AC_CACHE_VAL(ac_cv_path_$1,:) |
---|
616 | AC_MSG_RESULT([$ac_cv_path_$1]) |
---|
617 | |
---|
618 | if test -n "$ac_cv_path_$1"; then |
---|
619 | dnl retrieve the value from the cache |
---|
620 | $1=$ac_cv_path_$1 |
---|
621 | else |
---|
622 | dnl the cache was not set |
---|
623 | if test -z "[$]$1" ; then |
---|
624 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
625 | # We are using gcc, ask it about its tool |
---|
626 | # NOTE: Necessary if gcc was configured to use the target's |
---|
627 | # native tools or uses prefixes for gnutools (e.g. gas instead of as) |
---|
628 | RTEMS_GCC_PRINT($1,$2) |
---|
629 | fi |
---|
630 | else |
---|
631 | # The user set an environment variable. |
---|
632 | # Check whether it is an absolute path, otherwise AC_PATH_PROG |
---|
633 | # will override the environment variable, which isn't what the user |
---|
634 | # intends |
---|
635 | AC_MSG_CHECKING([whether environment variable $1 is an absolute path]) |
---|
636 | case "[$]$1" in |
---|
637 | /*) # valid |
---|
638 | AC_MSG_RESULT("yes") |
---|
639 | ;; |
---|
640 | *) # invalid for AC_PATH_PROG |
---|
641 | AC_MSG_RESULT("no") |
---|
642 | AC_MSG_ERROR([***] |
---|
643 | [Environment variable $1 should either] |
---|
644 | [be unset (preferred) or contain an absolute path]) |
---|
645 | ;; |
---|
646 | esac |
---|
647 | fi |
---|
648 | |
---|
649 | AC_PATH_PROG($1,"$program_prefix"$2,$3) |
---|
650 | fi |
---|
651 | ]) |
---|
652 | |
---|
653 | AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, |
---|
654 | [AC_REQUIRE([RTEMS_PROG_CC])dnl |
---|
655 | |
---|
656 | dnl FIXME: What shall be done if these tools are not available? |
---|
657 | RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no) |
---|
658 | RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no) |
---|
659 | RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no) |
---|
660 | RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no) |
---|
661 | |
---|
662 | dnl special treatment of ranlib |
---|
663 | RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no) |
---|
664 | if test "$RANLIB_FOR_TARGET" = "no"; then |
---|
665 | # ranlib wasn't found; check if ar -s is available |
---|
666 | RTEMS_AR_FOR_TARGET_S |
---|
667 | if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then |
---|
668 | dnl override RANLIB_FOR_TARGET's cache |
---|
669 | ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s" |
---|
670 | RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET |
---|
671 | else |
---|
672 | AC_MSG_ERROR([***] |
---|
673 | [Can't figure out how to build a library index] |
---|
674 | [Neither ranlib nor ar -s seem to be available] ) |
---|
675 | fi |
---|
676 | fi |
---|
677 | |
---|
678 | dnl NOTE: These may not be available if not using gnutools |
---|
679 | RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no) |
---|
680 | RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no) |
---|
681 | RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no) |
---|
682 | ]) |
---|
683 | |
---|
684 | dnl |
---|
685 | dnl $Id$ |
---|
686 | dnl |
---|
687 | |
---|
688 | AC_DEFUN(RTEMS_AR_FOR_TARGET_S, |
---|
689 | [ |
---|
690 | AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works, |
---|
691 | rtems_cv_AR_FOR_TARGET_S, |
---|
692 | [ |
---|
693 | cat > conftest.$ac_ext <<EOF |
---|
694 | int foo( int b ) |
---|
695 | { return b; } |
---|
696 | EOF |
---|
697 | if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \ |
---|
698 | && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \ |
---|
699 | && test -s conftest.a ; \ |
---|
700 | then |
---|
701 | rtems_cv_AR_FOR_TARGET_S="yes" |
---|
702 | else |
---|
703 | rtems_cv_AR_FOR_TARGET_S="no" |
---|
704 | fi |
---|
705 | rm -f conftest* |
---|
706 | ]) |
---|
707 | ]) |
---|
708 | |
---|
709 | |
---|
710 | dnl |
---|
711 | dnl $Id$ |
---|
712 | dnl |
---|
713 | |
---|
714 | dnl check for i386 gas supporting 16 bit mode |
---|
715 | dnl - binutils 2.9.1.0.7 and higher |
---|
716 | |
---|
717 | AC_DEFUN(RTEMS_I386_GAS_CODE16, |
---|
718 | [ if test "${target_cpu}" = "i386"; then |
---|
719 | AC_CACHE_CHECK([for 16 bit mode assembler support], |
---|
720 | rtems_cv_prog_gas_code16, |
---|
721 | [cat > conftest.s << EOF |
---|
722 | .code16 |
---|
723 | data32 |
---|
724 | addr32 |
---|
725 | lgdt 0 |
---|
726 | EOF |
---|
727 | if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then |
---|
728 | rtems_cv_prog_gas_code16=yes |
---|
729 | else |
---|
730 | rtems_cv_prog_gas_code16=no |
---|
731 | fi]) |
---|
732 | RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16" |
---|
733 | fi |
---|
734 | AC_SUBST(RTEMS_GAS_CODE16) |
---|
735 | ]) |
---|
736 | |
---|
737 | |
---|
738 | dnl |
---|
739 | dnl $Id$ |
---|
740 | dnl |
---|
741 | dnl Check for System V IPC calls used by Unix simulators |
---|
742 | dnl |
---|
743 | dnl 98/07/17 Dario Alcocer alcocer@netcom.com |
---|
744 | dnl Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
745 | dnl |
---|
746 | dnl Note: $host_os should probably *not* ever be used here to |
---|
747 | dnl determine if host supports System V IPC calls, since some |
---|
748 | dnl (e.g. FreeBSD 2.x) are configured by default to include only |
---|
749 | dnl a subset of the System V IPC calls. Therefore, to make sure |
---|
750 | dnl all of the required calls are found, test for each call explicitly. |
---|
751 | dnl |
---|
752 | dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally |
---|
753 | dnl modify any existing key sets. See the man pages for semget, shmget, |
---|
754 | dnl msgget, semctl, shmctl and msgctl for details. |
---|
755 | |
---|
756 | AC_DEFUN(RTEMS_SYSV_SEM, |
---|
757 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
758 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
759 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores, |
---|
760 | rtems_cv_sysv_sem, |
---|
761 | [ |
---|
762 | AC_TRY_RUN([ |
---|
763 | #include <sys/types.h> |
---|
764 | #include <sys/ipc.h> |
---|
765 | #include <sys/sem.h> |
---|
766 | int main () { |
---|
767 | #if !defined(sun) |
---|
768 | union semun arg ; |
---|
769 | #else |
---|
770 | union semun { |
---|
771 | int val; |
---|
772 | struct semid_ds *buf; |
---|
773 | ushort *array; |
---|
774 | } arg; |
---|
775 | #endif |
---|
776 | int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400); |
---|
777 | if (id == -1) |
---|
778 | exit(1); |
---|
779 | arg.val = 0; /* avoid implicit type cast to union */ |
---|
780 | if (semctl(id, 0, IPC_RMID, arg) == -1) |
---|
781 | exit(1); |
---|
782 | exit(0); |
---|
783 | } |
---|
784 | ], |
---|
785 | rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :) |
---|
786 | ]) |
---|
787 | ]) |
---|
788 | |
---|
789 | AC_DEFUN(RTEMS_SYSV_SHM, |
---|
790 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
791 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
792 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory, |
---|
793 | rtems_cv_sysv_shm, |
---|
794 | [ |
---|
795 | AC_TRY_RUN([ |
---|
796 | #include <sys/types.h> |
---|
797 | #include <sys/ipc.h> |
---|
798 | #include <sys/shm.h> |
---|
799 | int main () { |
---|
800 | int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400); |
---|
801 | if (id == -1) |
---|
802 | exit(1); |
---|
803 | if (shmctl(id, IPC_RMID, 0) == -1) |
---|
804 | exit(1); |
---|
805 | exit(0); |
---|
806 | } |
---|
807 | ], |
---|
808 | rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :) |
---|
809 | ]) |
---|
810 | ]) |
---|
811 | |
---|
812 | AC_DEFUN(RTEMS_SYSV_MSG, |
---|
813 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
814 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
815 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages, |
---|
816 | rtems_cv_sysv_msg, |
---|
817 | [ |
---|
818 | AC_TRY_RUN([ |
---|
819 | #include <sys/types.h> |
---|
820 | #include <sys/ipc.h> |
---|
821 | #include <sys/msg.h> |
---|
822 | int main () { |
---|
823 | int id=msgget(IPC_PRIVATE,IPC_CREAT|0400); |
---|
824 | if (id == -1) |
---|
825 | exit(1); |
---|
826 | if (msgctl(id, IPC_RMID, 0) == -1) |
---|
827 | exit(1); |
---|
828 | exit(0); |
---|
829 | } |
---|
830 | ], |
---|
831 | rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :) |
---|
832 | ]) |
---|
833 | ]) |
---|
834 | |
---|
835 | dnl |
---|
836 | dnl $Id$ |
---|
837 | dnl |
---|
838 | |
---|
839 | dnl RTEMS_CHECK_MAKEFILE(path) |
---|
840 | dnl Search for Makefile.in's within the directory starting |
---|
841 | dnl at path and append an entry for Makefile to global variable |
---|
842 | dnl "makefiles" (from configure.in) for each Makefile.in found |
---|
843 | dnl |
---|
844 | AC_DEFUN(RTEMS_CHECK_MAKEFILE, |
---|
845 | [RTEMS_CHECK_FILES_IN($1,Makefile,makefiles) |
---|
846 | ]) |
---|
847 | |
---|
848 | dnl |
---|
849 | dnl $Id$ |
---|
850 | dnl |
---|
851 | |
---|
852 | dnl RTEMS_CHECK_FILES_IN(path,file,var) |
---|
853 | dnl path .. path relative to srcdir, where to start searching for files |
---|
854 | dnl file .. name of the files to search for |
---|
855 | dnl var .. shell variable to append files found |
---|
856 | |
---|
857 | AC_DEFUN(RTEMS_CHECK_FILES_IN, |
---|
858 | [ |
---|
859 | AC_MSG_CHECKING(for $2.in in $1) |
---|
860 | if test -d $srcdir/$1; then |
---|
861 | rtems_av_save_dir=`pwd`; |
---|
862 | cd $srcdir; |
---|
863 | rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"` |
---|
864 | $3="$$3 $rtems_av_tmp"; |
---|
865 | cd $rtems_av_save_dir; |
---|
866 | AC_MSG_RESULT(done) |
---|
867 | else |
---|
868 | AC_MSG_RESULT(no) |
---|
869 | fi |
---|
870 | ]) |
---|
871 | |
---|
872 | |
---|
873 | dnl $Id$ |
---|
874 | |
---|
875 | AC_DEFUN(RTEMS_ENABLE_TESTS, |
---|
876 | [ |
---|
877 | # If the tests are enabled, then find all the test suite Makefiles |
---|
878 | AC_MSG_CHECKING([if the test suites are enabled? ]) |
---|
879 | tests_enabled=no |
---|
880 | AC_ARG_ENABLE(tests, |
---|
881 | [ --enable-tests enable tests (default:disabled)], |
---|
882 | [case "${enableval}" in |
---|
883 | yes) AC_MSG_RESULT(yes) ;; |
---|
884 | no) AC_MSG_RESULT(no) ; tests_enabled=no ;; |
---|
885 | *) AC_MSG_ERROR(bad value ${enableval} for tests option) ;; |
---|
886 | esac], AC_MSG_RESULT(no)) |
---|
887 | ]) |
---|
888 | |
---|
889 | dnl $Id$ |
---|
890 | dnl |
---|
891 | dnl FIXME: this needs to be reworked |
---|
892 | |
---|
893 | AC_DEFUN(RTEMS_ENABLE_HWAPI, |
---|
894 | [dnl |
---|
895 | AC_ARG_ENABLE(hwapi, \ |
---|
896 | [ --enable-hwapi enable hardware API library], |
---|
897 | [case "${enableval}" in |
---|
898 | yes) RTEMS_HAS_HWAPI=yes ;; |
---|
899 | no) RTEMS_HAS_HWAPI=no ;; |
---|
900 | *) AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;; |
---|
901 | esac],[RTEMS_HAS_HWAPI=no]) |
---|
902 | AC_SUBST(RTEMS_HAS_HWAPI)dnl |
---|
903 | ])dnl |
---|
904 | |
---|