Skip to content

Commit f51816f

Browse files
committed
Merge pull request #4490
575e70c build: fix win32 static linking after libtool merge (Cory Fields) 9a427da build: re-add AM_LDFLAGS where it's overridden (Cory Fields)
2 parents 418d4ad + 575e70c commit f51816f

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,13 @@ case $host in
193193
AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing))
194194
AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing))
195195

196-
AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"])
197196
AX_CHECK_LINK_FLAG([[-static-libgcc]],[LDFLAGS="$LDFLAGS -static-libgcc"])
198197
AX_CHECK_LINK_FLAG([[-static-libstdc++]],[LDFLAGS="$LDFLAGS -static-libstdc++"])
199198

199+
# -static is interpreted by libtool, where it has a different meaning.
200+
# In libtool-speak, it's -all-static.
201+
AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"; LIBTOOL_LDFLAGS="$LIBTOOL_LDFLAGS -all-static"])
202+
200203
AC_PATH_PROG([MAKENSIS], [makensis], none)
201204
if test x$MAKENSIS = xnone; then
202205
AC_MSG_WARN("makensis not found. Cannot create installer.")
@@ -698,6 +701,7 @@ AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)
698701
AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
699702

700703

704+
AC_SUBST(LIBTOOL_LDFLAGS)
701705
AC_SUBST(USE_UPNP)
702706
AC_SUBST(USE_QRCODE)
703707
AC_SUBST(INCLUDES)

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AM_CPPFLAGS = $(INCLUDES)
2-
AM_LDFLAGS = $(PTHREAD_CFLAGS)
2+
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
33

44
if USE_LIBSECP256K1
55
secp256k1/libsecp256k1.la: $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)

src/Makefile.qt.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL)
363363
if USE_LIBSECP256K1
364364
qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
365365
endif
366-
qt_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS)
366+
qt_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS)
367367

368368
#locale/foo.ts -> locale/foo.qm
369369
QT_QM=$(QT_TS:.ts=.qm)

src/Makefile.qttest.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBIT
3636
if USE_LIBSECP256K1
3737
qt_test_test_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
3838
endif
39-
qt_test_test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS)
39+
qt_test_test_bitcoin_qt_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS)
4040

4141
CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno
4242

0 commit comments

Comments
 (0)