source: rtems/aclocal.m4 @ a37be5c4

4.104.114.84.95
Last change on this file since a37be5c4 was a37be5c4, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 6, 1999 at 8:25:40 PM

Eric Norum <eric@…> noticed that the documentation and
configure scripts did not match on the default value of --enable-tests.

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