From: Todd C. Miller Date: Mon, 23 Apr 2012 20:53:12 +0000 (-0400) Subject: Only build Mac intel universal binary on an intel machine. X-Git-Tag: SUDO_1_7_9p1~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48dfc6594583e69e8fc392e66d171de4f1320ad4;p=sudo 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 --- 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