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