Skip to content

Commit 478ac18

Browse files
committed
Merge bitcoin/bitcoin#29298: depends: patch libool out of libnatpmp/miniupnpc
5b9d5bf depends: remove (darwin) libtool now that it's no longer used (Cory Fields) 3ef6563 depends: use ar rather than libtool for miniupnpc/libnatpmp (Cory Fields) Pull request description: An alternative to bitcoin/bitcoin#29232 Rather than switching to the CMake builds which [proved problematic](bitcoin/bitcoin#29232 (comment)), do the quick and dirty thing of just patching out libtool. Doesn't seem to introduce any new issues. This should buy us time to upstream the necessary CMake fixes. ACKs for top commit: TheCharlatan: ACK 5b9d5bf fanquake: ACK 5b9d5bf Tree-SHA512: c75c4bcc9332d8c1fc3395e2b5fc7265849186afc7005700f662ab291e6ea1f111025fad733d0b0b39d35029d1b757d3f1937d63aad3c0c3b88d0f8ac902ee18
2 parents 5fbcc8f + 5b9d5bf commit 478ac18

File tree

9 files changed

+40
-10
lines changed

9 files changed

+40
-10
lines changed

depends/builders/darwin.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ darwin_CXX:=$(shell xcrun -f clang++) -stdlib=libc++ -isysroot$(shell xcrun --sh
1616
darwin_AR:=$(shell xcrun -f ar)
1717
darwin_RANLIB:=$(shell xcrun -f ranlib)
1818
darwin_STRIP:=$(shell xcrun -f strip)
19-
darwin_LIBTOOL:=$(shell xcrun -f libtool)
2019
darwin_OTOOL:=$(shell xcrun -f otool)
2120
darwin_NM:=$(shell xcrun -f nm)
2221
darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)

depends/funcs.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ $(1)_objc=$$($$($(1)_type)_OBJC)
66
$(1)_objcxx=$$($$($(1)_type)_OBJCXX)
77
$(1)_ar=$$($$($(1)_type)_AR)
88
$(1)_ranlib=$$($$($(1)_type)_RANLIB)
9-
$(1)_libtool=$$($$($(1)_type)_LIBTOOL)
109
$(1)_nm=$$($$($(1)_type)_NM)
1110
$(1)_cflags=$$($$($(1)_type)_CFLAGS) \
1211
$$($$($(1)_type)_$$(release_type)_CFLAGS)

depends/hosts/darwin.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ llvm_config_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-config")
3939
llvm_lib_dir=$(shell $(llvm_config_prog) --libdir)
4040
endif
4141

42-
cctools_TOOLS=AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL DSYMUTIL
42+
cctools_TOOLS=AR RANLIB STRIP NM OTOOL INSTALL_NAME_TOOL DSYMUTIL
4343

4444
# Make-only lowercase function
4545
lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))

depends/hosts/default.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ default_host_CXX = $(host_toolchain)g++
77
default_host_AR = $(host_toolchain)ar
88
default_host_RANLIB = $(host_toolchain)ranlib
99
default_host_STRIP = $(host_toolchain)strip
10-
default_host_LIBTOOL = $(host_toolchain)libtool
1110
default_host_NM = $(host_toolchain)nm
1211
default_host_OBJCOPY = $(host_toolchain)objcopy
1312

@@ -39,5 +38,5 @@ host_$1 = $$($(host_arch)_$(host_os)_$1)
3938
host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)
4039
endef
4140

42-
$(foreach tool,CC CXX AR RANLIB STRIP LIBTOOL NM OBJCOPY OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_host_tool_func,$(tool))))
41+
$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_host_tool_func,$(tool))))
4342
$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))

depends/packages.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ These variables may be set to override or append their default values.
7474
$(package)_objcxx
7575
$(package)_ar
7676
$(package)_ranlib
77-
$(package)_libtool
7877
$(package)_nm
7978
$(package)_cflags
8079
$(package)_cxxflags

