From 48dfc6594583e69e8fc392e66d171de4f1320ad4 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 23 Apr 2012 16:53:12 -0400 Subject: [PATCH] Only build Mac intel universal binary on an intel machine. When building on Mac OS X, set SDK_FLAGS if specified osversion doesn't match host. --HG-- branch : 1.7 --- mkpkg | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mkpkg b/mkpkg index 4d1dafc36..b8a161103 100755 --- 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 -- 2.50.1