From 9a427da116b9bf9b49e17590173b2848f4dbedf5 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 8 Jul 2014 15:52:27 -0400 Subject: [PATCH 1/2] build: re-add AM_LDFLAGS where it's overridden using _LDFLAGS replaces AM_LDFLAGS rather than adding to it. --- src/Makefile.qt.include | 2 +- src/Makefile.qttest.include | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index d97c2d064..75b7b683d 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -363,7 +363,7 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) if USE_LIBSECP256K1 qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) +qt_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) #locale/foo.ts -> locale/foo.qm QT_QM=$(QT_TS:.ts=.qm) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 7e10ce5a9..51ce006fc 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -36,7 +36,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBIT if USE_LIBSECP256K1 qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la endif -qt_test_test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) +qt_test_test_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS) CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno From 575e70c0c6c14058e4fc6c37f4e4d52399b69432 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 8 Jul 2014 15:53:53 -0400 Subject: [PATCH 2/2] build: fix win32 static linking after libtool merge Libtool eats the -static flag rather than passing it along to the compiler. To get the same effect, -all-static is used instead. --- configure.ac | 6 +++++- src/Makefile.am | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index dcaec0d4b..d3500b4d9 100644 --- a/configure.ac +++ b/configure.ac @@ -193,10 +193,13 @@ case $host in AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing)) AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing)) - AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"]) AX_CHECK_LINK_FLAG([[-static-libgcc]],[LDFLAGS="$LDFLAGS -static-libgcc"]) AX_CHECK_LINK_FLAG([[-static-libstdc++]],[LDFLAGS="$LDFLAGS -static-libstdc++"]) + # -static is interpreted by libtool, where it has a different meaning. + # In libtool-speak, it's -all-static. + AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"; LIBTOOL_LDFLAGS="$LIBTOOL_LDFLAGS -all-static"]) + AC_PATH_PROG([MAKENSIS], [makensis], none) if test x$MAKENSIS = xnone; then AC_MSG_WARN("makensis not found. Cannot create installer.") @@ -698,6 +701,7 @@ AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) +AC_SUBST(LIBTOOL_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) AC_SUBST(INCLUDES) diff --git a/src/Makefile.am b/src/Makefile.am index e2a62c969..9b0b97b7a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(INCLUDES) -AM_LDFLAGS = $(PTHREAD_CFLAGS) +AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) if USE_LIBSECP256K1 secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)