summaryrefslogtreecommitdiff
path: root/Makefile.tpl
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2010-11-26 04:56:39 +0000
committerAlexandre Oliva <aoliva@redhat.com>2010-11-26 04:56:39 +0000
commit87cda2cf3f62b60931a386b2908dc2d0dd8e454f (patch)
tree0ab262a31e56c3b725711db72b747fb337f2d993 /Makefile.tpl
parent35515841e07297b45fdf15538808a0738acc8d9f (diff)
downloadbinutils-gdb-87cda2cf3f62b60931a386b2908dc2d0dd8e454f.tar.gz
PR other/46020
* configure.ac (CXX_FOR_TARGET): Add -funconfigured-libstdc++-v3. * Makefile.def (CXX_FOR_TARGET): Removed from flags_to_pass. * Makefile.tpl (CXX_FOR_TARGET_FLAG_TO_PASS): New. (BASE_FLAGS_TO_PASS): Use it. * configure: Rebuilt. * Makefile.in: Rebuilt.
Diffstat (limited to 'Makefile.tpl')
-rw-r--r--Makefile.tpl21
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile.tpl b/Makefile.tpl
index 2caa0bb1a44..f9a2936c33c 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -551,6 +551,26 @@ HOST_LIB_PATH_[+module+] = \
@endif [+module+]
[+ ENDIF lib_path +][+ ENDFOR host_modules +]
+CXX_FOR_TARGET_FLAG_TO_PASS = \
+ "CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
+@if target-libstdc++-v3
+# CXX_FOR_TARGET is tricky to get right for target libs that require a
+# functional C++ compiler. When we recurse, if we expand
+# CXX_FOR_TARGET before configuring libstdc++-v3, we won't get
+# libstdc++ include flags from the script. Instead, we get an
+# -funconfigured-* word, so that we'll get errors if this invalid C++
+# command line is used for anything, but also so that we can use the
+# word to decide whether or not to pass on this CXX_FOR_TARGET. If we
+# don't pass it on, sub-make will use the default definition, that
+# re-expands it at the time of use, so we'll get it right when we need
+# it. One potential exception is the expansion of CXX_FOR_TARGET
+# passed down as part of CXX within TARGET_FLAGS, but this wouldn't
+# really work, for C++ host programs can't depend on the current-stage
+# C++ target library.
+CXX_FOR_TARGET_FLAG_TO_PASS = \
+ $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi)
+@endif target-libstdc++-v3
+
# Flags to pass down to all sub-makes.
BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
"`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
@@ -558,6 +578,7 @@ BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
"STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \
"STAGE[+id+]_CXXFLAGS=$(STAGE[+id+]_CXXFLAGS)" \
"STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \
+ $(CXX_FOR_TARGET_FLAG_TO_PASS) \
"TFLAGS=$(TFLAGS)" \
"CONFIG_SHELL=$(SHELL)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"