X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=mkpkg;h=32771235434b5b7693e762d8e27433ad4fc3606c;hb=4fc7dda4cd796ed08b2522d6188f4358d3107475;hp=c1ea8ed3caf87d40da6c4ecd42ed424e6cd76566;hpb=ca5f7615983706c51b50ac5a8bfc4e123263df0e;p=debian%2Fsudo diff --git a/mkpkg b/mkpkg index c1ea8ed..3277123 100755 --- a/mkpkg +++ b/mkpkg @@ -206,7 +206,6 @@ case "$osversion" in fi configure_opts="--prefix=/usr --with-all-insults - --with-exempt=sudo --with-pam --enable-zlib=system --with-fqdn @@ -227,11 +226,22 @@ case "$osversion" in $configure_opts" ;; macos*) - # Build universal binaries (intel-only) targetting Mac OS X 10.5 - ARCH_FLAGS="-arch i386 -arch x86_64" - SDK_FLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" + 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" + if [ $osrelease -ge 105 ]; then + CFLAGS="$CFLAGS $F_PIE" + LDFLAGS="$LDFLAGS -Wl,-pie" + fi # Note, must indent with tabs, not spaces due to IFS trickery configure_opts="--prefix=$prefix --with-pam