]> err.no Git - util-linux/commitdiff
build-sys: add SUID_LDFLAGS
authorStepan Kasal <skasal@redhat.com>
Tue, 15 May 2007 18:46:03 +0000 (20:46 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 16 May 2007 09:43:29 +0000 (11:43 +0200)
Programs which are usually installed with the setuid bit do need their own
CFLAGS and LDFLAGS.  SUID_LDFLAGS is analogic to SUID_CFLAGS.

Signed-off-by: Stepan Kasal <skasal@redhat.com>
README
configure.ac
login-utils/Makefile.am
misc-utils/Makefile.am
mount/Makefile.am

diff --git a/README b/README
index 9d13336d585653ba08d610a108c0555a63b4864b..8f9364f5303a9deba6ccc4007c4f7a085289405d 100644 (file)
--- a/README
+++ b/README
@@ -40,10 +40,10 @@ COMPILATION:
       See the INSTALL file for more details.
 
       Notes:
-            * use SUID_CFLAGS when you want to define special compiler options
+            * use SUID_CFLAGS and SUID_LDFLAGS when you want to define special compiler options
               for typical suid programs, for example:
 
-                  SUID_CFLAGS="-fpic" ./configure
+                  SUID_CFLAGS="-fpie" SUID_LDFLAGS="-pie" ./configure
 
               Now this feature is supported for chfn, chsh, newgrp, write,
               mount and umount.
index 8b62decf1139bfb1e9cb3891869cc66645447fc2..8740086dfc43c8dbff395539378f9950312e66dc 100644 (file)
@@ -400,6 +400,7 @@ fi
 
 
 AC_SUBST([SUID_CFLAGS])
+AC_SUBST([SUID_LDFLAGS])
 
 LIBS=""
 
index 648cf17c4f27ce5e11a1a8ab4e31fbcdb4f5b2ea..f6698217587210e69aea22708a02d9924de9174e 100644 (file)
@@ -55,6 +55,10 @@ chfn_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
 chsh_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
 newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
 
+chfn_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+chsh_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+
 if NEED_LIBCRYPT
 chfn_LDADD += -lcrypt
 chsh_LDADD += -lcrypt
index 7775bea73c0e34475d31df06b9d124a245f97fb2..a772a28bd5d419b508beac41c22fbfea283b435a 100644 (file)
@@ -65,6 +65,7 @@ if BUILD_WRITE
 usrbinexec_PROGRAMS += write
 man_MANS += write.1
 write_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+write_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 
 if USE_TTY_GROUP
 install-exec-hook::
index e52ec6fa9282b36d7aa92691a36ac913e46ed9f2..cf7b00d2636c42877802cff1806ebeb3d21526b4 100644 (file)
@@ -20,6 +20,7 @@ mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
 
 mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a
 mount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+mount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 
 umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
        getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \
@@ -28,6 +29,7 @@ umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c
        
 umount_LDADD = $(top_srcdir)/lib/libenv.a
 umount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
+umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 
 swapon_SOURCES = swapon.c xmalloc.c \
        get_label_uuid.c mount_by_label.c mount_blkid.c \