OSDN Git Service

2003-01-24 Ranjit Mathew <rmathew@hotmail.com>
[pf3gnuchains/gcc-fork.git] / configure.in
index 7fc3b9c..531e188 100644 (file)
@@ -1,5 +1,5 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+#   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
 ### WARNING: this file contains embedded tabs.  Do not run untabify on this file.
 
 AC_INIT(move-if-change)
+AC_PREREQ(2.13)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
@@ -82,7 +83,7 @@ if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
 
 # Export original configure arguments for use by sub-configures.
 TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
-export TOPLEVEL_CONFIGURE_ARGUMENTS
+AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
 
 moveifchange=${srcdir}/move-if-change
 
@@ -160,7 +161,7 @@ target_libs="target-libiberty \
                target-newlib \
                ${libstdcxx_version} \
                target-libf2c \
-               ${libgcj}
+               ${libgcj} \
                target-libobjc"
 
 # these tools are built using the target libs, and are intended to run only
@@ -200,7 +201,7 @@ fi
 
 # We always want to use the same name for this directory, so that dejagnu
 # can reliably find it.
-target_subdir=${target_alias}
+target_subdir=${target}
 
 if test ! -d ${target_subdir} ; then
   if mkdir ${target_subdir} ; then true
@@ -210,8 +211,7 @@ if test ! -d ${target_subdir} ; then
   fi
 fi
 
-build_prefix=build-
-build_subdir=${build_prefix}${build_alias}
+build_subdir=build-${build}
 
 if test x"${build_alias}" != x"${host}" ; then
   if test ! -d ${build_subdir} ; then
@@ -639,12 +639,11 @@ case "${target}" in
     noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
     ;;
   mips*-*-irix6*)
-    # The GNU assembler does not support IRIX 6.
     # Linking libjava exceeds command-line length limits on at least
     # IRIX 6.2, but not on IRIX 6.5.
     # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
     # <oldham@codesourcery.com>
-    noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
   mips*-dec-bsd*)
     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
@@ -867,20 +866,6 @@ if test -n "${target_configdirs}" ; then
   fi
 fi
 
-# Deconfigure all subdirectories, in case we are changing the
-# configuration from one where a subdirectory is supported to one where it
-# is not.
-if test -z "${norecursion}" && test -n "${configdirs}" ; then
-  for i in `echo ${configdirs} | sed -e s/target-//g` ; do
-    rm -f $i/Makefile
-  done
-fi
-if test -z "${norecursion}" && test -n "${target_configdirs}" ; then
-  for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
-    rm -f ${target_subdir}/$i/Makefile
-  done
-fi
-
 # Quietly strip out all directories which aren't configurable in this tree.
 # This relies on all configurable subdirectories being autoconfiscated, which
 # is now the case.
@@ -1667,13 +1652,24 @@ target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
 # This is the final value for target_configdirs.  configdirs already
 # has its final value.  It's time to create some lists of valid targets.
 
+# While at that, we remove Makefiles if we were started for recursive
+# configuration, such that the top-level Makefile reconfigures them,
+# like we used to do when configure itself was recursive.
+
 all_build_modules=
 configure_build_modules=
 # Only make build modules if build != host.
 # This should be done more generally, but at the moment it doesn't matter.
 if test ${host_alias} != ${build_alias} ; then
-  all_build_modules=all-build-libiberty
-  configure_build_modules=configure-build-libiberty
+  for module in libiberty ; do
+    all_build_modules=all-build-${module}
+    configure_build_modules=configure-build-${module}
+    if test -z "${no_recursion}" \
+       && test -f ${build_subdir}/${module}/Makefile; then
+      echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
+      rm -f ${build_subdir}/${module}/Makefile
+    fi
+  done
 fi
 
 all_host_modules=
@@ -1685,6 +1681,11 @@ for module in ${configdirs} ; do
   check_host_modules="${check_host_modules} check-${module}"
   install_host_modules="${install_host_modules} install-${module}"
   configure_host_modules="${configure_host_modules} configure-${module}"
+  if test -z "${no_recursion}" \
+     && test -f ${module}/Makefile; then
+    echo 1>&2 "*** removing ${module}/Makefile to force reconfigure"
+    rm -f ${module}/Makefile
+  fi
 done
 install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'`
 
@@ -1697,6 +1698,11 @@ for module in ${target_configdirs} ; do
   check_target_modules="${check_target_modules} check-target-${module}"
   install_target_modules="${install_target_modules} install-target-${module}"
   configure_target_modules="${configure_target_modules} configure-target-${module}"
+  if test -z "${no_recursion}" \
+     && test -f ${target_subdir}/${module}/Makefile; then
+    echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
+    rm -f ${target_subdir}/${module}/Makefile
+  fi
 done
 
 # Determine whether gdb needs tk/tcl or not.
@@ -1787,11 +1793,16 @@ AC_SUBST_FILE(serialization_dependencies)
 # down to subconfigures.
 baseargs=`echo " ${ac_configure_args} " | \
        sed -e 's/ --no[[^ ]]* / /' \
-           -e 's/ --cache[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ --sr[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ --ho[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ --bu[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ --ta[[a-z-]]*=[[^ ]]* / /' \
+           -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/ *$//'`