X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=configure.in;h=539a7f9f09bf17d889bf44cd789fc6ace630702c;hb=a514e35b2ef53c881d26aace440392617de4f993;hp=22888b3b663ae52d7cf76435c754f72235846b20;hpb=0894307c7efad4fa280f61bef538093db1479280;p=pf3gnuchains%2Fgcc-fork.git diff --git a/configure.in b/configure.in index 22888b3b663..539a7f9f09b 100644 --- a/configure.in +++ b/configure.in @@ -66,8 +66,14 @@ progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi -# Export original configure arguments for use by sub-configures. -TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@" +# Export original configure arguments for use by sub-configures. These +# will be expanded by make, so quote '$'. +tmp="$progname $@" +sed -e 's,\$,$$,g' < conftestsed.out +$tmp +EOF_SED +TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out` +rm -f conftestsed.out AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS) moveifchange=${srcdir}/move-if-change @@ -242,7 +248,8 @@ esac # If both --with-headers and --with-libs are specified, default to # --without-newlib. -if test x"${with_headers}" != x && test x"${with_libs}" != x ; then +if test x"${with_headers}" != x && test x"${with_headers} != xno \ + && test x"${with_libs}" != x && test x"${with_libs} != xno ; then if test x"${with_newlib}" = x ; then with_newlib=no fi @@ -363,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. @@ -378,7 +385,7 @@ case "${target}" in # newlib is not 64 bit ready noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; - alpha*-*-freebsd*) + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; alpha*-*-*) @@ -499,7 +506,7 @@ case "${target}" in i[[3456789]]86-*-coff | i[[3456789]]86-*-elf) noconfigdirs="$noconfigdirs ${libgcj}" ;; - i[[3456789]]86-*-freebsd*) + i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; i[[3456789]]86-*-linux*) @@ -926,7 +933,7 @@ copy_dirs= # Handle --with-headers=XXX. If the value is not "yes", the contents of # the named directory are copied to $(tooldir)/sys-include. -if test x"${with_headers}" != x ; then +if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then if test x${is_cross_compiler} = xno ; then echo 1>&2 '***' --with-headers is only supported when cross compiling exit 1 @@ -943,7 +950,7 @@ fi # Handle --with-libs=XXX. If the value is not "yes", the contents of # the name directories are copied to $(tooldir)/lib. Multiple directories # are permitted. -if test x"${with_libs}" != x ; then +if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then if test x${is_cross_compiler} = xno ; then echo 1>&2 '***' --with-libs is only supported when cross compiling exit 1 @@ -1753,21 +1760,53 @@ 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. -baseargs=`echo " ${ac_configure_args} " | \ - sed -e 's/ --no[[^ ]]* / /' \ - -e 's/ --c[[a-z-]]*[[= ]][[^ ]]* / /' \ - -e 's/ --sr[[a-z-]]*[[= ]][[^ ]]* / /' \ - -e 's/ --ho[[a-z-]]*[[= ]][[^ ]]* / /' \ - -e 's/ --bu[[a-z-]]*[[= ]][[^ ]]* / /' \ - -e 's/ --t[[a-z-]]*[[= ]][[^ ]]* / /' \ - -e 's/ -cache-file[[= ]][[^ ]]* / /' \ - -e 's/ -srcdir[[= ]][[^ ]]* / /' \ - -e 's/ -host[[= ]][[^ ]]* / /' \ - -e 's/ -build[[= ]][[^ ]]* / /' \ - -e 's/ -target[[= ]][[^ ]]* / /' \ - -e "s/ [[^' -][^ ]*] / /" \ - -e 's/^ *//;s/ *$//'` +# 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-]]*[[= ]][[^ ]]* / / +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 +EOF_SED +sed -f conftestsed < 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,/" < 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 @@ -1880,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 @@ -1919,10 +1962,12 @@ GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' # Don't use libstdc++-v3's flags to configure/build itself. libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' -raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' if test "x${CXX_FOR_TARGET+set}" = xset; then - : + if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then + RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET} + fi elif test -d ${srcdir}/gcc; then # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead # of g++ for linking C++ or Java, because g++ has -shared-libgcc by @@ -2019,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)