source: rtems/aclocal.m4 @ c9b07e92

4.104.114.84.95
Last change on this file since c9b07e92 was c9b07e92, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 24, 1999 at 10:49:17 PM

Automake II patch from Ralf Corsepius <corsepiu@…>:

With my most recent automake patch (automake II) we could even simplify more
files below make/, because the host-compiler related parts of those files
aren't used anymore :-.

Whatsoever, the patch below should fix this problem.

Note: This is a mere bug fix, it doesn't move any of the variables involved
to target.cfg nor does it try to eliminate any variable.

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