summaryrefslogtreecommitdiff
path: root/libstdc++-v3/configure
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-20 02:10:22 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-20 02:10:22 +0000
commiteaf4b52d10e8399420a931445d290a5b470cd56e (patch)
tree83818fa8812212f4c4643f4ab5975bed4c9efd59 /libstdc++-v3/configure
parent07cf7615dafa0714bf2c4fc5bd37e52c16a2e9cb (diff)
downloadgcc-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')
-rwxr-xr-xlibstdc++-v3/configure72
1 files changed, 50 insertions, 22 deletions
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 1f50a1ca121..7e68712cb75 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -602,7 +602,6 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
-PIC_CXXFLAGS
WARN_FLAGS
OPTIMIZE_CXXFLAGS
TOPLEVEL_INCLUDES
@@ -715,6 +714,9 @@ GLIBCXX_BUILD_PCH_FALSE
GLIBCXX_BUILD_PCH_TRUE
GLIBCXX_HOSTED_FALSE
GLIBCXX_HOSTED_TRUE
+glibcxx_compiler_shared_flag
+glibcxx_compiler_pic_flag
+glibcxx_lt_pic_flag
enable_static
enable_shared
lt_host_flags
@@ -3528,11 +3530,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
+# Always define AMTAR for backward compatibility.
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
@@ -5285,6 +5287,7 @@ $as_echo "$as_me: OS config directory is $os_include_dir" >&6;}
+# Libtool setup.
if test "x${with_newlib}" != "xyes"; then
enable_dlopen=yes
@@ -11510,7 +11513,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11513 "configure"
+#line 11516 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11616,7 +11619,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11619 "configure"
+#line 11622 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14903,6 +14906,38 @@ esac
+# 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
+
+
+
+
+# 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'`
@@ -14998,7 +15033,7 @@ fi
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
-#line 15001 "configure"
+#line 15036 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -15333,7 +15368,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15336 "configure"
+#line 15371 "configure"
int main()
{
typedef bool atomic_type;
@@ -15368,7 +15403,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15371 "configure"
+#line 15406 "configure"
int main()
{
typedef short atomic_type;
@@ -15403,7 +15438,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15406 "configure"
+#line 15441 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -15439,7 +15474,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15442 "configure"
+#line 15477 "configure"
int main()
{
typedef long long atomic_type;
@@ -15518,7 +15553,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15521 "configure"
+#line 15556 "configure"
int main()
{
_Decimal32 d1;
@@ -15560,7 +15595,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15563 "configure"
+#line 15598 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -15594,7 +15629,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15597 "configure"
+#line 15632 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -71991,13 +72026,6 @@ $as_echo "$gxx_include_dir" >&6; }
-if test "$enable_shared" = yes; then
- PIC_CXXFLAGS="-prefer-pic"
-else
- PIC_CXXFLAGS=
-fi
-
-
ac_config_files="$ac_config_files Makefile"
ac_config_files="$ac_config_files scripts/testsuite_flags"