depends/packages/libnatpmp.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ $(package)_version=07004b97cf691774efebe70404cf22201e4d330d
33
$(package)_download_path=https://github.com/miniupnp/libnatpmp/archive
44
$(package)_file_name=$($(package)_version).tar.gz
55
$(package)_sha256_hash=9321953ceb39d07c25463e266e50d0ae7b64676bb3a986d932b18881ed94f1fb
6+
$(package)_patches=no_libtool.patch
67

78
define $(package)_set_vars
89
$(package)_build_opts=CC="$($(package)_cc)"
910
$(package)_build_opts_mingw32=CPPFLAGS=-DNATPMP_STATICLIB
10-
$(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)"
1111
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
1212
endef
1313

14+
define $(package)_preprocess_cmds
15+
patch -p1 < $($(package)_patch_dir)/no_libtool.patch
16+
endef
17+
1418
define $(package)_build_cmds
1519
$(MAKE) libnatpmp.a $($(package)_build_opts)
1620
endef

depends/packages/miniupnpc.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ $(package)_version=2.2.2
33
$(package)_download_path=https://miniupnp.tuxfamily.org/files/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
55
$(package)_sha256_hash=888fb0976ba61518276fe1eda988589c700a3f2a69d71089260d75562afd3687
6-
$(package)_patches=dont_leak_info.patch respect_mingw_cflags.patch
6+
$(package)_patches=dont_leak_info.patch respect_mingw_cflags.patch no_libtool.patch
77

88
# Next time this package is updated, ensure that _WIN32_WINNT is still properly set.
99
# See discussion in https://github.com/bitcoin/bitcoin/pull/25964.
1010
define $(package)_set_vars
1111
$(package)_build_opts=CC="$($(package)_cc)"
12-
$(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)"
1312
$(package)_build_opts_mingw32=-f Makefile.mingw CFLAGS="$($(package)_cflags) -D_WIN32_WINNT=0x0601"
1413
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
1514
endef
1615

1716
define $(package)_preprocess_cmds
1817
patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \
19-
patch -p1 < $($(package)_patch_dir)/respect_mingw_cflags.patch
18+
patch -p1 < $($(package)_patch_dir)/respect_mingw_cflags.patch && \
19+
patch -p1 < $($(package)_patch_dir)/no_libtool.patch
2020
endef
2121

2222
define $(package)_build_cmds
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff -ruN libnatpmp-07004b97cf691774efebe70404cf22201e4d330d/Makefile libnatpmp-07004b97cf691774efebe70404cf22201e4d330d.new/Makefile
2+
--- libnatpmp-07004b97cf691774efebe70404cf22201e4d330d/Makefile 2022-07-05 07:49:50.000000000 +0000
3+
+++ libnatpmp-07004b97cf691774efebe70404cf22201e4d330d.new/Makefile 2024-01-23 20:59:35.674821779 +0000
4+
@@ -197,11 +197,7 @@
5+
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
6+
7+
$(STATICLIB): $(LIBOBJS)
8+
-ifneq (, $(findstring darwin, $(OS)))
9+
- $(LIBTOOL) -static -o $@ $?
10+
-else
11+
$(AR) crs $@ $?
12+
-endif
13+
14+
$(SHAREDLIB): $(LIBOBJS)
15+
ifneq (, $(findstring darwin, $(OS)))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff -ruN miniupnpc-2.2.2/Makefile miniupnpc-2.2.2.new/Makefile
2+
--- miniupnpc-2.2.2/Makefile 2020-11-27 18:25:02.000000000 +0000
3+
+++ miniupnpc-2.2.2.new/Makefile 2024-01-23 20:58:08.387188527 +0000
4+
@@ -298,11 +298,7 @@
5+
makedepend -Y -- $(CFLAGS) -- $(SRCS) 2>/dev/null
6+
7+
$(LIBRARY): $(LIBOBJS)
8+
-ifneq (, $(findstring darwin, $(OS)))
9+
- $(LIBTOOL) -static -o $@ $?
10+
-else
11+
$(AR) crs $@ $?
12+
-endif
13+
14+
$(SHAREDLIBRARY): $(LIBOBJS)
15+
ifneq (, $(findstring darwin, $(OS)))

0 commit comments

Comments
 (0)