[vlc-devel] commit: contribs/darwin: added support for llvm-gcc-4.2 ( both binary and src) ( Felix Paul Kühne )

git version control git at videolan.org
Wed Dec 31 15:40:33 CET 2008


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Dec 31 15:37:37 2008 +0100| [afc47e4415e946db9c209de3992f9752d3046db8] | committer: Felix Paul Kühne 

contribs/darwin: added support for llvm-gcc-4.2 (both binary and src)

this looks a bit ugly in bootstrap now and will need to be cleaned up once we dropped support for 10.4

This is also a first step to be able to compile a 64bit VLC on OS X.

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

 extras/contrib/Makefile     |    4 +-
 extras/contrib/bootstrap    |   60 ++++++++++++++++++++++++++++++++++++++----
 extras/contrib/src/Makefile |    8 +++++
 3 files changed, 64 insertions(+), 8 deletions(-)

diff --git a/extras/contrib/Makefile b/extras/contrib/Makefile
index 83b1465..f00ced9 100644
--- a/extras/contrib/Makefile
+++ b/extras/contrib/Makefile
@@ -44,10 +44,10 @@ src: using-src
 ifdef HAVE_DARWIN_OS
 
 CONTRIBREV=4
-contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
+contrib-macosx-$(ARCH)-$(CONTRIBREV)-$(DARWIN_COMPILER).tar.bz2:
 	$(WGET) ftp://ftp.videolan.org/pub/videolan/testing/contrib/$@
 
-using-bin: contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
+using-bin: contrib-macosx-$(ARCH)-$(CONTRIBREV)-$(DARWIN_COMPILER).tar.bz2
 	@if test -d tmp; then \
 		echo "Move away ./tmp, it's in the way" ; \
 		exit 1 ; \
diff --git a/extras/contrib/bootstrap b/extras/contrib/bootstrap
index 777cc7a..0d82cd9 100755
--- a/extras/contrib/bootstrap
+++ b/extras/contrib/bootstrap
@@ -84,6 +84,11 @@ case $HOST in
     *darwin*)
         echo "HAVE_DARWIN_OS = 1" >> config.mak
         echo "HAVE_BSD = 1" >> config.mak
+        if test $CONTRIBS_CC_LLVM; then
+            echo "DARWIN_COMPILER = LLVMGCC" >> config.mak
+        else
+            echo "DARWIN_COMPILER = GCC" >> config.mak
+        fi
     ;;
     *linux*)
         echo "HAVE_LINUX = 1" >> config.mak
@@ -136,15 +141,29 @@ case $HOST in
     ;;
     powerpc-apple-darwin9)
 # Mac OS X 10.5 with Xcode 3, specific rules apply
-        SDK_TARGET=10.4
+        if test -z "$CONTRIBS_CC_LLVM"; then
+            SDK_TARGET=10.4
+        else
+            SDK_TARGET=10.5
+        fi
         echo "SDK_TARGET = ${SDK_TARGET}" >> config.mak
         echo "ENVP = MACOSX_DEPLOYMENT_TARGET=${SDK_TARGET}" >> config.mak
-        echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.4u.sdk" >> config.mak
+        if test -z "$CONTRIBS_CC_LLVM"; then
+            echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.4u.sdk" >> config.mak
+        else
+            echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk" >> config.mak
+        fi
         echo "HAVE_DARWIN_9 = 1" >> config.mak
+        HAVE_DARWIN_9=1
         CFLAGS_TUNING=" -arch ppc -mtune=G4"
         EXTRA_CFLAGS=" -D\${ENVP} -mmacosx-version-min=\${SDK_TARGET}"
