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

4.104.114.84.95
Last change on this file since e90cff96 was e90cff96, checked in by Ralf Corsepius <ralf.corsepius@…>, on Dec 14, 2003 at 11:00:58 PM

2003-12-14 Ralf Corsepius <corsepiu@…>

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