From 2984313a46226c7ecd8c5db92236bfaea107a0c7 Mon Sep 17 00:00:00 2001 From: Stepan Kasal Date: Tue, 15 May 2007 20:46:08 +0200 Subject: [PATCH] build-sys: do not build convenience libraries in lib/ Build lib/*.c individually for each project which uses it, so that the right set of flags is applied each time. Signed-off-by: Stepan Kasal --- Makefile.am | 2 +- configure.ac | 1 - disk-utils/Makefile.am | 4 ++-- lib/Makefile.am | 7 ------- login-utils/Makefile.am | 16 +++++++++------- misc-utils/Makefile.am | 2 +- mount/Makefile.am | 8 ++++---- 7 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 lib/Makefile.am diff --git a/Makefile.am b/Makefile.am index b1ab4e24..feb98d95 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/config/include-Makefile.am -SUBDIRS = lib \ +SUBDIRS = \ include \ disk-utils \ fdisk \ diff --git a/configure.ac b/configure.ac index 3d702666..d008e931 100644 --- a/configure.ac +++ b/configure.ac @@ -415,7 +415,6 @@ fdisk/Makefile getopt/Makefile hwclock/Makefile include/Makefile -lib/Makefile login-utils/Makefile misc-utils/Makefile mount/Makefile diff --git a/disk-utils/Makefile.am b/disk-utils/Makefile.am index 95082021..ab44a330 100644 --- a/disk-utils/Makefile.am +++ b/disk-utils/Makefile.am @@ -26,9 +26,9 @@ endif if BUILD_CRAMFS sbin_PROGRAMS += fsck.cramfs mkfs.cramfs fsck_cramfs_SOURCES = fsck.cramfs.c cramfs.h -mkfs_cramfs_SOURCES = mkfs.cramfs.c cramfs.h +mkfs_cramfs_SOURCES = mkfs.cramfs.c cramfs.h ../lib/md5.c fsck_cramfs_LDADD = -lz -mkfs_cramfs_LDADD = -lz $(top_srcdir)/lib/libmd5.a +mkfs_cramfs_LDADD = -lz endif mkswap_LDADD = diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index b52561e0..00000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -include $(top_srcdir)/config/include-Makefile.am - -noinst_LIBRARIES = libmd5.a libenv.a libsetproctitle.a - -libmd5_a_SOURCES = md5.c -libenv_a_SOURCES = env.c -libsetproctitle_a_SOURCES = setproctitle.c \ No newline at end of file diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am index f6698217..efdba27c 100644 --- a/login-utils/Makefile.am +++ b/login-utils/Makefile.am @@ -40,14 +40,17 @@ usrbinexec_PROGRAMS += chfn chsh newgrp usrsbinexec_PROGRAMS += vipw man_MANS += chfn.1 chsh.1 login.1 newgrp.1 vipw.8 vigr.8 -chfn_SOURCES = chfn.c islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h -chsh_SOURCES = chsh.c islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h +chfn_SOURCES = chfn.c $(chfn_chsh_common) +chsh_SOURCES = chsh.c $(chfn_chsh_common) +chfn_chsh_common = islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h \ + ../lib/env.c +login_SOURCES = login.c login.h my_crypt.h ../lib/setproctitle.c newgrp_SOURCES = newgrp.c my_crypt.h vipw_SOURCES = vipw.c setpwnam.h -chfn_LDADD = ../lib/libenv.a -chsh_LDADD = ../lib/libenv.a -login_LDADD = ../lib/libsetproctitle.a +chfn_LDADD = +chsh_LDADD = +login_LDADD = newgrp_LDADD = vipw_LDADD = @@ -70,9 +73,8 @@ if HAVE_PAM chfn_LDADD += -lpam -lpam_misc chsh_LDADD += -lpam -lpam_misc login_LDADD += -lpam -lpam_misc -login_SOURCES = login.c login.h my_crypt.h else -login_SOURCES = login.c checktty.c login.h my_crypt.h +login_SOURCES += checktty.c endif if HAVE_AUDIT diff --git a/misc-utils/Makefile.am b/misc-utils/Makefile.am index a772a28b..26a8819f 100644 --- a/misc-utils/Makefile.am +++ b/misc-utils/Makefile.am @@ -11,7 +11,7 @@ bin_PROGRAMS = usrbinexec_PROGRAMS = cal ddate logger look mcookie \ namei script whereis -mcookie_LDADD = $(top_srcdir)/lib/libmd5.a +mcookie_SOURCES = mcookie.c ../lib/md5.c usrbinexec_SCRIPTS = chkdupexe scriptreplay diff --git a/mount/Makefile.am b/mount/Makefile.am index 6dbda45a..2734945a 100644 --- a/mount/Makefile.am +++ b/mount/Makefile.am @@ -13,16 +13,16 @@ MNTHDRS = fstab.h linux_fs.h mount_mntent.h mount_constants.h my_dev_t.h \ sundries.h mount_common = fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \ getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \ - lomount.c $(MNTHDRS) + lomount.c $(MNTHDRS) ../lib/env.c -mount_SOURCES = mount.c $(mount_common) \ +mount_SOURCES = mount.c $(mount_common) ../lib/setproctitle.c \ mount_guess_fstype.c -mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a +mount_LDADD = mount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) mount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) umount_SOURCES = umount.c $(mount_common) -umount_LDADD = $(top_srcdir)/lib/libenv.a +umount_LDADD = umount_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) -- 2.39.5