]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/src/c++11/Makefile.am
re PR libstdc++/28811 (--with-pic vs static libraries and libstdc++)
[thirdparty/gcc.git] / libstdc++-v3 / src / c++11 / Makefile.am
index 69eb5b6dac60a75a92518537c0d9a8582fd39fee..1e3dd999a61f4d6815d64848d782134bac1b1240 100644 (file)
@@ -69,7 +69,7 @@ libc__11convenience_la_SOURCES = $(sources)  $(inst_sources)
 # as the occasion calls for it.
 AM_CXXFLAGS = \
        -std=gnu++11 \
-       $(PIC_CXXFLAGS) \
+       $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
        $(XTEMPLATE_FLAGS) \
        $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
 
@@ -78,11 +78,7 @@ AM_MAKEFLAGS = \
 
 # Libtool notes
 
-# 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
-# last. (That way, things like -O2 passed down from the toplevel can
-# be overridden by --enable-debug.)
-
-# 2) In general, libtool expects an argument such as `--tag=CXX' when
+# 1) In general, libtool expects an argument such as `--tag=CXX' when
 # using the C++ compiler, because that will enable the settings
 # detected when C++ support was being configured.  However, when no
 # such flag is given in the command line, libtool attempts to figure
@@ -94,8 +90,18 @@ AM_MAKEFLAGS = \
 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
 # attempt to infer which configuration to use.
-# We have to put --tag disable-shared after --tag CXX lest things
-# CXX undo the affect of disable-shared.
+# 
+# The second tag argument, `--tag disable-shared` means that libtool
+# only compiles each source once, for static objects. In actuality,
+# glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to
+# the libtool command that is used create the object, which is
+# suitable for shared libraries.  The `--tag disable-shared` must be
+# placed after --tag CXX lest things CXX undo the affect of
+# disable-shared.
+
+# 2) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
+# last. (That way, things like -O2 passed down from the toplevel can
+# be overridden by --enable-debug.)
 LTCXXCOMPILE = \
        $(LIBTOOL) --tag CXX --tag disable-shared \
        $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \