# up critical shell variables.
GLIBCXX_CONFIGURE
+# Libtool setup.
if test "x${with_newlib}" != "xyes"; then
AC_LIBTOOL_DLOPEN
fi
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'`
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: