[vlc-devel] commit: macosx: compile code explictly for the required architecture. ( Felix Paul Kühne )

git version control git at videolan.org
Tue Apr 14 00:21:23 CEST 2009


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Apr 14 00:21:05 2009 +0200| [cef26c7b9a03ea1430de8fe4c45ef72f9125c501] | committer: Felix Paul Kühne 

macosx: compile code explictly for the required architecture.

First step of fixing linking errors against libx264

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

 configure.ac             |   14 ++++++++++++++
 extras/contrib/bootstrap |   10 +++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4aac88f..f72f077 100644
--- a/configure.ac
+++ b/configure.ac
@@ -282,6 +282,20 @@ case "${host_os}" in
         OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
         LD="${LD} -syslibroot ${with_macosx_sdk}"
     fi
+    if test "${host_cpu}" = "powerpc"; then
+        CPP="${CPP} -arch ppc"
+        CC="${CC} -arch ppc"
+        CXX="${CXX} -arch ppc"
+        OBJC="${OBJC} -arch ppc"
+        LD="${LD} -arch ppc"
+    fi    
+    if test "${host_cpu}" = "i386"; then
+        CPP="${CPP} -arch i386"
+        CC="${CC} -arch i386"
+        CXX="${CXX} -arch i386"
+        OBJC="${OBJC} -arch i386"
+        LD="${LD} -arch i386"
+    fi
     AC_ARG_WITH(macosx-version-min,
        [  --with-macosx-version-min=VERSION  compile for MacOSX VERSION and above])
     if test "${with_macosx_version_min}" != "" ; then
diff --git a/extras/contrib/bootstrap b/extras/contrib/bootstrap
index 6cc9fe5..c221e82 100755
--- a/extras/contrib/bootstrap
+++ b/extras/contrib/bootstrap
@@ -129,7 +129,7 @@ case $HOST in
         HAVE_DARWIN_9=1
         CFLAGS_TUNING=" -arch ppc -mtune=G4"
         EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
-        EXTRA_LDFLAGS=" -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}"
+        EXTRA_LDFLAGS=" -arch ppc -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}"
         CC="/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2"
         CXX="/Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2"
         LD="ld -arch ppc -syslibroot \${MACOSX_SDK}"
@@ -155,11 +155,11 @@ case $HOST in
         fi
         echo "ENVP = MACOSX_DEPLOYMENT_TARGET=${SDK_TARGET}" >> config.mak
         echo "MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk" >> config.mak
-        CFLAGS_TUNING=" -march=pentium-m -mtune=prescott"
+        CFLAGS_TUNING=" -march=pentium-m -mtune=prescott -arch i386"
         EXTRA_CFLAGS=" -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}"
-        EXTRA_LDFLAGS=" -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}"
-        CC="/Developer/usr/llvm-gcc-4.2/bin/i686-apple-darwin9-llvm-gcc-4.2"
-        CXX="/Developer/usr/llvm-gcc-4.2/bin/i686-apple-darwin9-llvm-g++-4.2"
+        EXTRA_LDFLAGS=" -arch i386 -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK}"
+        CC="/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2"
+        CXX="/Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2"
         echo "PATH = /bin:/usr/bin:/usr/local/bin" >> config.mak
         cat src/Distributions/darwin.mak >> distro.mak
         if test -e /Developer/SDKs; then




More information about the vlc-devel mailing list