source: rtems/c/src/acinclude.m4 @ 247874ae

4.104.114.84.95
Last change on this file since 247874ae was 247874ae, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jul 22, 2002 at 6:01:31 AM

2002-07-22 Ralf Corsepius <corsepiu@…>

  • acinclude.m4: Cleanups.
  • configure.ac: Build ${srcdir}/../../cpukit/ as ./exec/ instead of ${srcdir}/exec/. Further adaptations to autoconf >= 2.50.
  • Property mode set to 100644
File size: 3.4 KB
Line 
1# $Id$
2#
3# Some hacks for handling special config subdirectories
4#
5# Note: Consider this file a temporary band-aid until a better, more general
6# subdirectory handling solution is introduced to RTEMS.
7
8AC_DEFUN([RTEMS_CONFIG_SUBDIR],
9[
10AC_CONFIG_COMMANDS_POST(
11[
12 ac_sub_sourcedir=$2
13 ac_sub_builddir=$1
14
15if test "$no_recursion" != yes; then
16
17  # Remove --cache-file and --srcdir arguments so they do not pile up.
18  ac_sub_configure_args=
19  ac_prev=
20  for ac_arg in $ac_configure_args; do
21    if test -n "$ac_prev"; then
22      ac_prev=
23      continue
24    fi
25    case $ac_arg in
26    -cache-file | --cache-file | --cache-fil | --cache-fi \
27    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
28      ac_prev=cache_file ;;
29    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
30    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
31    | --c=*)
32      ;;
33    --config-cache | -C)
34      ;;
35    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
36      ac_prev=srcdir ;;
37    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
38      ;;
39    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
40    esac
41  done
42
43  ac_sub_configure_args="$ac_sub_configure_args $3"
44
45  for ac_subdir in : $ac_sub_sourcedir; do test "x$ac_subdir" = x: && continue
46
47    # Do not complain, so a configure script can configure whichever
48    # parts of a large source tree are present.
49    test -d $srcdir/$ac_subdir || continue
50
51    AC_MSG_NOTICE([configuring in $ac_subdir])
52    case $srcdir in
53    .) ;;
54    *) AS_MKDIR_P(["./$ac_sub_builddir"])
55       if test -d ./$ac_sub_builddir; then :;
56       else
57         AC_MSG_ERROR([cannot create `pwd`/$ac_sub_builddir])
58       fi
59       ;;
60    esac
61
62    ac_popdir=`pwd`
63    cd $ac_sub_builddir
64
65    # A "../" for each directory in /$ac_subdir.
66    ac_dots=`echo $ac_sub_builddir |
67             sed 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g'`
68
69    case $srcdir in
70    .) # No --srcdir option.  We are building in place.
71      ac_sub_srcdir=$srcdir${ac_subdir} ;;
72    [[\\/]]* | ?:[[\\/]]* ) # Absolute path.
73      ac_sub_srcdir=$srcdir/$ac_subdir ;;
74    *) # Relative path.
75      ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
76    esac
77
78    # Check for guested configure; otherwise get Cygnus style configure.
79    if test -f $ac_sub_srcdir/configure.gnu; then
80      ac_sub_configure="$SHELL '$ac_sub_srcdir/configure.gnu'"
81    elif test -f $ac_sub_srcdir/configure; then
82      ac_sub_configure="$SHELL '$ac_sub_srcdir/configure'"
83    elif test -f $ac_sub_srcdir/configure.in; then
84      ac_sub_configure=$ac_configure
85    else
86      AC_MSG_WARN([no configuration information is in $ac_subdir])
87      ac_sub_configure=
88    fi
89
90    # The recursion is here.
91    if test -n "$ac_sub_configure"; then
92      # Make the cache file name correct relative to the subdirectory.
93      case $cache_file in
94      [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
95      *) # Relative path.
96        ac_sub_cache_file=$ac_dots$cache_file ;;
97      esac
98
99      AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir])
100      # The eval makes quoting arguments work.
101      eval $ac_sub_configure $ac_sub_configure_args \
102           --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir ||
103        AC_MSG_ERROR([$ac_sub_configure failed for $ac_subdir])
104    fi
105
106    cd $ac_popdir
107  done
108fi
109])
110])
Note: See TracBrowser for help on using the repository browser.