From 41b77c9e245aa6740936b1eed92eff5a687b265d Mon Sep 17 00:00:00 2001
From: Arnaud Lacombe <lacombar@gmail.com>
Date: Sun, 4 Apr 2010 20:17:34 -0400
Subject: [PATCH] static companion libs

---
 config/companion_libs.in               |    6 ------
 scripts/build/cc/gcc.sh                |    2 ++
 scripts/build/companion_libs/cloog.sh  |    2 +-
 scripts/build/companion_libs/gmp.sh    |    2 +-
 scripts/build/companion_libs/libelf.sh |    4 ++--
 scripts/build/companion_libs/mpc.sh    |    2 +-
 scripts/build/companion_libs/mpfr.sh   |    2 +-
 scripts/build/companion_libs/ppl.sh    |    2 +-
 8 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/config/companion_libs.in b/config/companion_libs.in
index 64cf138..e93386d 100644
--- a/config/companion_libs.in
+++ b/config/companion_libs.in
@@ -17,7 +17,6 @@ config WRAPPER_NEEDED
 config GMP
     bool
     select COMPLIBS
-    select WRAPPER_NEEDED
     help
       gcc 4.3.0 and above requires GMP to build some frontends, and some
       other components can use them as well.
@@ -35,7 +34,6 @@ config MPFR
     bool
     select GMP
     select COMPLIBS
-    select WRAPPER_NEEDED
     help
       gcc 4.3.0 and above requires MPFR to build some frontends, and some
       other components can use them as well.
@@ -54,7 +52,6 @@ config PPL
     select GMP
     select MPFR
     select COMPLIBS
-    select WRAPPER_NEEDED
     help
       gcc-4.4.0 and above requires PPL to build some parts of the optimiser
       (the GRAPHITE loop optimisation, to be precise).
@@ -69,7 +66,6 @@ config CLOOG
     select MPFR
     select PPL
     select COMPLIBS
-    select WRAPPER_NEEDED
     help
       gcc-4.4.0 and above requires CLooG/PPL to build some parts of the
       optimiser (the GRAPHITE loop optimisation, to be precise).
@@ -85,7 +81,6 @@ config MPC
     select PPL
     select CLOOG
     select COMPLIBS
-    select WRAPPER_NEEDED
     help
       gcc-4.4.0 and above can also optionally use MPC to enable additional
       optimisations on complex numbers. Although MPC is optional,
@@ -98,7 +93,6 @@ config MPC
 config LIBELF
     bool
     select COMPLIBS
-    select WRAPPER_NEEDED
     help
       gcc-4.5.0 and above can also use libelf to enable some optimisation
       (LTO, Link-Time Optimisation, to be precise).  Although libelf is
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index f4cf7cb..6dc97e4 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -165,6 +165,7 @@ do_cc_core() {
     # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
     CC_FOR_BUILD="${CT_BUILD}-gcc"                  \
     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
+    LDFLAGS="-lstdc++"                              \
     CT_DoExecLog ALL                                \
     "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure"  \
         --build=${CT_BUILD}                         \
@@ -330,6 +331,7 @@ do_cc() {
     # embedded systems don't really need message catalogs...
     CC_FOR_BUILD="${CT_BUILD}-gcc"                  \
     CFLAGS="${CT_CFLAGS_FOR_HOST}"                  \
+    LDFLAGS="-lstdc++"                              \
     CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"         \
     CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}"       \
     LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}"       \
diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh
index f2e0f0f..b10f47f 100644
--- a/scripts/build/companion_libs/cloog.sh
+++ b/scripts/build/companion_libs/cloog.sh
@@ -57,7 +57,7 @@ do_cloog() {
         --prefix="${CT_PREFIX_DIR}"             \
         --with-gmp="${CT_PREFIX_DIR}"           \
         --with-ppl="${CT_PREFIX_DIR}"           \
-        --enable-shared                         \
+        --disable-shared                         \
         --disable-static                        \
         --with-bits=gmp
 
diff --git a/scripts/build/companion_libs/gmp.sh b/scripts/build/companion_libs/gmp.sh
index 731838e..deee6c1 100644
--- a/scripts/build/companion_libs/gmp.sh
+++ b/scripts/build/companion_libs/gmp.sh
@@ -38,7 +38,7 @@ do_gmp() {
         --build=${CT_BUILD}                         \
         --host=${CT_HOST}                           \
         --prefix="${CT_PREFIX_DIR}"                 \
-        --enable-shared                             \
+        --disable-shared                             \
         --disable-static                            \
         --enable-fft                                \
         --enable-mpbsd                              \
diff --git a/scripts/build/companion_libs/libelf.sh b/scripts/build/companion_libs/libelf.sh
index ecda8ff..54e7407 100644
--- a/scripts/build/companion_libs/libelf.sh
+++ b/scripts/build/companion_libs/libelf.sh
@@ -72,9 +72,9 @@ do_libelf_target() {
         --prefix=/usr                                       \
         --enable-compat                                     \
         --enable-elf64                                      \
-        --enable-shared                                     \
+        --disable-shared                                    \
+        --disable-static                                    \
         --enable-extended-format                            \
-        --enable-static
 
     CT_DoLog EXTRA "Building libelf"
     CT_DoExecLog ALL make
diff --git a/scripts/build/companion_libs/mpc.sh b/scripts/build/companion_libs/mpc.sh
index 796e798..6d9bed3 100644
--- a/scripts/build/companion_libs/mpc.sh
+++ b/scripts/build/companion_libs/mpc.sh
@@ -37,7 +37,7 @@ do_mpc() {
         --prefix="${CT_PREFIX_DIR}"                 \
         --with-gmp="${CT_PREFIX_DIR}"               \
         --with-mpfr="${CT_PREFIX_DIR}"              \
-        --enable-shared                             \
+        --disable-shared                             \
         --disable-static                            \
 
     CT_DoLog EXTRA "Building MPC"
diff --git a/scripts/build/companion_libs/mpfr.sh b/scripts/build/companion_libs/mpfr.sh
index 12fe125..08ff7fe 100644
--- a/scripts/build/companion_libs/mpfr.sh
+++ b/scripts/build/companion_libs/mpfr.sh
@@ -90,7 +90,7 @@ do_mpfr() {
         --host=${CT_HOST}                               \
         --prefix="${CT_PREFIX_DIR}"                     \
         ${mpfr_opt}                                     \
-        --enable-shared                                 \
+        --disable-shared                                 \
         --disable-static                                \
         --with-gmp="${CT_PREFIX_DIR}"
 
diff --git a/scripts/build/companion_libs/ppl.sh b/scripts/build/companion_libs/ppl.sh
index 15312f0..d8d2e6d 100644
--- a/scripts/build/companion_libs/ppl.sh
+++ b/scripts/build/companion_libs/ppl.sh
@@ -40,7 +40,7 @@ do_ppl() {
         --prefix="${CT_PREFIX_DIR}"                 \
         --with-libgmp-prefix="${CT_PREFIX_DIR}"     \
         --with-libgmpxx-prefix="${CT_PREFIX_DIR}"   \
-        --enable-shared                             \
+        --disable-shared                             \
         --disable-static                            \
         --disable-debugging                         \
         --disable-assertions                        \
-- 
1.7.0.rc2.16.g99c03.dirty

