source: rtems/aclocal.m4 @ a719382

4.104.114.84.95
Last change on this file since a719382 was 6fc973e, checked in by Joel Sherrill <joel.sherrill@…>, on 08/18/99 at 16:49:52

Patch from Ralf Corsepius <corsepiu@…>:

Here is another fix, which addresses a few more or less severe bugs in
configuration and unix/posix:

  • Configuration fix: c/src/lib/configure.in didn't handle RDBG correctly
  • Configuration fix: make depend was non-functional in c/src/lib/libc/Makefile.in
  • Configuration fix: stray comment removed from aclocal/target.m4
  • RTEMS fix: termios support for unix/posix now uses the host's headers only (was completely broken).
  • Don't install RTEMS's newlib sys/termios.h for unix (sys/termios.h apparently is a newlib specific header)
  • To be able to compile RTEMS's termios.c with glibc2.1, glibc-2.1 needs USE_MISC, which is a private define from gcc's features.h, being defined only when _BSD_SOURCE of _SVID_SOURCE is defined. RTEMS's termios apparently implements BSD, thus -D_BSD_SOURCE was added to Linux-posix.cfg.
  • Conflicting definitions for USE_MISC and _BSD_SOURCE inside of RTEMS codes removed due to definition of _BSD_SOURCE on the toplevel.

This fix has been tested with linux/posix (primary glibc2.1 native),
linux/posix (secondary libc5 native), sh/gensh1, i386/pc386 and a couple
of other bsp's/CPU.

To apply:

cd <srcdir>
patch -p1 < rtems-rc-19990709-9.diff

and

aclocal -I aclocal && automake && autoconf
cd c/src/lib; autoconf

or

./autogen

  • Property mode set to 100644
