aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in61
1 files changed, 44 insertions, 17 deletions
diff --git a/configure.in b/configure.in
index ae3ff2a..f849e26 100644
--- a/configure.in
+++ b/configure.in
@@ -67,19 +67,13 @@ progname=$0
if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
# Export original configure arguments for use by sub-configures. These
-# will be expanded once by make, and once by the shell, so they need to
-# have '$' quoted for make, and then each argument quoted for the shell.
-# What's more, the 'echo' below might expand backslashes.
-cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
+# will be expanded by make, so quote '$'.
+tmp="$progname $@"
+sed -e 's,\$,$$,g' <<EOF_SED > conftestsed.out
+$tmp
EOF_SED
-tmp="'$progname'"
-for ac_arg
-do
- tmp="$tmp '"`echo "$ac_arg" | sed -f conftestsed`
-done
-rm -f conftestsed
-TOPLEVEL_CONFIGURE_ARGUMENTS="$tmp"
+TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out`
+rm -f conftestsed.out
AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
moveifchange=${srcdir}/move-if-change
@@ -376,7 +370,7 @@ case "${target}" in
esac
;;
*-*-vxworks*)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}"
;;
alpha*-dec-osf*)
# ld works, but does not support shared libraries.
@@ -1766,7 +1760,14 @@ AC_SUBST_FILE(serialization_dependencies)
# Base args. Strip norecursion, cache-file, srcdir, host, build,
# target and nonopt. These are the ones we might not want to pass
-# down to subconfigures.
+# down to subconfigures. Also strip program-prefix, program-suffix,
+# and program-transform-name, so that we can pass down a consistent
+# program-transform-name. If autoconf has put single quotes around
+# any of these arguments (because they contain shell metacharacters)
+# then this will fail; in practice this only happens for
+# --program-transform-name, so be sure to override --program-transform-name
+# at the end of the argument list.
+# These will be expanded by make, so quote '$'.
cat <<\EOF_SED > conftestsed
s/ --no[[^ ]]* / /
s/ --c[[a-z-]]*[[= ]][[^ ]]* / /
@@ -1774,17 +1775,38 @@ s/ --sr[[a-z-]]*[[= ]][[^ ]]* / /
s/ --ho[[a-z-]]*[[= ]][[^ ]]* / /
s/ --bu[[a-z-]]*[[= ]][[^ ]]* / /
s/ --t[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / /
s/ -cache-file[[= ]][[^ ]]* / /
s/ -srcdir[[= ]][[^ ]]* / /
s/ -host[[= ]][[^ ]]* / /
s/ -build[[= ]][[^ ]]* / /
s/ -target[[= ]][[^ ]]* / /
+s/ -program-prefix[[= ]][[^ ]]* / /
+s/ -program-suffix[[= ]][[^ ]]* / /
+s/ -program-transform-name[[= ]][[^ ]]* / /
s/ [[^' -][^ ]*] / /
s/^ *//;s/ *$//
-s,\\,\\\\,g; s,\$,$$,g
+s,\$,$$,g
EOF_SED
-baseargs=`echo " ${ac_configure_args} " | sed -f conftestsed`
-rm -f conftestsed
+sed -f conftestsed <<EOF_SED > conftestsed.out
+ ${ac_configure_args}
+EOF_SED
+baseargs=`cat conftestsed.out`
+rm -f conftestsed conftestsed.out
+
+# Add in --program-transform-name, after --program-prefix and
+# --program-suffix have been applied to it. Autoconf has already
+# doubled dollar signs and backslashes in program_transform_name; we want
+# the backslashes un-doubled, and then the entire thing wrapped in single
+# quotes, because this will be expanded first by make and then by the shell.
+# Also, because we want to override the logic in subdir configure scripts to
+# choose program_transform_name, replace any s,x,x, with s,y,y,.
+sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
+${program_transform_name}
+EOF_SED
+gcc_transform_name=`cat conftestsed.out`
+rm -f conftestsed.out
+baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
# For the build-side libraries, we just need to pretend we're native,
# and not use the same cache file. Multilibs are neither needed nor
@@ -1897,6 +1919,10 @@ case " $target_configdirs " in
;;
esac
+# Allow the user to override the flags for
+# our build compiler if desired.
+CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
+
# On Canadian crosses, we'll be searching the right directories for
# the previously-installed cross compiler, so don't bother to add
# flags for directories within the install tree of the compiler
@@ -2038,6 +2064,7 @@ NCN_STRICT_CHECK_TOOL(OBJDUMP, objdump)
AC_SUBST(CC)
AC_SUBST(CXX)
AC_SUBST(CFLAGS)
+AC_SUBST(CFLAGS_FOR_BUILD)
AC_SUBST(CXXFLAGS)
AC_SUBST(DEFAULT_YACC)
AC_SUBST(DEFAULT_LEX)