diff options
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: |