This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Toplevel (b-i-b) patch: Clean up CXX_FOR_TARGET


This is my first pass at cleaning up the rather confusing state of
CXX_FOR_TARGET.  I _expect_ that the whole qCXX_FOR_TARGET && 
CXX_FOR_TARGET_FOR_RECURSIVE_MAKE business can go away, but I'm not 
certain of that yet.  At any rate, this replaces an embedded case statement
inside a make macro (!) with two make macros and an Autogen if statement to
select between them.  It makes me happy. :-)

This is diffed against 3.4bib, where it will apply.  Tested with a full, clean
bootstrap on i686-pc-linux-gnu; everything appears to work.

	* configure.in: Introduce RAW_CXX_FOR_TARGET and simplify embedded
	shell code in CXX_FOR_TARGET
	* Makefile.def: Introduce raw_cxx.
	* Makefile.tpl: Use raw_cxx to select between CXX_FOR_TARGET and
	RAW_CXX_FOR_TARGET.
	* Makefile.in: Regenerate.

Index: Makefile.def
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.def,v
retrieving revision 1.2.2.6
diff -u -r1.2.2.6 Makefile.def
--- Makefile.def	19 Nov 2002 06:37:04 -0000	1.2.2.6
+++ Makefile.def	21 Nov 2002 21:24:12 -0000
@@ -72,7 +72,7 @@
 host_modules= { module= libtermcap; no_check=true; no_clean=true; };
 host_modules= { module= utils; no_check=true; };
 
-target_modules = { module= libstdc++-v3; };
+target_modules = { module= libstdc++-v3; raw_cxx=true; };
 target_modules = { module= newlib; };
 target_modules = { module= libf2c; };
 target_modules = { module= libobjc; };
@@ -83,7 +83,7 @@
 target_modules = { module= gperf; };
 target_modules = { module= examples; no_check=true; no_install=true; };
 target_modules = { module= libffi; no_install=true; };
-target_modules = { module= libjava; };
+target_modules = { module= libjava; raw_cxx=true; };
 target_modules = { module= zlib; };
 target_modules = { module= boehm-gc; };
 target_modules = { module= qthreads; };
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.in,v
retrieving revision 1.111.4.15
diff -u -r1.111.4.15 Makefile.in
--- Makefile.in	21 Nov 2002 19:22:19 -0000	1.111.4.15
+++ Makefile.in	21 Nov 2002 21:24:18 -0000
@@ -253,7 +253,9 @@
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 CC_FOR_TARGET = @CC_FOR_TARGET@
 CXX_FOR_TARGET = @CXX_FOR_TARGET@
+RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
+RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
 
 # If GCC_FOR_TARGET is not overriden on the command line, then this
@@ -436,7 +438,8 @@
 # so we pass these variables down unchanged.  They must not contain
 # single nor double quotes.
 RECURSE_FLAGS = \
-	CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
+	CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
+	RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
 
 # Flags to pass down to most sub-makes, in which we're building with
 # the host environment.
@@ -4176,7 +4179,8 @@
 	    AS="$(AS_FOR_TARGET)"; export AS; \
 	    CC="$(CC_FOR_TARGET)"; export CC; \
 	    CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	    CXX="$(CXX_FOR_TARGET)"; export CXX; \
+	    CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+	    CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
 	    CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
 	    GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
 	    DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
@@ -4254,7 +4258,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libstdc++-v3; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  all); \
 	else \
 	  true; \
 	fi
@@ -4267,7 +4271,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libstdc++-v3; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  check); \
 	else \
 	  true; \
 	fi
@@ -4401,7 +4405,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/newlib; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -4414,7 +4418,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/newlib; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -4548,7 +4552,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libf2c; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -4561,7 +4565,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libf2c; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -4695,7 +4699,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libobjc; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -4708,7 +4712,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libobjc; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -4842,7 +4846,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libtermcap; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -4980,7 +4984,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/winsup; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -4993,7 +4997,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/winsup; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -5127,7 +5131,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libgloss; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -5265,7 +5269,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libiberty; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -5278,7 +5282,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libiberty; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -5412,7 +5416,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/gperf; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -5425,7 +5429,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/gperf; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -5559,7 +5563,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/examples; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -5688,7 +5692,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libffi; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -5701,7 +5705,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libffi; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -5748,7 +5752,8 @@
 	    AS="$(AS_FOR_TARGET)"; export AS; \
 	    CC="$(CC_FOR_TARGET)"; export CC; \
 	    CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	    CXX="$(CXX_FOR_TARGET)"; export CXX; \
+	    CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+	    CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
 	    CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
 	    GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
 	    DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
@@ -5826,7 +5831,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libjava; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  all); \
 	else \
 	  true; \
 	fi
