source: rtems/aclocal.m4 @ 1ed9d57

4.104.114.84.95
Last change on this file since 1ed9d57 was 3108b76, checked in by Joel Sherrill <joel.sherrill@…>, on 03/25/99 at 01:02:33

Regenerated.

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