Commit 7d7b6025 authored by Rafaël Carré's avatar Rafaël Carré

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

parent 98ad3f3c
...@@ -137,6 +137,20 @@ add_make_enabled() ...@@ -137,6 +137,20 @@ add_make_enabled()
done 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 "$PREFIX" || add_make "PREFIX := $PREFIX"
test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS" test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS"
test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS" test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS"
...@@ -147,6 +161,7 @@ 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 OS="${HOST#*-}" # strip architecture
case "${OS}" in case "${OS}" in
apple-darwin*) apple-darwin*)
check_macosx_sdk
add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD" add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
;; ;;
*darwin*) *darwin*)
......
...@@ -90,7 +90,6 @@ endif ...@@ -90,7 +90,6 @@ endif
endif endif
ifdef HAVE_MACOSX ifdef HAVE_MACOSX
OSX_VERSION?=10.5
MACOSX_SDK=/Developer/SDKs/MacOSX$(OSX_VERSION).sdk MACOSX_SDK=/Developer/SDKs/MacOSX$(OSX_VERSION).sdk
CC=gcc-4.2 CC=gcc-4.2
CXX=g++-4.2 CXX=g++-4.2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment