summaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2002-11-19 14:17:00 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2002-11-19 14:17:00 +0000
commit9e4d71058eb4fa41101a481d7c475a3cf36dd22d (patch)
tree62ff40a50de1466acd794b3b29085504d16b783f /acinclude.m4
parent824bf2e454bca0f3d444b587b2453cd33cce7114 (diff)
downloadrtems-9e4d71058eb4fa41101a481d7c475a3cf36dd22d.tar.bz2
2002-11-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* acinclude.m4: Lots of changes addressing PR 312.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m481
1 files changed, 54 insertions, 27 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 5defa283f4..ddd7028c76 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -171,12 +171,7 @@ _RTEMS_ARG_VAR([CXXFLAGS_FOR_$2],
if test "$no_recursion" != yes; then
if test -n "${$2_SUBDIRS}"; then
- RTEMS_CONFIGURE_ARGS_QUOTE([ac_sub_configure_args],[
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- ;;
- ],[$1args])
+ ac_sub_configure_args="[$]$1args"
# Always prepend --prefix to ensure using the same prefix
# in subdir configurations.
@@ -226,13 +221,12 @@ if test "$no_recursion" != yes; then
ac_sub_cache_file=$ac_top_builddir$cache_file ;;
esac
- ac_sub_configure_args="$ac_sub_configure_args '--cache-file=$ac_sub_cache_file'"
- ac_sub_configure_args="$ac_sub_configure_args '--srcdir=$ac_srcdir'"
-
- # The eval makes quoting arguments work.
ac_sub_configure_vars=
+ ac_sub_configure_vars="$ac_sub_configure_vars '--cache-file=$ac_sub_cache_file'"
+ ac_sub_configure_vars="$ac_sub_configure_vars '--srcdir=$ac_srcdir'"
+
test -n "[$]CC_FOR_$2" && \
- ac_sub_configure_vars="'CC=[$]CC_FOR_$2'"
+ ac_sub_configure_vars="$ac_sub_configure_vars 'CC=[$]CC_FOR_$2'"
test -n "[$]CXX_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CXX=[$]CXX_FOR_$2'"
test -n "[$]CFLAGS_FOR_$2" && \
@@ -240,6 +234,7 @@ if test "$no_recursion" != yes; then
test -n "[$]CXXFLAGS_FOR_$2" && \
ac_sub_configure_vars="$ac_sub_configure_vars 'CXXFLAGS=[$]CXXFLAGS_FOR_$2'"
+ # The eval makes quoting arguments work.
AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args $ac_sub_configure_vars])
eval $ac_sub_configure $ac_sub_configure_args $ac_sub_configure_vars ||
AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
@@ -266,34 +261,64 @@ m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
AC_DEFUN([_RTEMS_CONFIGURE_ARGS_PRUNE],
[
- for ac_arg in m4_if([$3],,[$ac_configure_args],[[$]$3]); do
+$1_prune()
+{
+ $1=
+ for ac_arg
+ do
if test -n "$ac_prev"; then
ac_prev=
continue
fi
- # the eval casts away sh quotes
- case `eval echo $ac_arg` in
+ case $ac_arg in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+ | --c=*)
+ ;;
+ --config-cache | -C)
+ ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+
-host* | --host* );;
- -host ) ac_prev=host_alias;;
+ -host | --host )
+ ac_prev=host_alias;;
-target* | --target* );;
- -target | --target ) ac_prev=target_alias;;
+ -target | --target )
+ ac_prev=target_alias;;
-build* | --build* );;
- -build | --build ) ac_prev=build_alias;;
- --cache* );;
+ -build | --build )
+ ac_prev=build_alias;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ ;;
+
*_alias=* );;
+
m4_if([$2],,,[$2])
*) $1="$$1 '$ac_arg'" ;;
esac
done
+ export $1
+}
])
AC_DEFUN(_RTEMS_BUILD_CONFIG_PREPARE,[
-# Record the configure arguments in Makefile.
+## # Record the configure arguments in Makefile.
m4_ifdef([_RTEMS_BUILD_CONFIGDIRS_LIST],
[
-_RTEMS_CONFIGURE_ARGS_PRUNE([buildargs])
+m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([buildargs])])
+eval buildargs_prune $ac_configure_args
buildargs="'--host=${build}' '--build=${build}' '--target=${target_alias}' ${buildargs}"
-AC_SUBST(buildargs)
+## AC_SUBST(buildargs)
build_subdir="."
],[])
@@ -328,10 +353,11 @@ m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
AC_DEFUN(_RTEMS_HOST_CONFIG_PREPARE,[
m4_ifdef([_RTEMS_HOST_CONFIGDIRS_LIST],
[
-# Record configure arguments in Makefile.
-_RTEMS_CONFIGURE_ARGS_PRUNE([hostargs])
+## Record configure arguments in Makefile.
+m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([hostargs])])
+eval hostargs_prune $ac_configure_args
hostargs="'--host=${host_alias}' '--build=${build}' '--target=${target_alias}' ${hostargs}"
-AC_SUBST(hostargs)
+## AC_SUBST(hostargs)
host_subdir="${host_alias}"
],[])
@@ -366,10 +392,11 @@ m4_expand_once([_RTEMS_COMMANDS_POST_CONFIG_SUBDIRS])
AC_DEFUN(_RTEMS_TARGET_CONFIG_PREPARE,[
m4_ifdef([_RTEMS_TARGET_CONFIGDIRS_LIST],
[
-# Record the configure arguments in Makefile.
-_RTEMS_CONFIGURE_ARGS_PRUNE([targetargs])
+## Record the configure arguments in Makefile.
+m4_expand_once([_RTEMS_CONFIGURE_ARGS_PRUNE([targetargs])])
+eval targetargs_prune $ac_configure_args
targetargs="'--host=${target_alias}' '--build=${build}' '--target=${target_alias}' ${targetargs}"
-AC_SUBST(targetargs)
+## AC_SUBST(targetargs)
target_subdir="${target_alias}"
],[])