Commit 30a5b9d2 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

config: Factorize the Mac OS X targets.

parent f7b1d4f0
...@@ -58,14 +58,6 @@ info() ...@@ -58,14 +58,6 @@ info()
echo "[contrib] $1" echo "[contrib] $1"
} }
ensure_macosx_sdk_presence()
{
if ! test -e /Developer/SDKs; then
error "Your Developer Tools' SDKs were not found.\nYou need to add extra symbolic links to /Developer to achieve correctly\nbuilt contribs.\nHave a look at the OSX-Compile-HOWTO for details." >&2
exit 1
fi
}
DISTRO= DISTRO=
BUILDDIR=. BUILDDIR=.
...@@ -195,75 +187,44 @@ case $TARGET in ...@@ -195,75 +187,44 @@ case $TARGET in
;; ;;
powerpc-apple-darwin9) powerpc-apple-darwin9)
DISTRO=darwin DISTRO=darwin
HAVE_DARWIN_9=1
HAVE_DARWIN_32=1 HAVE_DARWIN_32=1
SDK_TARGET=10.5
CFLAGS_TUNING=" -arch ppc -mtune=G4" CFLAGS_TUNING=" -arch ppc -mtune=G4"
EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" EXTRA_LDFLAGS=" -arch ppc"
EXTRA_LDFLAGS=" -arch ppc -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET} -Wl,-syslibroot,\${MACOSX_SDK}"
CC="/Developer/usr/bin/gcc-4.2"
CXX="/Developer/usr/bin/g++-4.2"
LD="ld -arch ppc -syslibroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
add_makefile_cfg "SDK_TARGET = ${SDK_TARGET}" # FIXME - this one seems to be redundant?
add_makefile_cfg "ENVP = MACOSX_DEPLOYMENT_TARGET=${SDK_TARGET}" LD="ld -arch ppc -syslibroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
add_makefile_cfg "MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk"
add_makefile_cfg "HAVE_DARWIN_9 = 1"
add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin:"
ensure_macosx_sdk_presence
;; ;;
i686-apple-darwin*) i686-apple-darwin*)
DISTRO=darwin DISTRO=darwin
HAVE_DARWIN_9=1
HAVE_DARWIN_32=1 HAVE_DARWIN_32=1
SDK_TARGET=10.5
CFLAGS_TUNING=" -march=prescott -mtune=generic -arch i386 -m32" CFLAGS_TUNING=" -march=prescott -mtune=generic -arch i386 -m32"
EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" EXTRA_LDFLAGS=" -arch i386"
EXTRA_LDFLAGS=" -arch i386 -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
CC="/Developer/usr/bin/gcc-4.2"
CXX="/Developer/usr/bin/g++-4.2"
add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin"
add_makefile_cfg "SDK_TARGET = ${SDK_TARGET}"
add_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL = 1" add_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL = 1"
add_makefile_cfg "HAVE_DARWIN_9 = 1"
add_makefile_cfg "ENVP = MACOSX_DEPLOYMENT_TARGET=${SDK_TARGET}"
add_makefile_cfg "MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk"
if test $TARGET = "i686-apple-darwin10"; then if test $TARGET = "i686-apple-darwin10"; then
add_makefile_cfg "HAVE_DARWIN_10 = 1" add_makefile_cfg "HAVE_DARWIN_10 = 1"
fi fi
ensure_macosx_sdk_presence
;; ;;
x86_64-apple-darwin*) x86_64-apple-darwin*)
DISTRO=darwin64 DISTRO=darwin64
SDK_TARGET=10.5
HAVE_DARWIN_64=1 HAVE_DARWIN_64=1
CFLAGS_TUNING=" -march=core2 -mtune=core2 -m64 -arch x86_64" CFLAGS_TUNING=" -march=core2 -mtune=core2 -m64 -arch x86_64"
EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" EXTRA_LDFLAGS=" -arch x86_64"
EXTRA_LDFLAGS=" -arch x86_64 -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
CC="/Developer/usr/bin/gcc-4.2" # FIXME - is this stuff needed?
CXX="/Developer/usr/bin/g++-4.2"
LD="ld" LD="ld"
RANLIB="ranlib" RANLIB="ranlib"
AR="ar" AR="ar"
STRIP="strip" STRIP="strip"
add_makefile_cfg "SDK_TARGET = ${SDK_TARGET}"
add_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL = 1" add_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL = 1"
add_makefile_cfg "HAVE_DARWIN_9 = 1"
add_makefile_cfg "ENVP = MACOSX_DEPLOYMENT_TARGET=${SDK_TARGET}"
add_makefile_cfg "MACOSX_SDK = /Developer/SDKs/MacOSX${SDK_TARGET}.sdk"
add_makefile_cfg "HAVE_DARWIN_64 = 1"
add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin" add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin"
if test $TARGET = "x86_64-apple-darwin10"; then if test $TARGET = "x86_64-apple-darwin10"; then
add_makefile_cfg "HAVE_DARWIN_10 = 1" add_makefile_cfg "HAVE_DARWIN_10 = 1"
fi fi
ensure_macosx_sdk_presence
;; ;;
*mingw32ce) *mingw32ce)
add_makefile_cfg "PKG_CONFIG_PATH = \$(PREFIX)/lib/pkgconfig" add_makefile_cfg "PKG_CONFIG_PATH = \$(PREFIX)/lib/pkgconfig"
...@@ -364,6 +325,23 @@ case "$DISTRO" in ...@@ -364,6 +325,23 @@ case "$DISTRO" in
fi fi
add_makefile_cfg "IOS_SDK_ROOT = ${IOS_SDK_ROOT}" add_makefile_cfg "IOS_SDK_ROOT = ${IOS_SDK_ROOT}"
;; ;;
darwin*)
SDK_TARGET=10.5
HAVE_DARWIN_9=1
EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
CC="/Developer/usr/bin/gcc-4.2"
CXX="/Developer/usr/bin/g++-4.2"
add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin"
add_makefile_cfg "SDK_TARGET = ${SDK_TARGET}"
add_makefile_cfg "ENVP = MACOSX_DEPLOYMENT_TARGET=${SDK_TARGET}"
add_makefile_cfg "MACOSX_SDK = /Developer/SDKs/MacOSX${SDK_TARGET}.sdk"
if ! test -e /Developer/SDKs; then
error "Your Developer Tools' SDKs were not found.\nYou need to add extra symbolic links to /Developer to achieve correctly\nbuilt contribs.\nHave a look at the OSX-Compile-HOWTO for details." >&2
exit 1
fi
;;
esac esac
# Save passed flags # Save passed flags
...@@ -438,12 +416,14 @@ if test -z "$CONTRIBS_RELEASE"; then ...@@ -438,12 +416,14 @@ if test -z "$CONTRIBS_RELEASE"; then
fi fi
if test $HAVE_DARWIN_9; then if test $HAVE_DARWIN_9; then
add_makefile_cfg "HAVE_DARWIN_9 = 1"
if ! /Developer/usr/bin/gcc-4.2 --version>/dev/null 2>&1; then if ! /Developer/usr/bin/gcc-4.2 --version>/dev/null 2>&1; then
error "You do not have GCC-4.2 instelled, compilation WILL FAIL." error "You do not have GCC-4.2 instelled, compilation WILL FAIL."
fi fi
fi fi
if test $HAVE_DARWIN_32; then if test $HAVE_DARWIN_32; then
add_makefile_cfg "HAVE_DARWIN_32 = 1"
info "*****************************************************************" info "*****************************************************************"
info "* VLC will be compiled in 32bit mode. *" info "* VLC will be compiled in 32bit mode. *"
info "* *" info "* *"
...@@ -455,6 +435,7 @@ if test $HAVE_DARWIN_32; then ...@@ -455,6 +435,7 @@ if test $HAVE_DARWIN_32; then
fi fi
if test $HAVE_DARWIN_64; then if test $HAVE_DARWIN_64; then
add_makefile_cfg "HAVE_DARWIN_64 = 1"
info info
info "*****************************************************************" info "*****************************************************************"
info "* VLC will be compiled in 64bit mode using the 10.5 SDK. *" info "* VLC will be compiled in 64bit mode using the 10.5 SDK. *"
......
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