]> granicus.if.org Git - sudo/commitdiff
Build PIE executables for newer Debian and Ubuntu
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 12 Jan 2012 18:19:36 +0000 (13:19 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 12 Jan 2012 18:19:36 +0000 (13:19 -0500)
--HG--
branch : 1.7

mkpkg

diff --git a/mkpkg b/mkpkg
index ca3b6b8bddc046916551246214cdd05e45e22d23..2c50cfc6723be4ea0e571529281b26aeb57871db 100755 (executable)
--- a/mkpkg
+++ b/mkpkg
@@ -189,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