X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=mkpkg;h=32771235434b5b7693e762d8e27433ad4fc3606c;hb=6a93597e3f8b17b884f1234a1e0e089da32882af;hp=d2aec97fa122870187d29ce3fc01387387180bc4;hpb=305bd839dd0df08fdacf0a3f20bbe801e698daed;p=debian%2Fsudo diff --git a/mkpkg b/mkpkg index d2aec97..3277123 100755 --- a/mkpkg +++ b/mkpkg @@ -121,6 +121,10 @@ fi case "$osversion" in centos*|rhel*) prefix=/usr + if [ $osrelease -ge 40 ]; then + # RHEL 4 and up support SELinux + configure_opts="${configure_opts}${configure_opts+$tab}--with-selinux" + fi if [ $osrelease -ge 50 ]; then # RHEL 5 and up build pies, have audit support and use a # separate PAM config file for "sudo -i". @@ -140,7 +144,6 @@ case "$osversion" in --with-ignore-dot --with-tty-tickets --with-ldap - --with-selinux --with-passprompt=[sudo] password for %p: $configure_opts" ;; @@ -186,6 +189,14 @@ case "$osversion" in case "$osversion" in ubu*) configure_opts="${configure_opts}${configure_opts+$tab}--enable-admin-flag${tab}--without-lecture" + if [ $osrelease -ge 1004 ]; then + export CFLAGS="-O2 -g $F_PIE" LDFLAGS="-pie" + fi + ;; + deb*) + if [ $osrelease -ge 600 ]; then + export CFLAGS="-O2 -g $F_PIE" LDFLAGS="-pie" + fi ;; esac # Note, must indent with tabs, not spaces due to IFS trickery @@ -195,7 +206,6 @@ case "$osversion" in fi configure_opts="--prefix=/usr --with-all-insults - --with-exempt=sudo --with-pam --enable-zlib=system --with-fqdn @@ -215,6 +225,36 @@ case "$osversion" in --with-secure-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin $configure_opts" ;; + macos*) + 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 + --without-tty-tickets + --enable-zlib=system + --with-ldap + --with-insults=disabled + --with-logging=syslog + --with-logfac=authpriv + --with-editor=/usr/bin/vim + --with-env-editor + $configure_opts" + ;; *) # For Solaris, add project support and use let configure choose zlib. # For all others, use the builtin zlib and disable NLS support.