Skip to content

Commit 28fbe68

Browse files
committed
Merge #17740: build: remove configure checks for win libraries we don't link against
2525c09 build: remove configure checks for win libraries we don't link against (fanquake) Pull request description: While cross compiling, `HOST=x86_64-w64-mingw32`, none of these libs actually seem to be passed to the linker. i.e tailing a build with `make -j5 V=1 | rg -i 'mingwthrd|winspool|rpcrt4|crypt32'`. I'm not 100% sure about `crypt32`, even though the majority of our Windows cryptography usage, i.e [`CryptAcquireContextW`](https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontextw) or [`CryptGenRandom`](https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom) is provided by `advapi32`. Note that `rpcrt4` and `mingwthrd` are already missing from the MSVC build, so we can sync the remainder once it's clear what's actually needed. Hopefully sipsorcery can add some MSVC insight. ACKs for top commit: practicalswift: ACK 2525c09 -- diff looks correct sipsorcery: ACK 2525c09. Tree-SHA512: c756618f85ce2ab1e14e5514dbdc490d94c1c6dfd7a3e3d3b16344ae302fb789585dd10b5c2d784f961f3115bec1d914615051b3184bea00dfbcc3c23884ab4a
2 parents fe3b58b + 2525c09 commit 28fbe68

File tree

3 files changed

+16
-90
lines changed

3 files changed

+16
-90
lines changed

build_msvc/bitcoin_config.h

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
/* define if the Boost::Filesystem library is available */
5454
#define HAVE_BOOST_FILESYSTEM /**/
5555

56-
/* define if the Boost::PROGRAM_OPTIONS library is available */
57-
#define HAVE_BOOST_PROGRAM_OPTIONS /**/
58-
5956
/* define if the Boost::System library is available */
6057
#define HAVE_BOOST_SYSTEM /**/
6158

@@ -183,72 +180,6 @@
183180
/* Define to 1 if you have the <inttypes.h> header file. */
184181
#define HAVE_INTTYPES_H 1
185182

186-
/* Define to 1 if you have the `advapi32' library (-ladvapi32). */
187-
#define HAVE_LIBADVAPI32 1
188-
189-
/* Define to 1 if you have the `comctl32' library (-lcomctl32). */
190-
#define HAVE_LIBCOMCTL32 1
191-
192-
/* Define to 1 if you have the `comdlg32' library (-lcomdlg32). */
193-
#define HAVE_LIBCOMDLG32 1
194-
195-
/* Define to 1 if you have the `crypt32' library (-lcrypt32). */
196-
#define HAVE_LIBCRYPT32 1
197-
198-
/* Define to 1 if you have the `gdi32' library (-lgdi32). */
199-
#define HAVE_LIBGDI32 1
200-
201-
/* Define to 1 if you have the `imm32' library (-limm32). */
202-
#define HAVE_LIBIMM32 1
203-
204-
/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */
205-
#define HAVE_LIBIPHLPAPI 1
206-
207-
/* Define to 1 if you have the `kernel32' library (-lkernel32). */
208-
#define HAVE_LIBKERNEL32 1
209-
210-
/* Define to 1 if you have the `mingwthrd' library (-lmingwthrd). */
211-
#define HAVE_LIBMINGWTHRD 1
212-
213-
/* Define to 1 if you have the `mswsock' library (-lmswsock). */
214-
#define HAVE_LIBMSWSOCK 1
215-
216-
/* Define to 1 if you have the `ole32' library (-lole32). */
217-
#define HAVE_LIBOLE32 1
218-
219-
/* Define to 1 if you have the `oleaut32' library (-loleaut32). */
220-
#define HAVE_LIBOLEAUT32 1
221-
222-
/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */
223-
#define HAVE_LIBRPCRT4 1
224-
225-
/* Define to 1 if you have the `shell32' library (-lshell32). */
226-
#define HAVE_LIBSHELL32 1
227-
228-
/* Define to 1 if you have the `shlwapi' library (-lshlwapi). */
229-
#define HAVE_LIBSHLWAPI 1
230-
231-
/* Define to 1 if you have the `ssp' library (-lssp). */
232-
#define HAVE_LIBSSP 1
233-
234-
/* Define to 1 if you have the `user32' library (-luser32). */
235-
#define HAVE_LIBUSER32 1
236-
237-
/* Define to 1 if you have the `uuid' library (-luuid). */
238-
#define HAVE_LIBUUID 1
239-
240-
/* Define to 1 if you have the `winmm' library (-lwinmm). */
241-
#define HAVE_LIBWINMM 1
242-
243-
/* Define to 1 if you have the `winspool' library (-lwinspool). */
244-
#define HAVE_LIBWINSPOOL 1
245-
246-
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
247-
#define HAVE_LIBWS2_32 1
248-
249-
/* Define to 1 if you have the `z ' library (-lz ). */
250-
#define HAVE_LIBZ_ 1
251-
252183
/* Define this symbol if you have malloc_info */
253184
/* #undef HAVE_MALLOC_INFO */
254185

