From 9d3d0ebdf9424a2ff2d58631e1ae4b0d01eb5bf3 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 30 Sep 2026 21:42:36 -0400 Subject: [PATCH] link with boost_url --- Makefile.bsd | 2 +- Makefile.haiku | 2 +- Makefile.homebrew | 4 ++-- Makefile.linux | 5 +++-- Makefile.mingw | 1 + Makefile.osx | 4 ++-- Makefile.solaris | 2 +- build/CMakeLists.txt | 6 +++++- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Makefile.bsd b/Makefile.bsd index db718a2a..818aa6b7 100644 --- a/Makefile.bsd +++ b/Makefile.bsd @@ -8,7 +8,7 @@ INCFLAGS = -I/usr/include/ -I/usr/local/include/ LDFLAGS = ${LD_DEBUG} -Wl,-rpath,/usr/local/lib -L/usr/local/lib LDLIBS = -lssl -lcrypto -lz -lpthread -lboost_program_options ifeq ($(TORRENTS),yes) - LDLIBS += -lboost_json + LDLIBS += -lboost_json -lboost_url endif ## NOTE: NEEDED_CXXFLAGS is here so that custom CXXFLAGS can be specified at build time diff --git a/Makefile.haiku b/Makefile.haiku index f420e6a6..82697922 100644 --- a/Makefile.haiku +++ b/Makefile.haiku @@ -6,7 +6,7 @@ endif CXXFLAGS := -Wall -std=c++23 INCFLAGS = -I/system/develop/headers DEFINES = -D_DEFAULT_SOURCE -D_GNU_SOURCE -LDLIBS = -lbe -lbsd -lnetwork -lz -lssl -lcrypto -lboost_program_options -lboost_json -lpthread +LDLIBS = -lbe -lbsd -lnetwork -lz -lssl -lcrypto -lboost_program_options -lboost_json -lboost_url -lpthread ifeq ($(USE_UPNP),yes) DEFINES += -DUSE_UPNP diff --git a/Makefile.homebrew b/Makefile.homebrew index 08611148..a36e1d29 100644 --- a/Makefile.homebrew +++ b/Makefile.homebrew @@ -22,14 +22,14 @@ ifeq ($(shell uname -m), x86_64) endif ifeq ($(USE_STATIC),yes) - LDLIBS = -lz ${SSLROOT}/lib/libcrypto.a ${SSLROOT}/lib/libssl.a ${BOOSTROOT}/lib/libboost_program_options.a ${BOOSTROOT}/lib/libboost_json.a + LDLIBS = -lz ${SSLROOT}/lib/libcrypto.a ${SSLROOT}/lib/libssl.a ${BOOSTROOT}/lib/libboost_program_options.a ${BOOSTROOT}/lib/libboost_json.a ${BOOSTROOT}/lib/libboost_url.a ifeq ($(USE_UPNP),yes) LDLIBS += ${UPNPROOT}/lib/libminiupnpc.a endif LDLIBS += -lpthread -ldl else LDFLAGS += -L${SSLROOT}/lib -L${BOOSTROOT}/lib - LDLIBS = -lz -lssl -lcrypto -lboost_program_options -lboost_json -lpthread + LDLIBS = -lz -lssl -lcrypto -lboost_program_options -lboost_json -lboost_url -lpthread ifeq ($(USE_UPNP),yes) LDFLAGS += -L${UPNPROOT}/lib LDLIBS += -lminiupnpc diff --git a/Makefile.linux b/Makefile.linux index aee50f0e..54c7680e 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -14,7 +14,7 @@ CXXVER := $(shell $(CXX) -dumpversion) ifneq ($(findstring clang,$(CXX)),) NEEDED_CXXFLAGS += -std=c++20 ifeq ($(TORRENTS),yes) - LDLIBS = -lboost_json + LDLIBS = -lboost_json -lboost_url endif else ifeq ($(shell expr match ${CXXVER} "11"),2) # gcc 11 NEEDED_CXXFLAGS += -std=c++20 @@ -24,7 +24,7 @@ else ifeq ($(shell expr match ${CXXVER} "1[3-9]"),2) # gcc 13+ NEEDED_CXXFLAGS += -std=c++23 -Wno-bidi-chars ifeq ($(TORRENTS),yes) # assume boost >= 1.81 - LDLIBS = -lboost_json + LDLIBS = -lboost_json -lboost_url endif else # not supported $(error Compiler too old) @@ -40,6 +40,7 @@ ifeq ($(USE_STATIC),yes) LDLIBS += $(LIBDIR)/libboost_program_options.a ifeq ($(TORRENTS),yes) LDLIBS += $(LIBDIR)/libboost_json.a + LDLIBS += $(LIBDIR)/libboost_url.a endif LDLIBS += $(LIBDIR)/libssl.a LDLIBS += $(LIBDIR)/libcrypto.a diff --git a/Makefile.mingw b/Makefile.mingw index dcf94cfa..282a8f42 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -25,6 +25,7 @@ LDLIBS += \ $(MINGW_PREFIX)/lib/libboost_filesystem-mt.a \ $(MINGW_PREFIX)/lib/libboost_program_options-mt.a \ $(MINGW_PREFIX)/lib/libboost_json-mt.a \ + $(MINGW_PREFIX)/lib/libboost_url-mt.a \ $(MINGW_PREFIX)/lib/libssl.a \ $(MINGW_PREFIX)/lib/libcrypto.a \ $(MINGW_PREFIX)/lib/libz.a \ diff --git a/Makefile.osx b/Makefile.osx index 5f84f8dc..70baefa1 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -7,9 +7,9 @@ LDFLAGS += -Wl,-dead_strip LDFLAGS += -Wl,-dead_strip_dylibs ifeq ($(USE_STATIC),yes) - LDLIBS = -lz /usr/local/lib/libssl.a /usr/local/lib/libcrypto.a /usr/local/lib/libboost_json.a /usr/local/lib/libboost_program_options.a -lpthread + LDLIBS = -lz /usr/local/lib/libssl.a /usr/local/lib/libcrypto.a /usr/local/lib/libboost_json.a /usr/local/lib/libboost_url.a /usr/local/lib/libboost_program_options.a -lpthread else - LDLIBS = -lz -lssl -lcrypto -lboost_program_options -lboost_json -lpthread + LDLIBS = -lz -lssl -lcrypto -lboost_program_options -lboost_json -lboost_url -lpthread endif ifeq ($(USE_UPNP),yes) diff --git a/Makefile.solaris b/Makefile.solaris index 76bc378c..58920db8 100644 --- a/Makefile.solaris +++ b/Makefile.solaris @@ -1,7 +1,7 @@ CXX = g++ INCFLAGS = -I/usr/openssl/3/include CXXFLAGS := -Wall -std=c++23 -LDLIBS = -L/usr/openssl/3/lib/64 -lssl -lcrypto -lboost_program_options -lboost_json -lz -lpthread -lsocket +LDLIBS = -L/usr/openssl/3/lib/64 -lssl -lcrypto -lboost_program_options -lz -lpthread -lsocket ifeq ($(USE_UPNP),yes) DEFINES += -DUSE_UPNP diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 24f03bfe..9058064b 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -294,7 +294,7 @@ else() endif() endif() -find_package(Boost REQUIRED COMPONENTS atomic filesystem program_options OPTIONAL_COMPONENTS json) +find_package(Boost REQUIRED COMPONENTS atomic filesystem program_options OPTIONAL_COMPONENTS json url) if(NOT DEFINED Boost_FOUND) message(SEND_ERROR "Boost is not found, or your boost version was below 1.46. Please download Boost!") @@ -304,6 +304,10 @@ if(Boost_json_FOUND AND NOT WITH_STATIC) add_definitions(-DBOOST_JSON_DYN_LINK) endif() +if(Boost_url_FOUND AND NOT WITH_STATIC) + add_definitions(-DBOOST_URL_DYN_LINK) +endif() + find_package(OpenSSL REQUIRED) if(NOT DEFINED OPENSSL_FOUND) message(SEND_ERROR "Could not find OpenSSL. Please download and install it first!")