source: rtems/c/src/make/aclocal.m4 @ 3a8915e

4.104.114.84.95
Last change on this file since 3a8915e was 3a8915e, checked in by Joel Sherrill <joel.sherrill@…>, on 08/06/99 at 17:55:25

Patch rtems-rc-19990709-6-diff from Ralf Corsepius <corsepiu@…>
applied. This modified many Makefiles and custom files and makes many more
settings (network, multiprocessing, etc) gnerated by autoconf.

  • Property mode set to 100644
File size: 25.3 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
30dnl Determine RTEMS Version string from the VERSION file
31dnl Hopefully, Joel never changes its format ;-
32AC_MSG_CHECKING([for RTEMS Version])
33if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
34changequote(,)dnl
35RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \
36sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
37changequote([,])dnl
38else
39AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
40fi
41if test -z "$RTEMS_VERSION"; then
42AC_MSG_ERROR(Unable to determine version)
43fi
44AC_MSG_RESULT($RTEMS_VERSION)
45])dnl
46
47dnl
48dnl $Id$
49dnl
50
51dnl canonicalize target cpu
52dnl NOTE: Most rtems targets do not fullfil autoconf's
53dnl target naming conventions "processor-vendor-os"
54dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
55dnl and we have to fix it for rtems ourselves
56
57AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
58[
59AC_CANONICAL_SYSTEM
60AC_MSG_CHECKING(rtems target cpu)
61changequote(,)dnl
62case "${target}" in
63  # hpux unix port should go here
64  i[3456]86-go32-rtems*)
65        RTEMS_CPU=i386
66        ;;
67  i[3456]86-pc-linux*)          # unix "simulator" port
68        RTEMS_CPU=unix
69        ;;
70  i[3456]86-*freebsd2*)         # unix "simulator" port
71        RTEMS_CPU=unix
72        ;;
73  no_cpu-*rtems*)
74        RTEMS_CPU=no_cpu
75        ;;
76  sparc-sun-solaris*)           # unix "simulator" port
77        RTEMS_CPU=unix
78        ;;
79  *)
80        RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
81        ;;
82esac
83changequote([,])dnl
84AC_SUBST(RTEMS_CPU)
85AC_MSG_RESULT($RTEMS_CPU)
86])
87
88# Do all the work for Automake.  This macro actually does too much --
89# some checks are only needed if your package does certain things.
90# But this isn't really a big deal.
91
92# serial 1
93
94dnl Usage:
95dnl AM_INIT_AUTOMAKE(package,version, [no-define])
96
97AC_DEFUN(AM_INIT_AUTOMAKE,
98[AC_REQUIRE([AC_PROG_INSTALL])
99PACKAGE=[$1]
100AC_SUBST(PACKAGE)
101VERSION=[$2]
102AC_SUBST(VERSION)
103dnl test to see if srcdir already configured
104if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
105  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
106fi
107ifelse([$3],,
108AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
109AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
110AC_REQUIRE([AM_SANITY_CHECK])
111AC_REQUIRE([AC_ARG_PROGRAM])
112dnl FIXME This is truly gross.
113missing_dir=`cd $ac_aux_dir && pwd`
114AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
115AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
116AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
117AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
118AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
119AC_REQUIRE([AC_PROG_MAKE_SET])])
120
121#
122# Check to make sure that the build environment is sane.
123#
124
125AC_DEFUN(AM_SANITY_CHECK,
126[AC_MSG_CHECKING([whether build environment is sane])
127# Just in case
128sleep 1
129echo timestamp > conftestfile
130# Do `set' in a subshell so we don't clobber the current shell's
131# arguments.  Must try -L first in case configure is actually a
132# symlink; some systems play weird games with the mod time of symlinks
133# (eg FreeBSD returns the mod time of the symlink's containing
134# directory).
135if (
136   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
137   if test "[$]*" = "X"; then
138      # -L didn't work.
139      set X `ls -t $srcdir/configure conftestfile`
140   fi
141   if test "[$]*" != "X $srcdir/configure conftestfile" \
142      && test "[$]*" != "X conftestfile $srcdir/configure"; then
143
144      # If neither matched, then we have a broken ls.  This can happen
145      # if, for instance, CONFIG_SHELL is bash and it inherits a
146      # broken ls alias from the environment.  This has actually
147      # happened.  Such a system could not be considered "sane".
148      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
149alias in your environment])
150   fi
151
152   test "[$]2" = conftestfile
153   )
154then
155   # Ok.
156   :
157else
158   AC_MSG_ERROR([newly created file is older than distributed files!
159Check your system clock])
160fi
161rm -f conftest*
162AC_MSG_RESULT(yes)])
163
164dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
165dnl The program must properly implement --version.
166AC_DEFUN(AM_MISSING_PROG,
167[AC_MSG_CHECKING(for working $2)
168# Run test in a subshell; some versions of sh will print an error if
169# an executable is not found, even if stderr is redirected.
170# Redirect stdin to placate older versions of autoconf.  Sigh.
171if ($2 --version) < /dev/null > /dev/null 2>&1; then
172   $1=$2
173   AC_MSG_RESULT(found)
174else
175   $1="$3/missing $2"
176   AC_MSG_RESULT(missing)
177fi
178AC_SUBST($1)])
179
180# Add --enable-maintainer-mode option to configure.
181# From Jim Meyering
182
183# serial 1
184
185AC_DEFUN(AM_MAINTAINER_MODE,
186[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
187  dnl maintainer-mode is disabled by default
188  AC_ARG_ENABLE(maintainer-mode,
189[  --enable-maintainer-mode enable make rules and dependencies not useful
190                          (and sometimes confusing) to the casual installer],
191      USE_MAINTAINER_MODE=$enableval,
192      USE_MAINTAINER_MODE=no)
193  AC_MSG_RESULT($USE_MAINTAINER_MODE)
194  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
195  MAINT=$MAINTAINER_MODE_TRUE
196  AC_SUBST(MAINT)dnl
197]
198)
199
200# Define a conditional.
201
202AC_DEFUN(AM_CONDITIONAL,
203[AC_SUBST($1_TRUE)
204AC_SUBST($1_FALSE)
205if $2; then
206  $1_TRUE=
207  $1_FALSE='#'
208else
209  $1_TRUE='#'
210  $1_FALSE=
211fi])
212
213dnl $Id$
214
215AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING,
216[
217AC_ARG_ENABLE(multiprocessing,
218[  --enable-multiprocessing             enable multiprocessing interface],
219[case "${enableval}" in
220  yes) RTEMS_HAS_MULTIPROCESSING=yes ;;
221  no) RTEMS_HAS_MULTIPROCESSING=no ;;
222  *)  AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
223esac],[RTEMS_HAS_MULTIPROCESSING=no])
224AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl
225])
226
227dnl $Id$
228
229AC_DEFUN(RTEMS_ENABLE_POSIX,
230[
231AC_ARG_ENABLE(posix,
232[  --enable-posix                       enable posix interface],
233[case "${enableval}" in
234  yes) RTEMS_HAS_POSIX_API=yes ;;
235  no) RTEMS_HAS_POSIX_API=no ;;
236  *)  AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
237esac],[RTEMS_HAS_POSIX_API=yes])
238AC_SUBST(RTEMS_HAS_POSIX_API)
239
240changequote(,)dnl
241case "${target}" in
242  # hpux unix port should go here
243  i[3456]86-go32-rtems*)
244        RTEMS_HAS_POSIX_API=no
245        ;;
246  i[3456]86-pc-linux*)         # unix "simulator" port
247        RTEMS_HAS_POSIX_API=no
248        ;;
249  i[3456]86-*freebsd2*) # unix "simulator" port
250        RTEMS_HAS_POSIX_API=no
251        ;;
252  no_cpu-*rtems*)
253        RTEMS_HAS_POSIX_API=no
254        ;;
255  sparc-sun-solaris*)             # unix "simulator" port
256        RTEMS_HAS_POSIX_API=no
257        ;;
258  *)
259        ;;
260esac
261changequote([,])dnl
262AC_SUBST(RTEMS_HAS_POSIX_API)
263])
264
265dnl $Id$
266
267AC_DEFUN(RTEMS_ENABLE_NETWORKING,
268[
269AC_ARG_ENABLE(networking,
270[  --enable-networking                  enable TCP/IP stack],
271[case "${enableval}" in
272  yes) RTEMS_HAS_NETWORKING=yes ;;
273  no) RTEMS_HAS_NETWORKING=no ;;
274  *)  AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;;
275esac],[RTEMS_HAS_NETWORKING=yes])
276AC_SUBST(RTEMS_HAS_NETWORKING)dnl
277])
278
279dnl $Id$
280
281AC_DEFUN(RTEMS_ENABLE_RDBG,
282[
283AC_ARG_ENABLE(rdbg,
284[  --enable-rdbg                        enable remote debugger],
285[case "${enableval}" in
286  yes) RTEMS_HAS_RDBG=yes ;;
287  no) RTEMS_HAS_RDBG=no ;;
288  *)  AC_MSG_ERROR(bad value ${enableval} for enable-rdbg option) ;;
289esac],[RTEMS_HAS_RDBG=no])
290AC_SUBST(RTEMS_HAS_RDBG)dnl
291])
292
293dnl $Id$
294
295AC_DEFUN(RTEMS_ENABLE_INLINES,
296[AC_ARG_ENABLE(rtems-inlines,
297[  --enable-rtems-inlines               enable RTEMS inline functions]
298[                                       (default:enabled, disable to use macros)],
299[case "${enableval}" in
300  yes) RTEMS_USE_MACROS=no ;;
301  no) RTEMS_USE_MACROS=yes ;;
302  *)  AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
303esac],[RTEMS_USE_MACROS=no])
304AC_SUBST(RTEMS_USE_MACROS)dnl
305])
306
307dnl $Id$
308
309AC_DEFUN(RTEMS_ENABLE_CXX,
310[
311AC_ARG_ENABLE(cxx,
312[  --enable-cxx                         enable C++ support,]
313[                                       and build the rtems++ library],
314[case "${enableval}" in
315  yes) RTEMS_HAS_CPLUSPLUS=yes ;;
316  no) RTEMS_HAS_CPLUSPLUS=no   ;;
317  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
318esac], [RTEMS_HAS_CPLUSPLUS=no])
319])
320
321dnl $Id$
322
323AC_DEFUN(RTEMS_ENABLE_GCC28,
324[
325AC_ARG_ENABLE(gcc28,
326[  --enable-gcc28                       enable use of gcc 2.8.x features],
327[case "${enableval}" in
328  yes) RTEMS_USE_GCC272=no ;;
329  no) RTEMS_USE_GCC272=yes ;;
330  *)  AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
331esac],[RTEMS_USE_GCC272=no])
332])
333
334dnl $Id$
335
336AC_DEFUN(RTEMS_ENABLE_LIBCDIR,
337[
338AC_ARG_ENABLE(libcdir,
339[  --enable-libcdir=directory           set the directory for the C library],
340[ RTEMS_LIBC_DIR="${enableval}" ; \
341test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
342AC_SUBST(RTEMS_LIBC_DIR)dnl
343])
344
345AC_DEFUN(RTEMS_ENABLE_BARE,
346[
347AC_ARG_ENABLE(bare-cpu-cflags,
348[  --enable-bare-cpu-cflags             specify a particular cpu cflag]
349[                                       (bare bsp specific)],
350[case "${enableval}" in
351  no) BARE_CPU_CFLAGS="" ;;
352  *)    BARE_CPU_CFLAGS="${enableval}" ;;
353esac],
354[BARE_CPU_CFLAGS=""])
355
356AC_ARG_ENABLE(bare-cpu-model,
357[  --enable-bare-cpu-model              specify a particular cpu model]
358[                                       (bare bsp specific)],
359[case "${enableval}" in
360  no)   BARE_CPU_MODEL="" ;;
361  *)    BARE_CPU_MODEL="${enableval}" ;;
362esac],
363[BARE_CPU_MODEL=""])
364])
365
366
367dnl $Id$
368
369dnl Override the set of BSPs to be built.
370dnl used by the toplevel configure script
371dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
372AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
373[
374AC_ARG_ENABLE(rtemsbsp,
375[  --enable-rtemsbsp=bsp1 bsp2 ..      BSPs to include in build],
376[case "${enableval}" in
377  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
378  *) $1=$enableval;;
379esac],[$1=""])
380])
381
382dnl Pass a single BSP via an environment variable
383dnl used by per BSP configure scripts
384AC_DEFUN(RTEMS_ENV_RTEMSBSP,
385[dnl
386AC_MSG_CHECKING([for RTEMS_BSP])
387AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
388[dnl
389  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
390])dnl
391if test -z "$rtems_cv_RTEMS_BSP"; then
392  AC_MSG_ERROR([Missing RTEMS_BSP])
393fi
394RTEMS_BSP="$rtems_cv_RTEMS_BSP"
395AC_MSG_RESULT(${RTEMS_BSP})
396AC_SUBST(RTEMS_BSP)
397])
398
399dnl $Id$
400
401AC_DEFUN(RTEMS_PATH_PERL,
402[
403AC_PATH_PROG(PERL,perl)
404if test -z "$PERL" ; then
405AC_MSG_WARN(
406[***]
407[   perl was not found]
408[   Note: Some tools will not be built.])
409fi
410])
411
412dnl $Id$
413
414AC_DEFUN(RTEMS_PATH_KSH,
415[
416dnl NOTE: prefer bash over ksh over sh
417AC_PATH_PROGS(KSH,bash ksh sh)
418if test -z "$KSH"; then
419dnl NOTE: This cannot happen -- /bin/sh must always exist
420AC_MSG_ERROR(
421[***]
422[    Cannot determine a usable shell bash/ksh/sh]
423[    Please contact your system administrator] );
424fi
425])
426
427dnl $Id$
428
429dnl check if RTEMS support a cpu
430AC_DEFUN(RTEMS_CHECK_CPU,
431[dnl
432AC_REQUIRE([RTEMS_TOP])
433AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
434# Is this a supported CPU?
435AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
436if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
437  AC_MSG_RESULT(yes)
438else
439  AC_MSG_ERROR(no)
440fi
441])dnl
442
443
444dnl $Id$
445
446AC_DEFUN(RTEMS_CANONICAL_HOST,
447[dnl
448AC_REQUIRE([AC_CANONICAL_HOST])
449RTEMS_HOST=$host_os
450changequote(,)dnl
451case "${target}" in
452  # hpux unix port should go here
453  i[3456]86-pc-linux*)         # unix "simulator" port
454        RTEMS_HOST=Linux
455        ;;
456  i[3456]86-*freebsd2*) # unix "simulator" port
457        RTEMS_HOST=FreeBSD
458        ;;
459  sparc-sun-solaris*)             # unix "simulator" port
460        RTEMS_HOST=Solaris
461        ;;
462  *)
463        ;;
464esac
465changequote([,])dnl
466AC_SUBST(RTEMS_HOST)
467])dnl
468
469dnl
470dnl $Id$
471dnl
472
473AC_DEFUN(RTEMS_PROJECT_ROOT,
474[dnl
475AC_REQUIRE([RTEMS_TOP])
476if test "$TARGET_SUBDIR" = "." ; then
477PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
478else
479PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
480fi
481AC_SUBST(PROJECT_ROOT)
482
483RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
484AC_SUBST(RTEMS_ROOT)
485
486INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
487AC_SUBST(INSTALL_CHANGE)
488
489PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
490AC_SUBST(PACKHEX)
491])
492
493
494dnl
495dnl $Id$
496dnl
497dnl Check for target gcc
498dnl
499dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
500dnl                             Completely reworked
501
502AC_DEFUN(RTEMS_PROG_CC,
503[
504AC_BEFORE([$0], [AC_PROG_CPP])dnl
505AC_BEFORE([$0], [AC_PROG_CC])dnl
506AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
507
508dnl Only accept gcc and cc
509dnl NOTE: This might be too restrictive for native compilation
510AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
511test -z "$CC_FOR_TARGET" \
512  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
513
514dnl backup
515rtems_save_CC=$CC
516rtems_save_CFLAGS=$CFLAGS
517
518dnl temporarily set CC
519CC=$CC_FOR_TARGET
520
521AC_PROG_CC_WORKS
522AC_PROG_CC_GNU
523
524if test $ac_cv_prog_gcc = yes; then
525  GCC=yes
526dnl Check whether -g works, even if CFLAGS is set, in case the package
527dnl plays around with CFLAGS (such as to build both debugging and
528dnl normal versions of a library), tasteless as that idea is.
529  ac_test_CFLAGS="${CFLAGS+set}"
530  ac_save_CFLAGS="$CFLAGS"
531  CFLAGS=
532  AC_PROG_CC_G
533  if test "$ac_test_CFLAGS" = set; then
534    CFLAGS="$ac_save_CFLAGS"
535  elif test $ac_cv_prog_cc_g = yes; then
536    CFLAGS="-g -O2"
537  else
538    CFLAGS="-O2"
539  fi
540else
541  GCC=
542  test "${CFLAGS+set}" = set || CFLAGS="-g"
543fi
544
545rtems_cv_prog_gcc=$ac_cv_prog_gcc
546rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
547rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
548rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
549
550dnl restore initial values
551CC=$rtems_save_CC
552CFLAGS=$rtems_save_CFLAGS
553
554unset ac_cv_prog_gcc
555unset ac_cv_prog_cc_g
556unset ac_cv_prog_cc_works
557unset ac_cv_prog_cc_cross
558])
559
560AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
561[
562dnl check target cc
563RTEMS_PROG_CC
564dnl check if the compiler supports --specs
565RTEMS_GCC_SPECS
566dnl check if the target compiler may use --pipe
567RTEMS_GCC_PIPE
568dnl check if the compiler supports --specs if gcc28 is requested
569if test "$RTEMS_USE_GCC272" != "yes" ; then
570  if test "$rtems_cv_gcc_specs" = "no"; then
571    AC_MSG_WARN([*** disabling --enable-gcc28])
572      RTEMS_USE_GCC272=yes
573  fi
574fi
575test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
576
577dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
578case $host_os in
579*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
580*) ;;
581esac
582AC_SUBST(GCCSED)
583])
584
585dnl
586dnl  $Id$
587dnl
588dnl Set program_prefix
589dnl
590dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
591dnl                             Extracted from configure
592
593AC_DEFUN(RTEMS_TOOL_PREFIX,
594[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
595AC_REQUIRE([AC_CANONICAL_BUILD])dnl
596
597changequote(,)dnl
598if [ "${program_prefix}" = "NONE" ] ; then
599  if [ "${target}" = "${host}" ] ; then
600    program_prefix=
601  else
602    program_prefix=${target}-
603  fi
604fi
605changequote([,])dnl
606])
607
608dnl
609dnl $Id$
610dnl
611dnl Check whether the target compiler accepts -specs
612dnl
613dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
614dnl
615
616AC_DEFUN(RTEMS_GCC_SPECS,
617[AC_REQUIRE([RTEMS_PROG_CC])
618AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
619[
620rtems_cv_gcc_specs=no
621if test "$rtems_cv_prog_gcc" = "yes"; then
622  touch confspec
623  echo 'void f(){}' >conftest.c
624  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
625    rtems_cv_gcc_specs=yes
626  fi
627fi
628rm -f confspec conftest*
629])])
630
631dnl
632dnl $Id$
633dnl
634dnl Check whether the target compiler accepts -pipe
635dnl
636dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
637dnl
638
639AC_DEFUN(RTEMS_GCC_PIPE,
640[AC_REQUIRE([RTEMS_PROG_CC])
641AC_REQUIRE([AC_CANONICAL_HOST])
642AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
643[
644rtems_cv_gcc_pipe=no
645if test "$rtems_cv_prog_gcc" = "yes"; then
646case "$host_os" in
647  cygwin*)
648    ;;
649  *)
650    echo 'void f(){}' >conftest.c
651    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
652      rtems_cv_gcc_pipe=yes
653    fi
654    rm -f conftest*
655    ;;
656esac
657fi
658])
659])
660
661dnl
662dnl $Id$
663dnl
664dnl Check for target g++
665dnl
666dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
667dnl                             Completely reworked
668
669AC_DEFUN(RTEMS_PROG_CXX,
670[
671AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
672AC_BEFORE([$0], [AC_PROG_CXX])dnl
673AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
674
675dnl Only accept g++ and c++
676dnl NOTE: This might be too restrictive for native compilation
677AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
678test -z "$CXX_FOR_TARGET" \
679  && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
680
681dnl backup
682rtems_save_CXX=$CXX
683rtems_save_CXXFLAGS=$CXXFLAGS
684
685dnl temporarily set CXX
686CXX=$CXX_FOR_TARGET
687
688AC_PROG_CXX_WORKS
689AC_PROG_CXX_GNU
690
691if test $ac_cv_prog_gxx = yes; then
692  GXX=yes
693dnl Check whether -g works, even if CXXFLAGS is set, in case the package
694dnl plays around with CXXFLAGS (such as to build both debugging and
695dnl normal versions of a library), tasteless as that idea is.
696  ac_test_CXXFLAGS="${CXXFLAGS+set}"
697  ac_save_CXXFLAGS="$CXXFLAGS"
698  CXXFLAGS=
699  AC_PROG_CXX_G
700  if test "$ac_test_CXXFLAGS" = set; then
701    CXXFLAGS="$ac_save_CXXFLAGS"
702  elif test $ac_cv_prog_cxx_g = yes; then
703    CXXFLAGS="-g -O2"
704  else
705    CXXFLAGS="-O2"
706  fi
707else
708  GXX=
709  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
710fi
711
712rtems_cv_prog_gxx=$ac_cv_prog_gxx
713rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
714rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
715rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
716
717CXX=$rtems_save_CXX
718CXXFLAGS=$rtems_save_CXXFLAGS
719
720dnl restore initial values
721unset ac_cv_prog_gxx
722unset ac_cv_prog_cc_g
723unset ac_cv_prog_cxx_works
724unset ac_cv_prog_cxx_cross
725])
726
727AC_DEFUN(RTEMS_PROG_CXX_FOR_TARGET,
728[
729  RTEMS_PROG_CXX
730  if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
731    AC_MSG_ERROR([***]
732     [Inconsistency in compiler configuration:]
733     [Target C compiler and Target C++ compiler]
734     [must both either be cross compilers or native compilers]
735     [Hint: If building a posix bsp: LD_LIBRARY_PATH?] )
736  fi
737])
738
739dnl
740dnl $Id$
741dnl
742dnl Set target tools
743dnl
744dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
745dnl             fixing cache/environment variable handling
746dnl             adding checks for cygwin/egcs '\\'-bug
747dnl             adding checks for ranlib/ar -s problem
748dnl
749dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
750dnl
751
752AC_DEFUN(RTEMS_GCC_PRINT,
753[ case $host_os in
754  *cygwin*)
755    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
756    dnl        Should be removed once cygwin/egcs reports '/' only
757    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
758    ;;
759  *)
760    $1=`$CC_FOR_TARGET --print-prog-name=$2`
761    ;;
762  esac
763])
764
765AC_DEFUN(RTEMS_PATH_TOOL,
766[
767AC_MSG_CHECKING([target's $2])
768AC_CACHE_VAL(ac_cv_path_$1,:)
769AC_MSG_RESULT([$ac_cv_path_$1])
770
771if test -n "$ac_cv_path_$1"; then
772  dnl retrieve the value from the cache
773  $1=$ac_cv_path_$1
774else
775  dnl the cache was not set
776  if test -z "[$]$1" ; then
777    if test "$rtems_cv_prog_gcc" = "yes"; then
778      # We are using gcc, ask it about its tool
779      # NOTE: Necessary if gcc was configured to use the target's
780      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
781      RTEMS_GCC_PRINT($1,$2)
782    fi
783  else
784    # The user set an environment variable.
785    # Check whether it is an absolute path, otherwise AC_PATH_PROG
786    # will override the environment variable, which isn't what the user
787    # intends
788    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
789    case "[$]$1" in
790    /*) # valid
791      AC_MSG_RESULT("yes")
792    ;;
793    *)  # invalid for AC_PATH_PROG
794      AC_MSG_RESULT("no")
795      AC_MSG_ERROR([***]
796        [Environment variable $1 should either]
797        [be unset (preferred) or contain an absolute path])
798    ;;
799    esac
800  fi
801
802  AC_PATH_PROG($1,"$program_prefix"$2,$3)
803fi
804])
805
806AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
807[AC_REQUIRE([RTEMS_PROG_CC])dnl
808
809dnl FIXME: What shall be done if these tools are not available?
810  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
811  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
812  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
813  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
814
815dnl special treatment of ranlib
816  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
817  if test "$RANLIB_FOR_TARGET" = "no"; then
818    # ranlib wasn't found; check if ar -s is available
819    RTEMS_AR_FOR_TARGET_S
820    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
821      dnl override RANLIB_FOR_TARGET's cache
822      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
823      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
824    else
825      AC_MSG_ERROR([***]
826        [Can't figure out how to build a library index]
827        [Neither ranlib nor ar -s seem to be available] )
828    fi
829  fi
830
831dnl NOTE: These may not be available if not using gnutools
832  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
833  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
834  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
835])
836
837dnl
838dnl $Id$
839dnl
840
841AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
842[
843AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
844rtems_cv_AR_FOR_TARGET_S,
845[
846cat > conftest.$ac_ext <<EOF
847int foo( int b )
848{ return b; }
849EOF
850if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
851  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
852  && test -s conftest.a ; \
853then
854  rtems_cv_AR_FOR_TARGET_S="yes"
855else
856  rtems_cv_AR_FOR_TARGET_S="no"
857fi
858  rm -f conftest*
859])
860])
861
862
863dnl
864dnl  $Id$
865dnl
866
867dnl check for i386 gas supporting 16 bit mode
868dnl     - binutils 2.9.1.0.7 and higher
869
870AC_DEFUN(RTEMS_I386_GAS_CODE16,
871[ if test "${target_cpu}" = "i386"; then
872    AC_CACHE_CHECK([for 16 bit mode assembler support],
873      rtems_cv_prog_gas_code16,
874      [cat > conftest.s << EOF
875         .code16
876         data32
877         addr32
878         lgdt 0
879EOF
880      if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
881        rtems_cv_prog_gas_code16=yes
882      else
883        rtems_cv_prog_gas_code16=no
884      fi])
885    RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
886  fi
887  AC_SUBST(RTEMS_GAS_CODE16)
888])
889
890
891dnl $Id$
892
893dnl Report all available bsps for a target,
894dnl check if a bsp-subdirectory is present for all bsps found
895dnl
896dnl RTEMS_CHECK_BSPS(bsp_list)
897AC_DEFUN(RTEMS_CHECK_BSPS,
898[
899AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
900AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
901AC_MSG_CHECKING([for bsps])
902case "${target}" in
903changequote(,)dnl
904  i[3456]86-go32-rtems*)
905changequote([,])dnl
906    $1="go32 go32_p5"
907    ;;
908  *)
909    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
910    for file in $files; do
911      case $file in
912        shared*);;
913        Makefile*);;
914        READ*);;
915        CVS*);;
916        pxfl*);;
917        go32*);;       # so the i386 port can pick up the other Makefiles
918        # Now account for BSPs with build variants
919        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
920        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
921        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
922        *) $1="[$]$1 $file";;
923      esac;
924    done
925    ;;
926esac
927AC_MSG_RESULT([[$]$1 .. done])
928])dnl
929
930AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
931[dnl
932AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
933if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
934  AC_MSG_RESULT([yes])
935else
936  AC_MSG_ERROR([no])
937fi
938])dnl
939
940dnl
941dnl $Id$
942dnl
943
944AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING,
945[dnl
946AC_REQUIRE([RTEMS_TOP])dnl
947AC_REQUIRE([RTEMS_CHECK_CPU])dnl
948AC_CACHE_CHECK([whether BSP supports multiprocessing],
949  rtems_cv_HAS_MP,
950  [dnl
951    if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}/${$1}/shmsupp"; then
952      if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then
953        rtems_cv_HAS_MP="yes" ;
954      else
955        rtems_cv_HAS_MP="disabled";
956      fi
957    else
958      rtems_cv_HAS_MP="no";
959    fi])
960if test "$rtems_cv_HAS_MP" = "yes"; then
961HAS_MP="yes"
962else
963HAS_MP="no"
964fi
965AC_SUBST(HAS_MP)
966])
967
968dnl $Id$
969dnl
970AC_DEFUN(RTEMS_CHECK_RDBG,
971[dnl
972AC_REQUIRE([RTEMS_TOP])dnl
973AC_REQUIRE([RTEMS_CHECK_CPU])dnl
974AC_CACHE_CHECK([whether BSP supports librdbg],
975  rtems_cv_HAS_RDBG,
976  [
977    if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/librdbg/${RTEMS_CPU}/${$1}"; then
978      rtems_cv_HAS_RDBG="yes" ;
979    else
980      rtems_cv_HAS_RDBG="no";
981    fi
982  ])
983HAS_RDBG="$rtems_cv_HAS_RDBG"
984AC_SUBST(HAS_RDBG)
985])
986
987dnl $Id$
988dnl
989AC_DEFUN(RTEMS_CHECK_POSIX_API,
990[dnl
991AC_REQUIRE([RTEMS_CHECK_CPU])dnl
992AC_CACHE_CHECK([whether BSP supports libposix],
993  rtems_cv_HAS_POSIX_API,
994  [dnl
995    case "$RTEMS_CPU" in
996    unix*)
997      rtems_cv_HAS_POSIX_API="no"
998      ;;
999    *)
1000      if test "${RTEMS_HAS_POSIX_API}" = "yes"; then
1001        rtems_cv_HAS_POSIX_API="yes";
1002      else
1003        rtems_cv_HAS_POSIX_API="disabled";
1004      fi
1005      ;;
1006    esac])
1007if test "$rtems_cv_HAS_POSIX_API" = "yes"; then
1008  HAS_POSIX_API="yes";
1009else
1010  HAS_POSIX_API="no";
1011fi
1012AC_SUBST(HAS_POSIX_API)dnl
1013])
1014
1015dnl $Id$
1016dnl
1017AC_DEFUN(RTEMS_CHECK_CXX,
1018[dnl
1019AC_REQUIRE([RTEMS_CHECK_CPU])dnl
1020AC_REQUIRE([RTEMS_PROG_CXX_FOR_TARGET])dnl
1021AC_CACHE_VAL(rtems_cv_HAS_CPLUSPLUS,
1022  [dnl
1023    if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
1024      if test -n "$CXX_FOR_TARGET"; then
1025        rtems_cv_HAS_CPLUSPLUS="yes";
1026      else
1027        rtems_cv_HAS_CPLUSPLUS="no";
1028      fi
1029    else
1030      rtems_cv_HAS_CPLUSPLUS="no";
1031    fi
1032  ])dnl
1033HAS_CPLUSPLUS="$rtems_cv_HAS_CPLUSPLUS";
1034AC_SUBST(HAS_CPLUSPLUS)dnl
1035])
1036
1037dnl $Id$
1038dnl
1039AC_DEFUN(RTEMS_CHECK_NETWORKING,
1040[dnl
1041AC_REQUIRE([RTEMS_CHECK_CPU])dnl
1042AC_CACHE_VAL(rtems_cv_HAS_NETWORKING,
1043  [dnl
1044    if test "$RTEMS_HAS_NETWORKING" = "yes"; then
1045      rtems_cv_HAS_NETWORKING="yes";
1046    else
1047      rtems_cv_HAS_NETWORKING="no";
1048    fi
1049  ])dnl
1050HAS_NETWORKING="$rtems_cv_HAS_NETWORKING";
1051AC_SUBST(HAS_NETWORKING)dnl
1052])
1053
Note: See TracBrowser for help on using the repository browser.