build-sys: add SUID_CFLAGS

The patch allows to define special CFLAGS for typical suid programs
(like mount, umount, chfn, ...). Some distributions use for example
"-fpic" for suid binaries.

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2007-04-24 11:44:19 +02:00
parent dd9f213ab6
commit 06bcee19a2
5 changed files with 22 additions and 0 deletions

12
README
View File

@ -48,3 +48,15 @@ VERSION SCHEMA:
suffix = "devel" or "rc<N>"
COMPILATION:
See the INSTALL file for more details.
Notes:
* use SUID_CFLAGS when you want to define special compiler options
for typical suid programs, for example:
SUID_CFLAGS="-fpic" ./configure
Now this feature is supported for chfn, chsh, newgrp, write,
mount and umount.

View File

@ -398,6 +398,9 @@ if test x$enable_use_tty_group = xyes; then
AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?])
fi
AC_SUBST([SUID_CFLAGS])
CPPFLAGS="-fsigned-char -fomit-frame-pointer $CPPFLAGS"
LIBS=""

View File

@ -51,6 +51,10 @@ login_LDADD = ../lib/libsetproctitle.a
newgrp_LDADD =
vipw_LDADD =
chfn_CFLAGS = $(SUID_CFLAGS)
chsh_CFLAGS = $(SUID_CFLAGS)
newgrp_CFLAGS = $(SUID_CFLAGS)
if NEED_LIBCRYPT
chfn_LDADD += -lcrypt
chsh_LDADD += -lcrypt

View File

@ -64,6 +64,7 @@ if BUILD_WRITE
usrbinexec_PROGRAMS += write
man_MANS += write.1
write_CFLAGS = $(SUID_CFLAGS)
if USE_TTY_GROUP
install-exec-hook::

View File

@ -22,6 +22,7 @@ mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
$(MNTHDRS)
mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a
mount_CFLAGS = $(SUID_CFLAGS)
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 \
@ -29,6 +30,7 @@ umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c
$(MNTHDRS)
umount_LDADD = $(top_srcdir)/lib/libenv.a
umount_CFLAGS = $(SUID_CFLAGS)
swapon_SOURCES = swapon.c xmalloc.c \
get_label_uuid.c mount_by_label.c mount_blkid.c \