source: rtems/c/src/exec/aclocal.m4 @ 3a8915e

4.104.114.84.95
Last change on this file since 3a8915e was 3a8915e, checked in by Joel Sherrill <joel.sherrill@…>, on 08/06/99 at 17:55:25

Patch rtems-rc-19990709-6-diff from Ralf Corsepius <corsepiu@…>
applied. This modified many Makefiles and custom files and makes many more
settings (network, multiprocessing, etc) gnerated by autoconf.

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