File size: 14.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
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
345dnl $Id$
346
347AC_DEFUN(RTEMS_ENABLE_TESTS,
348[
349# If the tests are enabled, then find all the test suite Makefiles
350AC_MSG_CHECKING([if the test suites are enabled? ])
351AC_ARG_ENABLE(tests,
352[  --enable-tests                       enable tests (default:disabled)],
353  [case "${enableval}" in
354    yes) tests_enabled=yes ;;
355    no)  tests_enabled=no ;;
356    *)   AC_MSG_ERROR(bad value ${enableval} for tests option) ;;
357  esac], [tests_enabled=no])
358AC_MSG_RESULT([$tests_enabled])
359])
360
361dnl $Id$
362dnl
363dnl FIXME: this needs to be reworked
364
365AC_DEFUN(RTEMS_ENABLE_HWAPI,
366[dnl
367AC_ARG_ENABLE(hwapi, \
368[  --enable-hwapi                       enable hardware API library],
369[case "${enableval}" in
370    yes) RTEMS_HAS_HWAPI=yes ;;
371    no)  RTEMS_HAS_HWAPI=no ;;
372    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
373  esac],[RTEMS_HAS_HWAPI=no])
374AC_SUBST(RTEMS_HAS_HWAPI)dnl
375])dnl
376
377dnl $Id$
378
379dnl check if RTEMS support a cpu
380AC_DEFUN(RTEMS_CHECK_CPU,
381[dnl
382AC_REQUIRE([RTEMS_TOP])
383AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
384# Is this a supported CPU?
385AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
386if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
387  AC_MSG_RESULT(yes)
388else
389  AC_MSG_ERROR(no)
390fi
391])dnl
392
393
394dnl $Id$
395
396AC_DEFUN(RTEMS_CANONICAL_HOST,
397[dnl
398AC_REQUIRE([AC_CANONICAL_HOST])
399RTEMS_HOST=$host_os
400changequote(,)dnl
401case "${target}" in
402  # hpux unix port should go here
403  i[3456]86-pc-linux*)         # unix "simulator" port
404        RTEMS_HOST=Linux
405        ;;
406  i[3456]86-*freebsd2*) # unix "simulator" port
407        RTEMS_HOST=FreeBSD
408        ;;
409  sparc-sun-solaris*)             # unix "simulator" port
410        RTEMS_HOST=Solaris
411        ;;
412  *)
413        ;;
414esac
415changequote([,])dnl
416AC_SUBST(RTEMS_HOST)
417])dnl
418
419dnl $Id$
420
421AC_DEFUN(RTEMS_CONFIG_SUBDIRS,
422[
423define([RTEMS_TGT_SUBDIRS],
424ifdef([RTEMS_TGT_SUBDIRS], [RTEMS_TGT_SUBDIRS ],)[$1])dnl
425target_subdirs="RTEMS_TGT_SUBDIRS"
426AC_SUBST(target_subdirs)
427])
428
429dnl This is a subroutine of AC_OUTPUT.
430dnl It is called after running config.status.
431dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
432AC_DEFUN(RTEMS_OUTPUT_SUBDIRS,
433[
434if test "$no_recursion" != yes; then
435  if test $target_alias != $host_alias; then
436    target_subdir="$target_alias"
437  else
438    target_subdir="."
439  fi
440  # Remove --cache-file and --srcdir arguments so they do not pile up.
441  ac_sub_configure_args=
442  ac_prev=
443  for ac_arg in $ac_configure_args; do
444    if test -n "$ac_prev"; then
445      ac_prev=
446      continue
447    fi
448    case "$ac_arg" in
449    -cache-file | --cache-file | --cache-fil | --cache-fi \
450    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
451      ac_prev=cache_file ;;
452    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
453    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
454      ;;
455    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
456      ac_prev=srcdir ;;
457    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
458      ;;
459    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
460    esac
461  done
462
463  test -d $target_subdir || mkdir $target_subdir
464  for ac_config_dir in $1; do
465
466    # Do not complain, so a configure script can configure whichever
467    # parts of a large source tree are present.
468    if test ! -d $srcdir/$ac_config_dir; then
469      continue
470    fi
471
472    echo configuring in $target_subdir/$ac_config_dir
473
474    case "$srcdir" in
475    .) ;;
476    *)
477      if test -d $target_subdir/$ac_config_dir || mkdir $target_subdir/$ac_config_dir; then :;
478      else
479        AC_MSG_ERROR(can not create `pwd`/$target_subdir/$ac_config_dir)
480      fi
481      ;;
482    esac
483
484    ac_popdir=`pwd`
485    cd $target_subdir/$ac_config_dir
486
487changequote(, )dnl
488      # A "../" for each directory in /$ac_config_dir.
489      ac_dots=`echo $target_subdir/$ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
490changequote([, ])dnl
491
492    case "$srcdir" in
493    .) # No --srcdir option.  We are building in place.
494      ac_sub_srcdir=$srcdir ;;
495    /*) # Absolute path.
496      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
497    *) # Relative path.
498      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
499    esac
500
501    # Check for guested configure; otherwise get Cygnus style configure.
502    if test -f $ac_sub_srcdir/configure; then
503      ac_sub_configure=$ac_sub_srcdir/configure
504    elif test -f $ac_sub_srcdir/configure.in; then
505      ac_sub_configure=$ac_configure
506    else
507      AC_MSG_WARN(no configuration information is in $ac_config_dir)
508      ac_sub_configure=
509    fi
510
511    # The recursion is here.
512    if test -n "$ac_sub_configure"; then
513
514      # Make the cache file name correct relative to the subdirectory.
515      if test "$target_alias" != "$host_alias"; then
516      ac_sub_cache_file=$cache_file
517      else
518      case "$cache_file" in
519      /*) ac_sub_cache_file=$cache_file ;;
520      *) # Relative path.
521        ac_sub_cache_file="$ac_dots$cache_file" ;;
522      esac
523      fi
524ifdef([AC_PROVIDE_AC_PROG_INSTALL],
525      [  case "$ac_given_INSTALL" in
526changequote(, )dnl
527        [/$]*) INSTALL="$ac_given_INSTALL" ;;
528changequote([, ])dnl
529        *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
530        esac
531])dnl
532
533      echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
534      # The eval makes quoting arguments work.
535      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \
536        $ac_sub_configure_args --srcdir=$ac_sub_srcdir \
537        --with-target-subdir=$target_subdir --cache-file=$ac_sub_cache_file
538      then :
539      else
540        AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)
541      fi
542    fi
543
544    cd $ac_popdir
545  done
546fi
547])
548
Note: See TracBrowser for help on using the repository browser.