Allow Makefile to pick up environmental CFLAGS_FOR_TARGET, and
Jing Yu [Thu, 12 Aug 2010 22:52:15 +0000 (15:52 -0700)]
CXXFLAGS_FOR_TARGET. So that libstdc++_v3 libraries can be built
without modifying the Makefiles.

Change-Id: I569febd84a1bf60b15b19030064b4d9996c93bb0
Tested:
  export CFLAGS_FOR_TARGET=-fexceptions
  export CXXFLAGS_FOR_TARGET=-frtti
  Add --enable-libstdc__-v3 to the configuration command, build a C++
  supportive toolchain.

Makefile.in
README

index 60307f4..2c905de 100644 (file)
@@ -98,11 +98,11 @@ export      CC_FOR_TARGET="$(TARGET_GCC_BUILDDIR)/gcc/xgcc \
 # 
 # To build libstdc++ with RTTI and exceptions do:
 #
-#CFLAGS_FOR_TARGET= -O2 -Os -g -fexceptions
-#CXXFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET) -frtti
-# 
-CFLAGS_FOR_TARGET= -O2 -Os -g
-CXXFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)
+#export CFLAGS_FOR_TARGET=-fexceptions
+#export CXXFLAGS_FOR_TARGET=-frtti
+#
+CFLAGS_FOR_TARGET+= -O2 -Os -g
+CXXFLAGS_FOR_TARGET+=$(CFLAGS_FOR_TARGET)
 LDFLAGS_FOR_TARGET=
 
 # Helper
@@ -357,8 +357,8 @@ clean:
 .PHONY: distclean
 distclean:
        @$(RM) -r config.log config.status \
-                 $(TEMP_INSTALLDIR) temp-src \
-                 stmp-config-* stmp-build-* stmp-install-* && \
+                 $(TEMP_INSTALLDIR) temp-src \
+                 stmp-config-* stmp-build-* stmp-install-* && \
        for sub in [ * ]; do \
          if [ -f $$sub/config.status ]; then \
            echo "Deleting " $$sub "..." && $(RM) -r $$sub ; \
diff --git a/README b/README
index 9711518..f349706 100644 (file)
--- a/README
+++ b/README
@@ -101,7 +101,12 @@ remove these installed headers.
 2.4 Enabling libstdc++-v3
 
 For space saving, we do not provide libstdc++-v3 in the toolchain by default.
-It is possible too build libstdc++-v3.  The enable it, add
+It is possible too build libstdc++-v3. To enable it, do
+
+       export CFLAGS_FOR_TARGET=-fexceptions
+       export CXXFLAGS_FOR_TARGET=-frtti
+
+before configuring the toolchain, and add
 
        --enable-libstdc__-v3