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