[466e590] | 1 | # $Id$ |
---|
| 2 | # |
---|
| 3 | # Some hacks for handling powerpc-exception 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 | |
---|
| 8 | AC_DEFUN([RTEMS_PPC_EXCEPTIONS], |
---|
| 9 | [ |
---|
| 10 | exceptions="$1_exception_processing" |
---|
| 11 | AC_SUBST(exceptions) |
---|
| 12 | |
---|
| 13 | AC_CONFIG_COMMANDS_POST( |
---|
| 14 | [ |
---|
| 15 | exceptions_subdirs="$1_exception_processing" |
---|
| 16 | updir=/../support |
---|
| 17 | |
---|
| 18 | if test "$no_recursion" != yes; then |
---|
| 19 | |
---|
| 20 | # Remove --cache-file and --srcdir arguments so they do not pile up. |
---|
| 21 | ac_sub_configure_args= |
---|
| 22 | ac_prev= |
---|
| 23 | for ac_arg in $ac_configure_args; do |
---|
| 24 | if test -n "$ac_prev"; then |
---|
| 25 | ac_prev= |
---|
| 26 | continue |
---|
| 27 | fi |
---|
| 28 | case $ac_arg in |
---|
| 29 | -cache-file | --cache-file | --cache-fil | --cache-fi \ |
---|
| 30 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) |
---|
| 31 | ac_prev=cache_file ;; |
---|
| 32 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ |
---|
| 33 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ |
---|
| 34 | | --c=*) |
---|
| 35 | ;; |
---|
| 36 | --config-cache | -C) |
---|
| 37 | ;; |
---|
| 38 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) |
---|
| 39 | ac_prev=srcdir ;; |
---|
| 40 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) |
---|
| 41 | ;; |
---|
| 42 | *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; |
---|
| 43 | esac |
---|
| 44 | done |
---|
| 45 | |
---|
| 46 | for ac_subdir in : $exceptions_subdirs; do test "x$ac_subdir" = x: && continue |
---|
| 47 | |
---|
| 48 | # Do not complain, so a configure script can configure whichever |
---|
| 49 | # parts of a large source tree are present. |
---|
| 50 | test -d $srcdir${updir}/$ac_subdir || continue |
---|
| 51 | |
---|
| 52 | AC_MSG_NOTICE([configuring in $ac_subdir]) |
---|
| 53 | case $srcdir in |
---|
| 54 | .) ;; |
---|
| 55 | *) AS_MKDIR_P(["./$ac_subdir"]) |
---|
| 56 | if test -d ./$ac_subdir; then :; |
---|
| 57 | else |
---|
| 58 | AC_MSG_ERROR([cannot create `pwd`/$ac_subdir]) |
---|
| 59 | fi |
---|
| 60 | ;; |
---|
| 61 | esac |
---|
| 62 | |
---|
| 63 | ac_popdir=`pwd` |
---|
| 64 | cd $ac_subdir |
---|
| 65 | |
---|
| 66 | # A "../" for each directory in /$ac_subdir. |
---|
| 67 | ac_dots=`echo $ac_subdir | |
---|
| 68 | sed 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g'` |
---|
| 69 | |
---|
| 70 | case $srcdir in |
---|
| 71 | .) # No --srcdir option. We are building in place. |
---|
| 72 | ac_sub_srcdir=$srcdir${updir} ;; |
---|
| 73 | [[\\/]]* | ?:[[\\/]]* ) # Absolute path. |
---|
| 74 | ac_sub_srcdir=$srcdir${updir}/$ac_subdir ;; |
---|
| 75 | *) # Relative path. |
---|
| 76 | ac_sub_srcdir=$ac_dots$srcdir${updir}/$ac_subdir ;; |
---|
| 77 | esac |
---|
| 78 | |
---|
| 79 | # Check for guested configure; otherwise get Cygnus style configure. |
---|
| 80 | if test -f $ac_sub_srcdir/configure.gnu; then |
---|
| 81 | ac_sub_configure="$SHELL '$ac_sub_srcdir/configure.gnu'" |
---|
| 82 | elif test -f $ac_sub_srcdir/configure; then |
---|
| 83 | ac_sub_configure="$SHELL '$ac_sub_srcdir/configure'" |
---|
| 84 | elif test -f $ac_sub_srcdir/configure.in; then |
---|
| 85 | ac_sub_configure=$ac_configure |
---|
| 86 | else |
---|
| 87 | AC_MSG_WARN([no configuration information is in $ac_subdir]) |
---|
| 88 | ac_sub_configure= |
---|
| 89 | fi |
---|
| 90 | |
---|
| 91 | # The recursion is here. |
---|
| 92 | if test -n "$ac_sub_configure"; then |
---|
| 93 | # Make the cache file name correct relative to the subdirectory. |
---|
| 94 | case $cache_file in |
---|
| 95 | [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;; |
---|
| 96 | *) # Relative path. |
---|
| 97 | ac_sub_cache_file=$ac_dots$cache_file ;; |
---|
| 98 | esac |
---|
| 99 | |
---|
| 100 | AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir]) |
---|
| 101 | # The eval makes quoting arguments work. |
---|
| 102 | eval $ac_sub_configure $ac_sub_configure_args \ |
---|
| 103 | --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir || |
---|
| 104 | AC_MSG_ERROR([$ac_sub_configure failed for $ac_subdir]) |
---|
| 105 | fi |
---|
| 106 | |
---|
| 107 | cd $ac_popdir |
---|
| 108 | done |
---|
| 109 | fi |
---|
| 110 | ]) |
---|
| 111 | ]) |
---|