summaryrefslogtreecommitdiffstats
path: root/aclocal/target.m4
diff options
context:
space:
mode:
Diffstat (limited to 'aclocal/target.m4')
-rw-r--r--aclocal/target.m454
1 files changed, 24 insertions, 30 deletions
diff --git a/aclocal/target.m4 b/aclocal/target.m4
index 517811d51b..9c84490880 100644
--- a/aclocal/target.m4
+++ b/aclocal/target.m4
@@ -1,19 +1,21 @@
dnl $Id$
-AC_DEFUN(RTEMS_CONFIG_SUBDIRS,
+## HACK: Work-around to structural issue with RTEMS
+## The macros below violate most autoconf and canonicalization standards
+AC_DEFUN(RTEMS_CONFIG_BUILD_SUBDIRS,
[
-define([RTEMS_TGT_SUBDIRS],
-ifdef([RTEMS_TGT_SUBDIRS], [RTEMS_TGT_SUBDIRS ],)[$1])dnl
-target_subdirs="RTEMS_TGT_SUBDIRS"
-AC_SUBST(target_subdirs)
+define([RTEMS_BUILD_SUBDIRS],
+ifdef([RTEMS_BUILD_SUBDIRS], [RTEMS_BUILD_SUBDIRS ],)[$1])dnl
+build_subdirs="RTEMS_BUILD_SUBDIRS"
+AC_SUBST(build_subdirs)
])
dnl Derived from automake-1.4's AC_OUTPUT_SUBDIRS
-AC_DEFUN(RTEMS_OUTPUT_SUBDIRS,
+AC_DEFUN(RTEMS_OUTPUT_BUILD_SUBDIRS,
[
if test "$no_recursion" != yes; then
- if test $target_alias != $host_alias; then
- target_subdir="$target_alias"
+ if test $build_alias != $host_alias; then
+ target_subdir="$host_alias"
else
target_subdir="."
fi
@@ -36,11 +38,13 @@ if test "$no_recursion" != yes; then
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
;;
+ --target*) ;;
+ --build*) ;;
+ --host*) ;;
*) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
esac
done
- test -d $target_subdir || mkdir $target_subdir
for ac_config_dir in $1; do
# Do not complain, so a configure script can configure whichever
@@ -49,24 +53,24 @@ if test "$no_recursion" != yes; then
continue
fi
- echo configuring in $target_subdir/$ac_config_dir
+ echo configuring in $ac_config_dir
case "$srcdir" in
## .) ;;
*)
- if test -d $target_subdir/$ac_config_dir || mkdir $target_subdir/$ac_config_dir; then :;
+ if test -d $ac_config_dir || mkdir $ac_config_dir; then :;
else
- AC_MSG_ERROR(can not create `pwd`/$target_subdir/$ac_config_dir)
+ AC_MSG_ERROR(can not create `pwd`/$ac_config_dir)
fi
;;
esac
ac_popdir=`pwd`
- cd $target_subdir/$ac_config_dir
+ cd $ac_config_dir
changequote(, )dnl
# A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo $target_subdir/$ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
changequote([, ])dnl
case "$srcdir" in
@@ -78,11 +82,9 @@ changequote([, ])dnl
ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
esac
- # Check for guested configure; otherwise get Cygnus style configure.
+ # Check for configure
if test -f $ac_sub_srcdir/configure; then
ac_sub_configure=$ac_sub_srcdir/configure
- elif test -f $ac_sub_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
else
AC_MSG_WARN(no configuration information is in $ac_config_dir)
ac_sub_configure=
@@ -90,17 +92,7 @@ changequote([, ])dnl
# The recursion is here.
if test -n "$ac_sub_configure"; then
-
- # Make the cache file name correct relative to the subdirectory.
- if test "$target_alias" != "$host_alias"; then
- ac_sub_cache_file=$cache_file
- else
- case "$cache_file" in
- /*) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file="$ac_dots$cache_file" ;;
- esac
- fi
+ ac_sub_cache_file=./config.cache
ifdef([AC_PROVIDE_AC_PROG_INSTALL],
[ case "$ac_given_INSTALL" in
changequote(, )dnl
@@ -113,8 +105,10 @@ changequote([, ])dnl
echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
# The eval makes quoting arguments work.
if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \
- $ac_sub_configure_args --srcdir=$ac_sub_srcdir \
- --with-target-subdir=$target_subdir --cache-file=$ac_sub_cache_file
+ $ac_sub_configure_args \
+ --srcdir=$ac_sub_srcdir \
+ --with-target-subdir=$target_subdir \
+ --cache-file=$ac_sub_cache_file
then :
else
AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)