-        CC="gcc -isysroot \${MACOSX_SDK}"
-        CXX="g++ -isysroot \${MACOSX_SDK}"
+        if test -z "$CONTRIBS_CC_LLVM"; then
+            CC="gcc -isysroot \${MACOSX_SDK}"
+            CXX="g++ -isysroot \${MACOSX_SDK}"
+        else
+            CC="/Developer/usr/llvm-gcc-4.2/bin/powerpc-apple-darwin9-llvm-gcc-4.2 -isysroot \${MACOSX_SDK}"
+            CXX="/Developer/usr/llvm-gcc-4.2/bin/powerpc-apple-darwin9-llvm-g++-4.2 -isysroot \${MACOSX_SDK}"
+        fi
         LD="ld -arch ppc -syslibroot \${MACOSX_SDK}"
         echo "PATH = /bin:/usr/bin:/usr/local/bin:" >> config.mak
         cat src/Distributions/darwin.mak >> distro.mak
@@ -156,20 +175,36 @@ case $HOST in
         fi
     ;;
     i686-apple-darwin9)
-        SDK_TARGET=10.4
+        if test -z "$CONTRIBS_CC_LLVM"; then
+            SDK_TARGET=10.4
+        else
+            SDK_TARGET=10.5
+        fi
         MIN_LD_VERSION_WITH_TEXT_RELOCATION=81
         echo "SDK_TARGET = ${SDK_TARGET}" >> config.mak
         echo "HAVE_DARWIN_OS_ON_INTEL = 1" >> config.mak
         echo "HAVE_DARWIN_9 = 1" >> config.mak
+        HAVE_DARWIN_9=1
         if test `ld -v 2> /dev/stdout | sed -E 's/.*ld64-([0-9]+).*/\1/'` -lt ${MIN_LD_VERSION_WITH_TEXT_RELOCATION}; then
             echo "ERROR: Your ld version is unable to compile VLC.\nUpdate to Xcode 3.1 or higher." >&2
             exit 1
         fi
         echo "ENVP = MACOSX_DEPLOYMENT_TARGET=${SDK_TARGET}" >> config.mak
-        echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.4u.sdk" >> config.mak
+        if test -z "$CONTRIBS_CC_LLVM"; then
+            echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.4u.sdk" >> config.mak
+        else
+            echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk" >> config.mak
+        fi
         CFLAGS_TUNING=" -march=pentium-m -mtune=prescott"
         EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
         EXTRA_LDFLAGS=" -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}"
+        if test -z "$CONTRIBS_CC_LLVM"; then
+            CC="gcc -isysroot \${MACOSX_SDK}"
+            CXX="g++ -isysroot \${MACOSX_SDK}"
+        else
+            CC="/Developer/usr/llvm-gcc-4.2/bin/i686-apple-darwin9-llvm-gcc-4.2 -isysroot \${MACOSX_SDK}"
+            CXX="/Developer/usr/llvm-gcc-4.2/bin/i686-apple-darwin9-llvm-g++-4.2 -isysroot \${MACOSX_SDK}"
+        fi
         echo "PATH = /bin:/usr/bin:/usr/local/bin" >> config.mak
         cat src/Distributions/darwin.mak >> distro.mak
         if test -e /Developer/SDKs; then
@@ -330,3 +365,16 @@ if test -z "$CONTRIBS_RELEASE"; then
 else
     echo "EXTRA_CFLAGS += -DNDEBUG" >> config.mak
 fi
+
+if test $HAVE_DARWIN_9; then
+if test -z "$CONTRIBS_CC_LLVM"; then
+    set +x
+    echo
+    echo "***********************************************************"
+    echo "* In case that you target Mac OS X 10.5 or later only,    *"
+    echo "* we recommend to use llvm-gcc-4.2 for compilation.       *"
+    echo "* Please run CONTRIBS_CC_LLVM=yes ./bootstrap to do so.   *"
+    echo "***********************************************************"
+    set -x
+fi
+fi
diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile
index 2e90df8..4848929 100644
--- a/extras/contrib/src/Makefile
+++ b/extras/contrib/src/Makefile
@@ -44,6 +44,14 @@ export CFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
 export CPPFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
 export CXXFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
 export LDFLAGS = -L$(PREFIX)/lib $(EXTRA_LDFLAGS)
+ifdef HAVE_DARWIN_OS
+export CC
+export CXX
+export LD
+export RANLIB
+export AR
+export STRIP
+endif
 
 # ***************************************************************************
 # Cross compilation variables




More information about the vlc-devel mailing list