Compile static versions of gcc libraries
authorJérôme Pouiller <jezz@sysmic.org>
Thu, 10 Oct 2013 09:40:42 +0000 (11:40 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sat, 11 Jan 2014 16:19:17 +0000 (17:19 +0100)
Since default configure options for host packages include
--disable-static, gcc was not configured to build static version of its
libraries (libgcc.a, libstdc++.a, ...).

This patch replace --disable-static by --enable-static in configure
command. Notice some options was removed sinces they was ignored by gcc
configure script.

Once it was compiled, this commit takes care to copy static libraries to
$STAGING

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
Tested-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/gcc/gcc-final/gcc-final.mk

index b396382788a17f238b7244a8e7bd5b7e19b5b82f..49de48102915a7419b315d576af689b4ecb6aba6 100644 (file)
@@ -26,6 +26,21 @@ HOST_GCC_FINAL_SUBDIR = build
 
 HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK
 
+define  HOST_GCC_FINAL_CONFIGURE_CMDS
+        (cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \
+                $(HOST_CONFIGURE_OPTS) \
+                CFLAGS="$(HOST_CFLAGS)" \
+                LDFLAGS="$(HOST_LDFLAGS)" \
+                $(HOST_GCC_FINAL_CONF_ENV) \
+                ./configure \
+                --prefix="$(HOST_DIR)/usr" \
+                --sysconfdir="$(HOST_DIR)/etc" \
+                --enable-shared --enable-static \
+                $(QUIET) $(HOST_GCC_FINAL_CONF_OPT) \
+        )
+endef
+
+
 # Languages supported by the cross-compiler
 GCC_FINAL_CROSS_LANGUAGES-y = c
 GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_LIBSTDCPP) += c++
@@ -133,6 +148,8 @@ define HOST_GCC_FINAL_INSTALL_USR_LIBS
        for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \
                cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.so* \
                        $(STAGING_DIR)/usr/lib/ ; \
+               cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.a \
+                       $(STAGING_DIR)/usr/lib/ ; \
                cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.so* \
                        $(TARGET_DIR)/usr/lib/ ; \
        done