source: rtems/c/src/acinclude.m4 @ f4fe0092

4.104.114.84.9
Last change on this file since f4fe0092 was 154c99c, checked in by Ralf Corsepius <ralf.corsepius@…>, on Oct 11, 2002 at 4:32:49 AM

2002-10-11 Ralf Corsepius <corsepiu@…>

  • acinclude.m4: Apply RTEMS_CONFIGURE_ARGS_QUOTE.
  • Property mode set to 100644
File size: 2.6 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[
12if test "$multilib" != "yes"; then
13 ac_sub_sourcedir=$2
14 ac_sub_builddir=$1
15
16if test "$no_recursion" != yes; then
17  RTEMS_CONFIGURE_ARGS_QUOTE([ac_sub_configure_args])
18
19  ac_sub_configure_args="$ac_sub_configure_args $3"
20
21  for ac_subdir in : $ac_sub_sourcedir; do test "x$ac_subdir" = x: && continue
22
23    # Do not complain, so a configure script can configure whichever
24    # parts of a large source tree are present.
25    test -d $srcdir/$ac_subdir || continue
26
27    AC_MSG_NOTICE([configuring in $ac_subdir])
28    case $srcdir in
29    .) ;;
30    *) AS_MKDIR_P(["./$ac_sub_builddir"])
31       if test -d ./$ac_sub_builddir; then :;
32       else
33         AC_MSG_ERROR([cannot create `pwd`/$ac_sub_builddir])
34       fi
35       ;;
36    esac
37
38    ac_popdir=`pwd`
39    cd $ac_sub_builddir
40
41    # A "../" for each directory in /$ac_subdir.
42    ac_dots=`echo $ac_sub_builddir |
43             sed 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g'`
44
45    case $srcdir in
46    .) # No --srcdir option.  We are building in place.
47      ac_sub_srcdir=$srcdir${ac_subdir} ;;
48    [[\\/]]* | ?:[[\\/]]* ) # Absolute path.
49      ac_sub_srcdir=$srcdir/$ac_subdir ;;
50    *) # Relative path.
51      ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
52    esac
53
54    # Check for guested configure; otherwise get Cygnus style configure.
55    if test -f $ac_sub_srcdir/configure.gnu; then
56      ac_sub_configure="$SHELL '$ac_sub_srcdir/configure.gnu'"
57    elif test -f $ac_sub_srcdir/configure; then
58      ac_sub_configure="$SHELL '$ac_sub_srcdir/configure'"
59    elif test -f $ac_sub_srcdir/configure.in; then
60      ac_sub_configure=$ac_configure
61    else
62      AC_MSG_WARN([no configuration information is in $ac_subdir])
63      ac_sub_configure=
64    fi
65
66    # The recursion is here.
67    if test -n "$ac_sub_configure"; then
68      # Make the cache file name correct relative to the subdirectory.
69      case $cache_file in
70      [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
71      *) # Relative path.
72        ac_sub_cache_file=$ac_dots$cache_file ;;
73      esac
74
75      AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir])
76      # The eval makes quoting arguments work.
77      eval $ac_sub_configure $ac_sub_configure_args \
78           --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir ||
79        AC_MSG_ERROR([$ac_sub_configure failed for $ac_subdir])
80    fi
81
82    cd $ac_popdir
83  done
84fi
85fi
86])
87])
Note: See TracBrowser for help on using the repository browser.