[build/clang_darwin] Don't try to run sw_vers if we don't have it.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 25 Jan 2013 18:09:28 +0000 (18:09 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 25 Jan 2013 18:09:28 +0000 (18:09 +0000)
 - Also, fix the test this is guarding, which was backwards.

llvm-svn: 173465

compiler-rt/make/platform/clang_darwin.mk

index 9903984..7f8b4d7 100644 (file)
@@ -83,12 +83,14 @@ UniversalArchs.ubsan_osx := $(call CheckArches,i386 x86_64,ubsan_osx)
 # object files. If we are on that platform, strip out all ARM archs. We still
 # build the libraries themselves so that Clang can find them where it expects
 # them, even though they might not have an expected slice.
-ifneq ($(shell sw_vers -productVersion | grep 10.6),)
+ifneq ($(shell which sw_vers),)
+ifeq ($(shell sw_vers -productVersion | grep 10.6),)
 UniversalArchs.ios := $(filter-out armv7, $(UniversalArchs.ios))
 UniversalArchs.cc_kext := $(filter-out armv7, $(UniversalArchs.cc_kext))
 UniversalArchs.cc_kext_ios5 := $(filter-out armv7, $(UniversalArchs.cc_kext_ios5))
 UniversalArchs.profile_ios := $(filter-out armv7, $(UniversalArchs.profile_ios))
 endif
+endif
 
 # If RC_SUPPORTED_ARCHS is defined, treat it as a list of the architectures we
 # are intended to support and limit what we try to build to that.