[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 | |
---|
[789694a1] | 8 | AC_DEFUN([_RTEMS_CONFIG_SUBDIR], |
---|
[02ccf4a] | 9 | [ |
---|
| 10 | if test "$no_recursion" != yes; then |
---|
[e90cff96] | 11 | ac_sub_sourcedir=$2 |
---|
| 12 | ac_sub_builddir=$1 |
---|
[02ccf4a] | 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 | |
---|
[e90cff96] | 68 | AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args $3 --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir]) |
---|
[02ccf4a] | 69 | # The eval makes quoting arguments work. |
---|
[e90cff96] | 70 | eval $ac_sub_configure $ac_sub_configure_args $3 \ |
---|
[02ccf4a] | 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 | |
---|
[2977f24c] | 75 | cd "$ac_popdir" |
---|
[02ccf4a] | 76 | done |
---|
| 77 | fi |
---|
| 78 | ]) |
---|
[789694a1] | 79 | |
---|
| 80 | ## RTEMS_BSP_CONFIG_SUBDIR(builddir,srcdir,configargs,condition) |
---|
| 81 | AC_DEFUN([RTEMS_BSP_CONFIG_SUBDIR],[ |
---|
| 82 | m4_expand_once([RTEMS_CONFIGURE_ARGS_QUOTE([ac_sub_configure_args])]) |
---|
| 83 | AS_IF([$4],[BSP_SUBDIRS="$BSP_SUBDIRS $1"]) |
---|
| 84 | AC_CONFIG_COMMANDS_POST([ |
---|
| 85 | AS_IF([$4],[_RTEMS_CONFIG_SUBDIR([$1],[$2],[$3])])]) |
---|
| 86 | ]) |
---|