]> granicus.if.org Git - sudo/commitdiff
Only build Mac intel universal binary on an intel machine.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 23 Apr 2012 20:53:12 +0000 (16:53 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 23 Apr 2012 20:53:12 +0000 (16:53 -0400)
When building on Mac OS X, set SDK_FLAGS if specified osversion
doesn't match host.

--HG--
branch : 1.7

mkpkg

diff --git a/mkpkg b/mkpkg
index 4d1dafc36a42b37a7211d6193b5293de38686400..b8a161103d309bd010f0a876deb22ca308264c46 100755 (executable)
--- a/mkpkg
+++ b/mkpkg
@@ -227,9 +227,18 @@ case "$osversion" in
                $configure_opts"
        ;;
     macos*)
-       # Build universal binaries, curently intel-only
-       export CFLAGS="-O2 -g -arch i386 -arch x86_64"
-       export LDFLAGS="-arch i386 -arch x86_64"
+       case "$osversion" in
+           *i386|*x86_64)
+               # Build intel-only universal binaries
+               ARCH_FLAGS="-arch i386 -arch x86_64"
+               ;;
+       esac
+       if test "${osversion}" != "`$top_srcdir/pp --probe`"; then
+           sdkvers=`echo "${osversion}" | sed 's/^macos\([0-9][0-9]\)\([0-9]*\)-.*$/\1.\2/'`
+           SDK_FLAGS="-isysroot /Developer/SDKs/MacOSX${sdkvers}.sdk -mmacosx-version-min=${sdkvers}"
+       fi
+       export CFLAGS="-O2 -g $ARCH_FLAGS $SDK_FLAGS"
+       export LDFLAGS="$ARCH_FLAGS $SDK_FLAGS"
        # Note, must indent with tabs, not spaces due to IFS trickery
        configure_opts="--prefix=$prefix
                --with-pam