[vlc-commits] contrib: error out early if MacOSX SDK doesn't exist

Rafaël Carré git at videolan.org
Sat Nov 26 19:38:53 CET 2011


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat Nov 26 13:38:16 2011 -0500| [7d7b602579db4b59a321b243bba882596e9f277f] | committer: Rafaël Carré

contrib: error out early if MacOSX SDK doesn't exist

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

 contrib/bootstrap    |   15 +++++++++++++++
 contrib/src/main.mak |    1 -
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/contrib/bootstrap b/contrib/bootstrap
index b24310f..e997007 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -137,6 +137,20 @@ add_make_enabled()
 	done
 }
 
+check_macosx_sdk()
+{
+   [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.5" && OSX_VERSION=10.5
+   SDK="/Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
+   if [ ! -d "${SDK}" ]
+   then
+	   echo "
+*** ${SDK} does not exist, please install required SDK, or use export OSX_VERSION=10.6 ***
+"
+	   exit 1
+   fi
+   add_make "OSX_VERSION ?= ${OSX_VERSION}"
+}
+
 test -z "$PREFIX" || add_make "PREFIX := $PREFIX"
 test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS"
 test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS"
@@ -147,6 +161,7 @@ test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS"
 OS="${HOST#*-}" # strip architecture
 case "${OS}" in
 	apple-darwin*)
+		check_macosx_sdk
 		add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
 		;;
 	*darwin*)
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 815f18a..7f10e76 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -90,7 +90,6 @@ endif
 endif
 
 ifdef HAVE_MACOSX
-OSX_VERSION?=10.5
 MACOSX_SDK=/Developer/SDKs/MacOSX$(OSX_VERSION).sdk
 CC=gcc-4.2
 CXX=g++-4.2



More information about the vlc-commits mailing list