aboutsummaryrefslogtreecommitdiff
path: root/depends/funcs.mk
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-08-20 17:30:30 -0400
committerCarl Dong <contact@carldong.me>2021-01-07 14:02:39 -0500
commit107f33d434ebbe6f93fa187e2af1f6f850e82d3b (patch)
treec1cebf76882ac9aa85d4fe7ed4bd71dcc09d7e38 /depends/funcs.mk
parentd7e2401c629be3db6ceef551ee0f74deb56c02d1 (diff)
depends: Delay expansion of per-package vars
Prior to this commit, when int_vars was called for packages, it would immediately expand the "single-dollar variables", which may be defined in terms of variables which are not yet determined (e.g. variables defined in package/*.mk, which are included after int_vars is called). This is required for the next commit as after that commit, for darwin cross-builds: 0. int_vars is defined in terms of $(1)_cc 1. $(1)_cc is defined in terms of darwin_CC 2. ... which is defined in terms of clang_resource_dir 3. ... which is defined in terms of native_cctools_clang_version 4. which is undetermined at the time when int_vars is being expanded and evaluated
Diffstat (limited to 'depends/funcs.mk')
-rw-r--r--depends/funcs.mk30
1 files changed, 18 insertions, 12 deletions
diff --git a/depends/funcs.mk b/depends/funcs.mk
index 5697bd6f15..c0159f0e38 100644
--- a/depends/funcs.mk
+++ b/depends/funcs.mk
@@ -1,17 +1,23 @@
define int_vars
#Set defaults for vars which may be overridden per-package
-$(1)_cc=$($($(1)_type)_CC)
-$(1)_cxx=$($($(1)_type)_CXX)
-$(1)_objc=$($($(1)_type)_OBJC)
-$(1)_objcxx=$($($(1)_type)_OBJCXX)
-$(1)_ar=$($($(1)_type)_AR)
-$(1)_ranlib=$($($(1)_type)_RANLIB)
-$(1)_libtool=$($($(1)_type)_LIBTOOL)
-$(1)_nm=$($($(1)_type)_NM)
-$(1)_cflags=$($($(1)_type)_CFLAGS) $($($(1)_type)_$(release_type)_CFLAGS)
-$(1)_cxxflags=$($($(1)_type)_CXXFLAGS) $($($(1)_type)_$(release_type)_CXXFLAGS)
-$(1)_ldflags=$($($(1)_type)_LDFLAGS) $($($(1)_type)_$(release_type)_LDFLAGS) -L$($($(1)_type)_prefix)/lib
-$(1)_cppflags=$($($(1)_type)_CPPFLAGS) $($($(1)_type)_$(release_type)_CPPFLAGS) -I$($($(1)_type)_prefix)/include
+$(1)_cc=$$($$($(1)_type)_CC)
+$(1)_cxx=$$($$($(1)_type)_CXX)
+$(1)_objc=$$($$($(1)_type)_OBJC)
+$(1)_objcxx=$$($$($(1)_type)_OBJCXX)
+$(1)_ar=$$($$($(1)_type)_AR)
+$(1)_ranlib=$$($$($(1)_type)_RANLIB)
+$(1)_libtool=$$($$($(1)_type)_LIBTOOL)
+$(1)_nm=$$($$($(1)_type)_NM)
+$(1)_cflags=$$($$($(1)_type)_CFLAGS) \
+ $$($$($(1)_type)_$$(release_type)_CFLAGS)
+$(1)_cxxflags=$$($$($(1)_type)_CXXFLAGS) \
+ $$($$($(1)_type)_$$(release_type)_CXXFLAGS)
+$(1)_ldflags=$$($$($(1)_type)_LDFLAGS) \
+ $$($$($(1)_type)_$$(release_type)_LDFLAGS) \
+ -L$$($($(1)_type)_prefix)/lib
+$(1)_cppflags=$$($$($(1)_type)_CPPFLAGS) \
+ $$($$($(1)_type)_$$(release_type)_CPPFLAGS) \
+ -I$$($$($(1)_type)_prefix)/include
$(1)_recipe_hash:=
endef