Skip to content

Commit b556bed

Browse files
committed
build: fix Windows builds without pkg-config
- guard PKG_PROG_PKG_CONFIG with an m4_ifdef. If not building for windows, require it - add nops as necessary in case the ifdef reduces the if/then to nothing - AC_SUBST some missing _LIBS. These were split out over time, but not all were properly substituted. They continued to work if pkg-config is installed because it does the AC_SUBST itself
1 parent 0c928cb commit b556bed

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

configure.ac

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ AC_PATH_TOOL(OBJCOPY, objcopy)
7979

8080
AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)
8181

82-
dnl pkg-config check.
83-
PKG_PROG_PKG_CONFIG
84-
8582
# Enable wallet
8683
AC_ARG_ENABLE([wallet],
8784
[AS_HELP_STRING([--disable-wallet],
@@ -375,6 +372,16 @@ case $host in
375372
;;
376373
esac
377374

375+
if test x$use_pkgconfig = xyes; then
376+
m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR(PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh.)])
377+
m4_ifdef([PKG_PROG_PKG_CONFIG], [
378+
PKG_PROG_PKG_CONFIG
379+
if test x"$PKG_CONFIG" = "x"; then
380+
AC_MSG_ERROR(pkg-config not found.)
381+
fi
382+
])
383+
fi
384+
378385
if test x$use_comparison_tool != xno; then
379386
AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool)
380387
fi
@@ -752,12 +759,7 @@ fi
752759
fi
753760

754761
if test x$use_pkgconfig = xyes; then
755-
756-
if test x"$PKG_CONFIG" = "x"; then
757-
AC_MSG_ERROR(pkg-config not found.)
758-
fi
759-
760-
: #NOP
762+
: dnl
761763
m4_ifdef(
762764
[PKG_CHECK_MODULES],
763765
[
@@ -1058,6 +1060,13 @@ AC_SUBST(TESTDEFS)
10581060
AC_SUBST(LEVELDB_TARGET_FLAGS)
10591061
AC_SUBST(MINIUPNPC_CPPFLAGS)
10601062
AC_SUBST(MINIUPNPC_LIBS)
1063+
AC_SUBST(CRYPTO_LIBS)
1064+
AC_SUBST(SSL_LIBS)
1065+
AC_SUBST(EVENT_LIBS)
1066+
AC_SUBST(EVENT_PTHREADS_LIBS)
1067+
AC_SUBST(ZMQ_LIBS)
1068+
AC_SUBST(PROTOBUF_LIBS)
1069+
AC_SUBST(QR_LIBS)
10611070
AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
10621071
AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
10631072
AC_CONFIG_FILES([qa/pull-tester/tests_config.py],[chmod +x qa/pull-tester/tests_config.py])

0 commit comments

Comments
 (0)