Skip to content

Commit 575e70c

Browse files
committed
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.
1 parent 9a427da commit 575e70c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
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/*)

0 commit comments

Comments
 (0)