Skip to content

Commit 0660119

Browse files
committed
Drop unintended bitcoin-tx dependency on libevent
Don't include util/url.cpp to libbitcoin_util.a when libevent isn't available. This fixes a compile error trying to build bitcoin-tx without libevent reported by Luke Dashjr in bitcoin/bitcoin#18465 Fixes #18465
1 parent 5c1ba3a commit 0660119

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

build_msvc/libbitcoin_util/libbitcoin_util.vcxproj.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ConfigurationType>StaticLibrary</ConfigurationType>
99
</PropertyGroup>
1010
<ItemGroup>
11+
<ClCompile Include="..\..\src\util\url.cpp" />
1112
@SOURCE_FILES@
1213
</ItemGroup>
1314
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ if test x$use_pkgconfig = xyes; then
12711271
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
12721272
fi
12731273
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
1274-
PKG_CHECK_MODULES([EVENT], [libevent],, [AC_MSG_ERROR(libevent not found.)])
1274+
PKG_CHECK_MODULES([EVENT], [libevent], [use_libevent=yes], [AC_MSG_ERROR(libevent not found.)])
12751275
if test x$TARGET_OS != xwindows; then
12761276
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)])
12771277
fi
@@ -1291,7 +1291,7 @@ if test x$use_pkgconfig = xyes; then
12911291
else
12921292

12931293
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
1294-
AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),)
1294+
AC_CHECK_HEADER([event2/event.h], [use_libevent=yes], AC_MSG_ERROR(libevent headers missing),)
12951295
AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing))
12961296
if test x$TARGET_OS != xwindows; then
12971297
AC_CHECK_LIB([event_pthreads],[main],EVENT_PTHREADS_LIBS=-levent_pthreads,AC_MSG_ERROR(libevent_pthreads missing))
@@ -1545,6 +1545,7 @@ AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes])
15451545
AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes])
15461546
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
15471547
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
1548+
AM_CONDITIONAL([USE_LIBEVENT],[test x$use_libevent = xyes])
15481549
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
15491550
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
15501551
AM_CONDITIONAL([ENABLE_SSE42],[test x$enable_sse42 = xyes])

src/Makefile.am

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,12 @@ libbitcoin_util_a_SOURCES = \
523523
util/strencodings.cpp \
524524
util/string.cpp \
525525
util/time.cpp \
526-
util/url.cpp \
527526
$(BITCOIN_CORE_H)
528527

528+
if USE_LIBEVENT
529+
libbitcoin_util_a_SOURCES += util/url.cpp
530+
endif
531+
529532
if GLIBC_BACK_COMPAT
530533
libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
531534
AM_LDFLAGS += $(COMPAT_LDFLAGS)

0 commit comments

Comments
 (0)