[02ccf4a] | 1 | # $Id$ |
---|
| 2 | # |
---|
[247874ae] | 3 | # Some hacks for handling special config subdirectories |
---|
[02ccf4a] | 4 | # |
---|
| 5 | # Note: Consider this file a temporary band-aid until a better, more general |
---|
| 6 | # subdirectory handling solution is introduced to RTEMS. |
---|
| 7 | |
---|
| 8 | AC_DEFUN([RTEMS_CONFIG_SUBDIR], |
---|
| 9 | [ |
---|
| 10 | AC_CONFIG_COMMANDS_POST( |
---|
| 11 | [ |
---|
[dbaca2a7] | 12 | if test "$multilib" != "yes"; then |
---|
[02ccf4a] | 13 | ac_sub_sourcedir=$2 |
---|
| 14 | ac_sub_builddir=$1 |
---|
| 15 | |
---|
| 16 | if test "$no_recursion" != yes; then |
---|
[154c99c] | 17 | RTEMS_CONFIGURE_ARGS_QUOTE([ac_sub_configure_args]) |
---|
[02ccf4a] | 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 |
---|
| 84 | fi |
---|
[dbaca2a7] | 85 | fi |
---|
[02ccf4a] | 86 | ]) |
---|
| 87 | ]) |
---|