[vlc-commits] contrib: detect XCode > 3

Rafaël Carré git at videolan.org
Sat Nov 26 18:36:12 CET 2011


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat Nov 26 12:35:37 2011 -0500| [e47fb7cd004cd51c21f563593501a359a3a3f7ee] | committer: Rafaël Carré

contrib: detect XCode > 3

We need -arch to specify which arch to be built, else we have no idea

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e47fb7cd004cd51c21f563593501a359a3a3f7ee
---

 contrib/src/bghudappkit/rules.mak |    2 +-
 contrib/src/growl/rules.mak       |    2 +-
 contrib/src/main.mak              |    8 ++++++++
 contrib/src/sparkle/rules.mak     |    2 +-
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/contrib/src/bghudappkit/rules.mak b/contrib/src/bghudappkit/rules.mak
index 6032cb5..4da01e6 100644
--- a/contrib/src/bghudappkit/rules.mak
+++ b/contrib/src/bghudappkit/rules.mak
@@ -20,7 +20,7 @@ bghudappkit: bghudappkit-git.tar.xz .sum-bghudappkit
 	$(MOVE)
 
 .bghudappkit: bghudappkit
-	cd $< && xcodebuild -sdk macosx$(OSX_VERSION)
+	cd $< && xcodebuild $(XCODE_FLAGS)
 	install_name_tool -change @loader_path/../../../../../../../BGHUDAppKit.framework/Versions/A/BGHUDAppKit \
 								@loader_path/../../../../Versions/A/BGHUDAppKit \
 		$</build/Release/BGHUDAppKit.framework/Resources/BGHUDAppKitPlugin.ibplugin/Contents/MacOS/BGHUDAppKitPlugin
diff --git a/contrib/src/growl/rules.mak b/contrib/src/growl/rules.mak
index 292e9a8..2f41daf 100644
--- a/contrib/src/growl/rules.mak
+++ b/contrib/src/growl/rules.mak
@@ -23,6 +23,6 @@ growl: growl-$(GROWL_VERSION).tar.bz2 .sum-growl
 	touch $@
 
 .growl: growl
-	cd $< && xcodebuild -target Growl.framework -configuration Release
+	cd $< && xcodebuild $(XCODE_FLAGS) -target Growl.framework -configuration Release
 	cd $< && cp -R -L build/Release/Growl.framework "$(PREFIX)"
 	touch $@
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index c212d71..1c0cf98 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -108,6 +108,14 @@ else
 EXTRA_CFLAGS += -m32
 EXTRA_LDFLAGS += -m32
 endif
+
+XCODE_FLAGS = -sdk macosx$(OSX_VERSION)
+ifeq ($(xcodebuild -version 2>/dev/null | tee /dev/null|head -1|cut -d\  -f2|cut -d. -f1), 3)
+# XCode 3 doesn't support -arch
+else
+XCODE_FLAGS += -arch $(ARCH)
+endif
+
 endif
 
 
diff --git a/contrib/src/sparkle/rules.mak b/contrib/src/sparkle/rules.mak
index d9bafcb..f9bbef6 100644
--- a/contrib/src/sparkle/rules.mak
+++ b/contrib/src/sparkle/rules.mak
@@ -21,6 +21,6 @@ sparkle: sparkle-$(SPARKLE_VERSION).zip .sum-sparkle
 	touch $@
 
 .sparkle: sparkle
-	cd $</Extras/Source\ Code && $(MAKE) && xcodebuild
+	cd $</Extras/Source\ Code && $(MAKE) && xcodebuild $(XCODE_FLAGS)
 	cd $< && cp -R -L Extras/Source\ Code/build/release/Sparkle.framework "$(PREFIX)"
 	touch $@



More information about the vlc-commits mailing list