diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-20 02:10:22 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-20 02:10:22 +0000 |
commit | eaf4b52d10e8399420a931445d290a5b470cd56e (patch) | |
tree | 83818fa8812212f4c4643f4ab5975bed4c9efd59 /libstdc++-v3/configure.ac | |
parent | 07cf7615dafa0714bf2c4fc5bd37e52c16a2e9cb (diff) | |
download | gcc-eaf4b52d10e8399420a931445d290a5b470cd56e.tar.gz |
2012-09-18 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/28811
PR libstdc++/54482
* configure.ac (glibcxx_lt_pic_flag,
glibcxx_compiler_pic_flag,
glibcxx_compiler_shared_flag): New. Use them.
(lt_prog_compiler_pic_CXX): Set via glibcxx_*_flag(s) above.
(pic_mode): Set to default.
(PIC_CXXFLAGS): Remove.
* Makefile.am (PICFLAG, PICFLAG_FOR_TARGET): Remove. Comment.
* libsupc++/Makefile.am: Use glibcxx_ld_pic_flag and
glibcxx_compiler_shared_flag. Comment.
* src/c++11/Makefile.am: Same.
* src/c++98/Makefile.am: Same.
* src/Makefile.am: Use glibcxx_compiler_pic_flag.
* Makefile.in: Regenerated.
* aclocal.m4: Same.
* configure: Same.
* doc/Makefile.in: Same.
* include/Makefile.in: Same.
* libsupc++/Makefile.in: Same.
* po/Makefile.in: Same.
* python/Makefile.in: Same.
* src/Makefile.in: Same.
* src/c++11/Makefile.in: Same.
* src/c++98/Makefile.in: Same.
* testsuite/Makefile.in: Same.
* src/c++11/compatibility-atomic-c++0x.cc: Use
_GLIBCXX_SHARED instead of PIC to designate shared-only
code blocks.
* src/c++11/compatibility-c++0x.cc: Same.
* src/c++11/compatibility-thread-c++0x.cc: Same.
* src/c++98/compatibility-list-2.cc: Same.
* src/c++98/compatibility.cc: : Same.
* testsuite/17_intro/shared_with_static_deps.cc: New.
* doc/xml/manual/build_hacking.xml: Separate configure from
make/build issues, add build details.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191509 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/configure.ac')
-rw-r--r-- | libstdc++-v3/configure.ac | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 3943669a7eb..aff19f58395 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -88,6 +88,7 @@ CXXFLAGS="$save_CXXFLAGS" # up critical shell variables. GLIBCXX_CONFIGURE +# Libtool setup. if test "x${with_newlib}" != "xyes"; then AC_LIBTOOL_DLOPEN fi @@ -96,6 +97,38 @@ ACX_LT_HOST_FLAGS AC_SUBST(enable_shared) AC_SUBST(enable_static) +# libtool variables for C++ shared and position-independent compiles. +# +# Use glibcxx_lt_pic_flag to designate the automake variable +# used to encapsulate the default libtool approach to creating objects +# with position-independent code. Default: -prefer-pic. +# +# Use glibcxx_compiler_shared_flag to designate a compile-time flags for +# creating shared objects. Default: -D_GLIBCXX_SHARED. +# +# Use glibcxx_compiler_pic_flag to designate a compile-time flags for +# creating position-independent objects. This varies with the target +# hardware and operating system, but is often: -DPIC -fPIC. +if test "$enable_shared" = yes; then + glibcxx_lt_pic_flag="-prefer-pic" + glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX" + glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED" + +else + glibcxx_lt_pic_flag= + glibcxx_compiler_pic_flag= + glibcxx_compiler_shared_flag= +fi +AC_SUBST(glibcxx_lt_pic_flag) +AC_SUBST(glibcxx_compiler_pic_flag) +AC_SUBST(glibcxx_compiler_shared_flag) + +# Override the libtool's pic_flag and pic_mode. +# Do this step after AM_PROG_LIBTOOL, but before AC_OUTPUT. +# NB: this impacts --with-pic and --without-pic. +lt_prog_compiler_pic_CXX="$glibcxx_compiler_pic_flag $glibcxx_compiler_shared_flag" +pic_mode='default' + # Eliminate -lstdc++ addition to postdeps for cross compiles. postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` @@ -430,13 +463,6 @@ GLIBCXX_EXPORT_INSTALL_INFO GLIBCXX_EXPORT_INCLUDES GLIBCXX_EXPORT_FLAGS -if test "$enable_shared" = yes; then - PIC_CXXFLAGS="-prefer-pic" -else - PIC_CXXFLAGS= -fi -AC_SUBST(PIC_CXXFLAGS) - dnl In autoconf 2.5x, AC_OUTPUT is replaced by four AC_CONFIG_* macros, dnl which can all be called multiple times as needed, plus one (different) dnl AC_OUTPUT macro. This one lists the files to be created: |