source: rtems/aclocal.m4 @ 93180ea2

4.104.114.84.95
Last change on this file since 93180ea2 was 8c92fa3, checked in by Joel Sherrill <joel.sherrill@…>, on 06/16/99 at 14:55:28

Patcg from Ralf Corsepius <corsepiu@…>:

-- configure now fails to detect the toolchain for linux-posix.

As work-around, I have reverted to the old behavior of RTEMS_TARGET_CPU_NAME,
thus no_cpu/no_bsp will fail badly in configure again.

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