Skip to content

Commit 949c480

Browse files
committed
depends: Fully determine path for darwin cctools
See previous commit for description.
1 parent 880660a commit 949c480

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

depends/Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ $(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)
166166

167167
include funcs.mk
168168

169-
binutils_path=$($($(host_arch)_$(host_os)_native_binutils)_prefixbin)
170-
171169
final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
172170
final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
173171
$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
@@ -207,10 +205,10 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
207205
$(AT)sed -e 's|@HOST@|$(host)|' \
208206
-e 's|@CC@|$(host_CC)|' \
209207
-e 's|@CXX@|$(host_CXX)|' \
210-
-e 's|@AR@|$(binutils_path)$(host_AR)|' \
211-
-e 's|@RANLIB@|$(binutils_path)$(host_RANLIB)|' \
212-
-e 's|@NM@|$(binutils_path)$(host_NM)|' \
213-
-e 's|@STRIP@|$(binutils_path)$(host_STRIP)|' \
208+
-e 's|@AR@|$(host_AR)|' \
209+
-e 's|@RANLIB@|$(host_RANLIB)|' \
210+
-e 's|@NM@|$(host_NM)|' \
211+
-e 's|@STRIP@|$(host_STRIP)|' \
214212
-e 's|@build_os@|$(build_os)|' \
215213
-e 's|@host_os@|$(host_os)|' \
216214
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \

depends/hosts/darwin.mk

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LD64_VERSION=530
66

77
OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers
88

9+
darwin_native_binutils=native_cctools
10+
911
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
1012
# FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned clang
1113
# from llvm.org
@@ -37,6 +39,16 @@ clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
3739
clang_resource_dir=$(shell clang -print-resource-dir)
3840
endif
3941

42+
cctools_TOOLS=AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL
43+
44+
# Make-only lowercase function
45+
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))))))))))))))))))))))))))
46+
47+
# For well-known tools provided by cctools, make sure that their well-known
48+
# variable is set to the full path of the tool, just like how AC_PATH_{TOO,PROG}
49+
# would.
50+
$(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(host)-$(call lc,$(TOOL))))
51+
4052
# Flag explanations:
4153
#
4254
# -mlinker-version
@@ -112,5 +124,4 @@ darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)
112124
darwin_debug_CFLAGS=-O1
113125
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)
114126

115-
darwin_native_binutils=native_cctools
116127
darwin_cmake_system=Darwin

0 commit comments

Comments
 (0)