@@ -5839,7 +5844,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/libjava; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  check); \
 	else \
 	  true; \
 	fi
@@ -5973,7 +5978,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/zlib; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -5986,7 +5991,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/zlib; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -6120,7 +6125,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/boehm-gc; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -6133,7 +6138,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/boehm-gc; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -6267,7 +6272,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/qthreads; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -6280,7 +6285,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/qthreads; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
@@ -6414,7 +6419,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/rda; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  all); \
 	else \
 	  true; \
 	fi
@@ -6427,7 +6432,7 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/rda; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS)  check); \
 	else \
 	  true; \
 	fi
Index: Makefile.tpl
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.tpl,v
retrieving revision 1.5.2.13
diff -u -r1.5.2.13 Makefile.tpl
--- Makefile.tpl	21 Nov 2002 19:22:19 -0000	1.5.2.13
+++ Makefile.tpl	21 Nov 2002 21:24:20 -0000
@@ -256,7 +256,9 @@
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 CC_FOR_TARGET = @CC_FOR_TARGET@
 CXX_FOR_TARGET = @CXX_FOR_TARGET@
+RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
+RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
 
 # If GCC_FOR_TARGET is not overriden on the command line, then this
@@ -439,7 +441,8 @@
 # so we pass these variables down unchanged.  They must not contain
 # single nor double quotes.
 RECURSE_FLAGS = \
-	CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
+	CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
+	RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
 
 # Flags to pass down to most sub-makes, in which we're building with
 # the host environment.
@@ -1004,8 +1007,13 @@
 	    AR="$(AR_FOR_TARGET)"; export AR; \
 	    AS="$(AS_FOR_TARGET)"; export AS; \
 	    CC="$(CC_FOR_TARGET)"; export CC; \
-	    CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	    CXX="$(CXX_FOR_TARGET)"; export CXX; \
+	    CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \[+ 
+	IF raw_cxx +]
+	    CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+	    CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ 
+	ELSE normal_cxx +]
+	    CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ 
+	ENDIF raw_cxx +]
 	    CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
 	    GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
 	    DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
@@ -1083,7 +1091,11 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/[+module+]; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
+	       IF raw_cxx 
+	         +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
+	       ENDIF raw_cxx 
+	    +] all); \
 	else \
 	  true; \
 	fi
@@ -1100,7 +1112,11 @@
 	  s=`cd $(srcdir); ${PWD}`; export s; \
 	  $(SET_LIB_PATH) \
 	  (cd $(TARGET_SUBDIR)/[+module+]; \
-	    $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+	    $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
+	       IF raw_cxx 
+	         +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
+	       ENDIF raw_cxx 
+	    +] check); \
 	else \
 	  true; \
 	fi
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.177.4.8
diff -u -r1.177.4.8 configure.in
--- configure.in	21 Nov 2002 19:22:19 -0000	1.177.4.8
+++ configure.in	21 Nov 2002 21:24:22 -0000
@@ -1570,7 +1570,8 @@
 esac
 
 # 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'
+libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/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'
 
 if test "x${CXX_FOR_TARGET+set}" = xset; then
   :
@@ -1578,17 +1579,28 @@
   # 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
   # default whereas gcc does not.
-  CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3 | libjava) echo xgcc -shared-libgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
+  # RAW_CXX_FOR_TARGET is for linking C++ or java; CXX_FOR_TARGET is for
+  # all other cases.
+  CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
+  RAW_CXX_FOR_TARGET='$$r/gcc/xgcc -shared-libgcc -B$$r/gcc/ -nostdinc++ '$raw_libstdcxx_flags
 elif test "$host" = "$target"; then
   CXX_FOR_TARGET='$(CXX)'
+  RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
 else
   CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
+  RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
 fi
 case $CXX_FOR_TARGET in
 *' $(FLAGS_FOR_TARGET)') ;;
 *) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
 esac
+case $RAW_CXX_FOR_TARGET in
+*' $(FLAGS_FOR_TARGET)') ;;
+*) RAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
+esac
+
 qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
+qRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
 
 # We want to defer the evaluation of `cmd`s and shell variables in
 # CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
@@ -1597,6 +1609,7 @@
 # can be expanded by the nested make as shell variables, not as make
 # macros.
 qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
+qqRAW_CXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
 
 sedtemp=sed.$$
 cat >$sedtemp <<EOF
@@ -1616,7 +1629,9 @@
 s%@CC_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}%
 s%@GCJ_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}%
 s%@CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}%
+s%@RAW_CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}%
 s%@CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}%
+s%@RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}%
 s%@target_subdir@%${target_subdir}%
 s%@build_subdir@%${build_subdir}%
 s%@build_configargs@%${buildargs}%


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]