source: rtems/aclocal.m4 @ 8cdb582

4.104.114.84.95
Last change on this file since 8cdb582 was 8cdb582, checked in by Joel Sherrill <joel.sherrill@…>, on 04/12/99 at 15:41:33

Patch from Ralf Corsepius <corsepiu@…>:

This patch addresses a few minor issues and contains a few (minor)
preparations for automake.

  • configure.in: Fix for handing c/src/tests subdirectory handling (FIX)
  • aclocal/rtems-top.m4: + Add TARGET_SUBDIR and --with-target-subdir (preparation of future

enhancements for cross-compiling)

+ Activate RTEMS_ROOT handling (automake preparation)

  • automake/*.am: replace comments "#" with "##" so that comments won't get included into Makefile.in's anymore
  • c/update-tools/* automake support (NEW)
  • ./autogen update/enhancement (cf. ./autogen for details)

After applying this patch please run:

./autogen
cvs add c/update-tools/configure.in
cvs add c/update-tools/Makefile.am
cvs add c/update-tools/aclocal.m4

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