From 94937b2f2a7065b9f50062dbf054c701dac11c1c Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 14 Nov 2013 14:16:21 +0900 Subject: [PATCH] Pass Mac OS version cfg flags to rust-opengles build This was in the rust-opengles Makefile.in pre-rustpkg. --- Makefile.in | 11 +++++++++++ mk/rustpkg.mk | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 48a12933105..0e7d46e43c5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -216,6 +216,17 @@ include $(S)mk/rustpkg.mk $(foreach submodule,$(SUBMODULES_RUSTPKG),\ $(eval $(call DEF_SUBMODULE_RUSTPKG_RULES,$(submodule)))) +# rust-opengles needs some extra build options + +ifeq ($(shell uname -s),Darwin) +ifeq ($(shell sw_vers | grep -c 10.6),1) +EXTRA_RFLAGS_rust-opengles += --cfg mac_10_6 +endif +ifeq ($(shell sw_vers | grep -c 10.7),1) +EXTRA_RFLAGS_rust-opengles += --cfg mac_10_7 +endif +endif + DONE_SUBMODULES = $(foreach submodule,$(SUBMODULES),$(DONE_$(submodule))) DONE_SUBMODULES_RUSTPKG = $(foreach submodule,$(SUBMODULES_RUSTPKG),$(DONE_$(submodule))) diff --git a/mk/rustpkg.mk b/mk/rustpkg.mk index 3fd90d878a8..29a1bad8cb5 100644 --- a/mk/rustpkg.mk +++ b/mk/rustpkg.mk @@ -10,6 +10,8 @@ $(1) : $$(DONE_$(1)) DO_CLEAN_$(1) = rm -rf $$(DONE_$(1)) $(CFG_BUILD_HOME)/workspace/build/$(CFG_TARGET_TRIPLES)/$(1) +EXTRA_RFLAGS_$(1) = + clean-$(1) : $$(Q) $$(DO_CLEAN_$(1)) .PHONY : clean-$(1) @@ -18,7 +20,7 @@ clean-$(1) : $$(DONE_$(1)) : $$(DONE_rust) $$(DONE_DEPS_$(1)) $$(ROUGH_DEPS_$(1)) $$(Q) $$(DO_CLEAN_$(1)) $$(Q) RUST_PATH=$(CFG_BUILD_HOME)workspace:$(subst $(SPACE),:,$(foreach submodule,$(strip $(CFG_SUBMODULES_RUSTPKG)),$(S)src/$(submodule))) \ - $(CFG_RUSTPKG) --rust-path-hack install $(CFG_RUSTC_FLAGS) $(1) + $(CFG_RUSTPKG) --rust-path-hack install $(CFG_RUSTC_FLAGS) $$(EXTRA_RFLAGS_$(1)) $(1) endef