source: rtems/aclocal.m4 @ 196094eb

4.104.114.84.95
Last change on this file since 196094eb was 6b7ab9bf, checked in by Joel Sherrill <joel.sherrill@…>, on 04/16/99 at 18:23:48

Patch from Ralf Corsepius <corsepiu@…>:

FYI: I am not talking about using "make -C <dir>", which probably
is much faster on M$ hosts than RTEMS's implementation, but about
removing --enable-gmake-print support and to apply a variant of
automake's subdirectory.

Automake's subdirectory rule seems to be a little bit faster, but I
wouldn't bet on this.

Attached to this mail is my proposal.

After applying the patch, please run

cvs rm aclocal/enable-gmake-print.m4
./autogen

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