diff --git a/configure.ac b/configure.ac index 72503f2b1ce..5f09c8a5b62 100644 --- a/configure.ac +++ b/configure.ac @@ -76,6 +76,12 @@ dnl we have those under control, re-enable that functionality. case $host in *mingw*) lt_cv_deplibs_check_method="pass_all" + + dnl Remove unwanted -DDLL_EXPORT from these variables. + dnl We do not use this macro, but system headers may export unwanted symbols + dnl if it's set. + lt_cv_prog_compiler_pic="-DPIC" + lt_cv_prog_compiler_pic_CXX="-DPIC" ;; esac diff --git a/src/Makefile.am b/src/Makefile.am index 7b9ffe427dc..72e7db53348 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -855,11 +855,12 @@ bitcoin_chainstate_SOURCES = bitcoin-chainstate.cpp bitcoin_chainstate_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) bitcoin_chainstate_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -# $(LIBTOOL_APP_LDFLAGS) deliberately omitted here so that we can test linking -# bitcoin-chainstate against libbitcoinkernel as a shared or static library by -# setting --{en,dis}able-shared. -bitcoin_chainstate_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(PTHREAD_FLAGS) +bitcoin_chainstate_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(PTHREAD_FLAGS) $(LIBTOOL_APP_LDFLAGS) -static bitcoin_chainstate_LDADD = $(LIBBITCOINKERNEL) + +# libtool is unable to calculate this indirect dependency, presumably because it's a subproject. +# libsecp256k1 only needs to be linked in when libbitcoinkernel is static. +bitcoin_chainstate_LDADD += $(LIBSECP256K1) # # bitcoinkernel library # @@ -878,15 +879,6 @@ libbitcoinkernel_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp # to export from the library. libbitcoinkernel_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -fvisibility=default -# TODO: For now, Specify -static in both CXXFLAGS and LDFLAGS when building for -# windows targets so libtool will only build a static version of this -# library. There are unresolved problems when building dll's for mingw-w64 -# and attempting to statically embed libstdc++, libpthread, etc. -if TARGET_WINDOWS -libbitcoinkernel_la_LDFLAGS += -static -libbitcoinkernel_la_CXXFLAGS += -static -endif - # TODO: libbitcoinkernel is a work in progress consensus engine library, as more # and more modules are decoupled from the consensus engine, this list will # shrink to only those which are absolutely necessary.