[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcaca] patch to allow building with a different Mac OS X SDK



The attached patch allows a different Mac OS X SDK to be specified by
exporting environment variables at configure time. For example, to
build on x86 against the 10.4u SDK, I do:

env MACOSX_SDK=/Developer/SDKs/MacOSX10.4u.sdk ./configure

OK to commit this? I tested it here, and it does seem to work.

-Ben

Index: configure.ac
===================================================================
--- configure.ac        (revision 3149)
+++ configure.ac        (working copy)
@@ -240,19 +240,19 @@
     case x${target} in
     xpowerpc*darwin*)
       # 10.3 needed to link with X11
-      MACOSX_SDK=/Developer/SDKs/MacOSX10.3.9.sdk
-      GCC_VERSION=3.3
-      ARCH="-arch ppc"
-      MACOSX_SDK_CFLAGS="-nostdinc -isystem
${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION} -isystem
${MACOSX_SDK}/usr/include"
-      MACOSX_SDK_CXXFLAGS="-nostdinc++
-I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++
-I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/ppc-darwin
-I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/backward"
-      MACOSX_SDK_LDFLAGS="-L${MACOSX_SDK}/usr/lib/gcc/darwin
-L${MACOSX_SDK}/usr/lib/gcc/darwin/${GCC_VERSION}
-L${MACOSX_SDK}/usr/lib"
+      MACOSX_SDK="${MACOSX_SDK:-/Developer/SDKs/MacOSX10.3.9.sdk}"
+      GCC_VERSION="${GCC_VERSION:-3.3}"
+      ARCH="${ARCH:--arch ppc}"
+      MACOSX_SDK_CFLAGS="${MACOSX_SDK_CFLAGS:--nostdinc -isystem
${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION} -isystem
${MACOSX_SDK}/usr/include}"
+      MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CXXFLAGS:--nostdinc++
-I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++
-I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/ppc-darwin
-I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/backward}"
+      MACOSX_SDK_LDFLAGS="${MACOSX_SDK_LDFLAGS:--L${MACOSX_SDK}/usr/lib/gcc/darwin
-L${MACOSX_SDK}/usr/lib/gcc/darwin/${GCC_VERSION}
-L${MACOSX_SDK}/usr/lib}"
       ;;
     x*86*darwin*)
-      MACOSX_SDK=/Developer/SDKs/MacOSX10.5.sdk
-      GCC_VERSION=4.0
-      ARCH="-arch i386"
-      MACOSX_SDK_CFLAGS="-isysroot ${MACOSX_SDK}"
-      MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CFLAGS}"
+      MACOSX_SDK="${MACOSX_SDK:-/Developer/SDKs/MacOSX10.5.sdk}"
+      GCC_VERSION="${GCC_VERSION:-4.0}"
+      ARCH="${ARCH:--arch i386}"
+      MACOSX_SDK_CFLAGS="${MACOSX_SDK_CFLAGS:--isysroot ${MACOSX_SDK}}"
+      MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CXXFLAGS:-${MACOSX_SDK_CFLAGS}}"
       ;;
     esac
     CC=gcc-${GCC_VERSION}

Attachment: diff
Description: Binary data