source: rtems/c/src/acinclude.m4 @ 14782ec0

4.104.115
Last change on this file since 14782ec0 was 2977f24c, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/18/04 at 01:14:40

2004-08-17 Ralf Corsepius <ralf_corsepius@…>

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