This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] toplevel configure.in: pull definition of is_cross_compiler higher
- From: Nathanael Nerode <neroden at doctormoo dot dyndns dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: gdb-patches at sources dot redhat dot com, binutils at sources dot redhat dot com,dj at redhat dot com
- Date: Tue, 18 Jun 2002 17:26:58 -0400
- Subject: [patch] toplevel configure.in: pull definition of is_cross_compiler higher
I put in this patch a while back and got it approved, but withdrew it
because I found a subtle bug.
If my patch http://gcc.gnu.org/ml/gcc-patches/2002-06/msg01561.html is applied
first, then this can be applied with no risk of that bug.
Tested on i686-pc-linux-gnu, still doesn't change any generated files. :-)
2002-06-18 Nathanael Nerode <neroden@twcny.rr.com>
* configure.in: Pull definition of is_cross_compiler earlier.
--- configure.in.old Tue Jun 18 17:10:02 2002
+++ configure.in Tue Jun 18 17:21:30 2002
@@ -120,6 +120,14 @@
# per-target:
+# Define is_cross_compiler to save on calls to 'test'.
+is_cross_compiler=
+if test x"${host}" = x"${target}" ; then
+ is_cross_compiler=no
+else
+ is_cross_compiler=yes
+fi
+
# Don't use libstdc++-v3's flags to configure/build itself.
libstdcxx_flags='`case $$dir in libstdc++-v3 | libjava) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
@@ -428,19 +436,10 @@
# toolchains, we add some directories that should only be useful in a
# cross-compiler.
-is_cross_compiler=
-
-if test x"${host}" = x"${target}" ; then
- # when doing a native toolchain, don't build the targets
- # that are in the 'cross only' list
- skipdirs="${skipdirs} ${cross_only}"
- is_cross_compiler=no
-else
- # similarly, don't build the targets in the 'native only'
- # list when building a cross compiler
- skipdirs="${skipdirs} ${native_only}"
- is_cross_compiler=yes
-fi
+case $is_cross_compiler in
+ no) skipdirs="${skipdirs} ${cross_only}" ;;
+ yes) skipdirs="${skipdirs} ${native_only}" ;;
+esac
# We always want to use the same name for this directory, so that dejagnu
# can reliably find it.