From: Stepan Kasal Date: Tue, 15 May 2007 18:46:03 +0000 (+0200) Subject: build-sys: add SUID_LDFLAGS X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f3c9c909a41611ac5d2a9c151290296aa30a97f;p=util-linux build-sys: add SUID_LDFLAGS 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 --- diff --git a/README b/README index 9d13336d..8f9364f5 100644 --- 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. diff --git a/configure.ac b/configure.ac index 8b62decf..8740086d 100644 --- a/configure.ac +++ b/configure.ac @@ -400,6 +400,7 @@ fi AC_SUBST([SUID_CFLAGS]) +AC_SUBST([SUID_LDFLAGS]) LIBS="" diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am index 648cf17c..f6698217 100644 --- a/login-utils/Makefile.am +++ b/login-utils/Makefile.am @@ -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 diff --git a/misc-utils/Makefile.am b/misc-utils/Makefile.am index 7775bea7..a772a28b 100644 --- a/misc-utils/Makefile.am +++ b/misc-utils/Makefile.am @@ -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:: diff --git a/mount/Makefile.am b/mount/Makefile.am index e52ec6fa..cf7b00d2 100644 --- a/mount/Makefile.am +++ b/mount/Makefile.am @@ -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 \