build_msvc/common.init.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<Link>
117117
<SubSystem>Console</SubSystem>
118118
<GenerateDebugInformation>true</GenerateDebugInformation>
119-
<AdditionalDependencies>crypt32.lib;Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
119+
<AdditionalDependencies>Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
120120
</Link>
121121
<Lib>
122122
<AdditionalOptions>/ignore:4221</AdditionalOptions>

configure.ac

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -483,29 +483,24 @@ use_pkgconfig=yes
483483
case $host in
484484
*mingw*)
485485

486-
#pkgconfig does more harm than good with MinGW
486+
dnl pkgconfig does more harm than good with MinGW
487487
use_pkgconfig=no
488488

489489
TARGET_OS=windows
490-
AC_CHECK_LIB([mingwthrd], [main],, AC_MSG_ERROR(libmingwthrd missing))
491-
AC_CHECK_LIB([kernel32], [main],, AC_MSG_ERROR(libkernel32 missing))
492-
AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(libuser32 missing))
493-
AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(libgdi32 missing))
494-
AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(libcomdlg32 missing))
495-
AC_CHECK_LIB([winspool], [main],, AC_MSG_ERROR(libwinspool missing))
496-
AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(libwinmm missing))
497-
AC_CHECK_LIB([shell32], [main],, AC_MSG_ERROR(libshell32 missing))
498-
AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(libcomctl32 missing))
499-
AC_CHECK_LIB([ole32], [main],, AC_MSG_ERROR(libole32 missing))
500-
AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(liboleaut32 missing))
501-
AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(libuuid missing))
502-
AC_CHECK_LIB([rpcrt4], [main],, AC_MSG_ERROR(librpcrt4 missing))
503-
AC_CHECK_LIB([advapi32], [main],, AC_MSG_ERROR(libadvapi32 missing))
504-
AC_CHECK_LIB([ws2_32], [main],, AC_MSG_ERROR(libws2_32 missing))
505-
AC_CHECK_LIB([mswsock], [main],, AC_MSG_ERROR(libmswsock missing))
506-
AC_CHECK_LIB([shlwapi], [main],, AC_MSG_ERROR(libshlwapi missing))
507-
AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(libiphlpapi missing))
508-
AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(libcrypt32 missing))
490+
AC_CHECK_LIB([kernel32], [GetModuleFileNameA],, AC_MSG_ERROR(libkernel32 missing))
491+
AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(libuser32 missing))
492+
AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(libgdi32 missing))
493+
AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(libcomdlg32 missing))
494+
AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(libwinmm missing))
495+
AC_CHECK_LIB([shell32], [SHGetSpecialFolderPathW],, AC_MSG_ERROR(libshell32 missing))
496+
AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(libcomctl32 missing))
497+
AC_CHECK_LIB([ole32], [CoCreateInstance],, AC_MSG_ERROR(libole32 missing))
498+
AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(liboleaut32 missing))
499+
AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(libuuid missing))
500+
AC_CHECK_LIB([advapi32], [CryptAcquireContextW],, AC_MSG_ERROR(libadvapi32 missing))
501+
AC_CHECK_LIB([ws2_32], [WSAStartup],, AC_MSG_ERROR(libws2_32 missing))
502+
AC_CHECK_LIB([shlwapi], [PathRemoveFileSpecW],, AC_MSG_ERROR(libshlwapi missing))
503+
AC_CHECK_LIB([iphlpapi], [GetAdaptersAddresses],, AC_MSG_ERROR(libiphlpapi missing))
509504

510505
dnl -static is interpreted by libtool, where it has a different meaning.
511506
dnl In libtool-speak, it's -all-static.

0 commit comments

Comments
 (0)