Signed-off-by: Diego Elio 'Flameeyes' Pettenò <flameeyes@xxxxxxxxx> --- Makefile.am | 7 ++----- disk-utils/module.am | 29 ++++++++++++++++------------- fdisk/module.am | 10 ++++++---- lib/module.am | 8 ++++++++ login-utils/module.am | 2 +- misc-utils/module.am | 4 +++- mount/module.am | 12 +++++------- partx/module.am | 4 ++-- 8 files changed, 43 insertions(+), 33 deletions(-) diff --git a/Makefile.am b/Makefile.am index c8cba43..42816f6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -54,10 +54,6 @@ SUBDIRS = \ RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o -if LINUX -linux_version_srcs = lib/linux_version.c -endif - ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ @@ -93,7 +89,8 @@ usrbin_exec_PROGRAMS = usrbin_exec_SCRIPTS = usrsbin_exec_PROGRAMS = -tests_helpers_test_md5_SOURCES = tests/helpers/test_md5.c lib/md5.c +tests_helpers_test_md5_SOURCES = tests/helpers/test_md5.c +tests_helpers_test_md5_LDADD = lib/libcommon.la include lib/module.am include disk-utils/module.am diff --git a/disk-utils/module.am b/disk-utils/module.am index 833d19d..f7a9ef3 100644 --- a/disk-utils/module.am +++ b/disk-utils/module.am @@ -1,5 +1,3 @@ -disk_utils_common = lib/blkdev.c $(linux_version_srcs) - if HAVE_UUID if BUILD_LIBUUID uuid_cflags = -I$(ul_libuuid_srcdir) @@ -16,15 +14,18 @@ dist_man_MANS += disk-utils/isosize.8 disk-utils/mkfs.8 disk-utils/mkswap.8 \ sbin_PROGRAMS += disk-utils/mkfs disk-utils/mkswap disk-utils/fsck.minix disk-utils/mkfs.minix disk-utils/mkfs.bfs disk_utils_fsck_minix_SOURCES = disk-utils/fsck.minix.c disk-utils/minix.h -disk_utils_mkfs_minix_SOURCES = disk-utils/mkfs.minix.c disk-utils/minix.h $(disk_utils_common) -disk_utils_mkfs_bfs_SOURCES = disk-utils/mkfs.bfs.c $(disk_utils_common) +disk_utils_fsck_minix_LDADD = lib/libcommon.la +disk_utils_mkfs_minix_SOURCES = disk-utils/mkfs.minix.c disk-utils/minix.h +disk_utils_mkfs_minix_LDADD = lib/libcommon.la +disk_utils_mkfs_bfs_SOURCES = disk-utils/mkfs.bfs.c +disk_utils_mkfs_bfs_LDADD = lib/libcommon.la -disk_utils_swaplabel_SOURCES = disk-utils/swaplabel.c $(disk_utils_common) -disk_utils_swaplabel_LDADD = $(uuid_ldadd) +disk_utils_swaplabel_SOURCES = disk-utils/swaplabel.c +disk_utils_swaplabel_LDADD = $(uuid_ldadd) lib/libcommon.la disk_utils_swaplabel_CFLAGS = $(AM_CFLAGS) $(uuid_cflags) -disk_utils_mkswap_SOURCES = disk-utils/mkswap.c $(disk_utils_common) lib/wholedisk.c -disk_utils_mkswap_LDADD = $(uuid_ldadd) +disk_utils_mkswap_SOURCES = disk-utils/mkswap.c lib/wholedisk.c +disk_utils_mkswap_LDADD = $(uuid_ldadd) lib/libcommon.la disk_utils_mkswap_CFLAGS = $(AM_CFLAGS) $(uuid_cflags) usrbin_exec_PROGRAMS += disk-utils/isosize @@ -33,7 +34,8 @@ if LINUX dist_man_MANS += disk-utils/fdformat.8 disk-utils/blockdev.8 sbin_PROGRAMS += disk-utils/blockdev usrsbin_exec_PROGRAMS += disk-utils/fdformat -disk_utils_blockdev_SOURCES = disk-utils/blockdev.c $(disk_utils_common) +disk_utils_blockdev_SOURCES = disk-utils/blockdev.c +disk_utils_blockdev_LDADD = lib/libcommon.la endif if BUILD_LIBBLKID @@ -46,7 +48,8 @@ endif if BUILD_ELVTUNE sbin_PROGRAMS += disk-utils/elvtune dist_man_MANS += disk-utils/elvtune.8 -disk_utils_elvtune_SOURCES = disk-utils/elvtune.c lib/linux_version.c +disk_utils_elvtune_SOURCES = disk-utils/elvtune.c +disk_utils_elvtune_LDADD = lib/libcommon.la endif if HAVE_RAW @@ -60,9 +63,9 @@ if BUILD_CRAMFS cramfs_common = $(disk_utils_common) disk-utils/cramfs.h disk-utils/cramfs_common.c disk-utils/cramfs_common.h sbin_PROGRAMS += disk-utils/fsck.cramfs disk-utils/mkfs.cramfs disk_utils_fsck_cramfs_SOURCES = disk-utils/fsck.cramfs.c $(cramfs_common) -disk_utils_mkfs_cramfs_SOURCES = disk-utils/mkfs.cramfs.c $(cramfs_common) lib/md5.c -disk_utils_fsck_cramfs_LDADD = -lz -disk_utils_mkfs_cramfs_LDADD = -lz +disk_utils_mkfs_cramfs_SOURCES = disk-utils/mkfs.cramfs.c $(cramfs_common) +disk_utils_fsck_cramfs_LDADD = -lz lib/libcommon.la +disk_utils_mkfs_cramfs_LDADD = -lz lib/libcommon.la endif if BUILD_LIBBLKID diff --git a/fdisk/module.am b/fdisk/module.am index bd57722..abd6728 100644 --- a/fdisk/module.am +++ b/fdisk/module.am @@ -2,7 +2,7 @@ EXTRA_DIST += fdisk/README.fdisk fdisk/README.cfdisk \ fdisk/sfdisk.examples fdisk/partitiontype.c fdisk_common = fdisk/i386_sys_types.c fdisk/common.h fdisk/gpt.c fdisk/gpt.h \ - lib/blkdev.c lib/wholedisk.c lib/mbsalign.c $(linux_version_srcs) + lib/wholedisk.c lib/mbsalign.c cflags_blkid = $(AM_CFLAGS) ldadd_blkid = @@ -18,21 +18,23 @@ fdisk_fdisk_SOURCES = fdisk/fdisk.c fdisk/fdiskbsdlabel.c fdisk/fdisksgilabel.c fdisk/fdisk.h fdisk/fdisksunlabel.h fdisk/fdisksgilabel.h fdisk/fdiskaixlabel.h \ fdisk/fdiskbsdlabel.h fdisk/fdiskmaclabel.h $(fdisk_common) fdisk_fdisk_CFLAGS = $(cflags_blkid) -fdisk_fdisk_LDADD = $(ldadd_blkid) +fdisk_fdisk_LDADD = $(ldadd_blkid) lib/libcommon.la fdisk_fdisk_static_SOURCES = $(fdisk_fdisk_SOURCES) fdisk_fdisk_static_LDFLAGS = -all-static fdisk_fdisk_static_CFLAGS = $(cflags_blkid) -fdisk_fdisk_static_LDADD = $(ldadd_blkid) +fdisk_fdisk_static_LDADD = $(fdisk_fdisk_LDADD) fdisk_sfdisk_SOURCES = fdisk/sfdisk.c fdisk/partname.c $(fdisk_common) +fdisk_sfdisk_LDADD = lib/libcommon.la fdisk_sfdisk_static_SOURCES = $(fdisk_sfdisk_SOURCES) fdisk_sfdisk_static_LDFLAGS = -all-static +fdisk_sfdisk_static_LDADD = $(fdisk_sfdisk_LDADD) fdisk_cfdisk_SOURCES = fdisk/cfdisk.c $(fdisk_common) fdisk_cfdisk_CFLAGS = $(cflags_blkid) -fdisk_cfdisk_LDADD = $(ldadd_blkid) +fdisk_cfdisk_LDADD = $(ldadd_blkid) lib/libcommon.la if BUILD_FSCK diff --git a/lib/module.am b/lib/module.am index 6ccbd9e..c110a51 100644 --- a/lib/module.am +++ b/lib/module.am @@ -11,6 +11,7 @@ LIB_TESTS_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_PROGRAM lib_test_blkdev_SOURCES = lib/blkdev.c $(linux_version_srcs) lib_test_blkdev_CPPFLAGS = $(LIB_TESTS_CPPFLAGS) +lib_test_blkdev_LDADD = lib/libcommon.la lib_test_ismounted_SOURCES = lib/ismounted.c lib_test_ismounted_CPPFLAGS = $(LIB_TESTS_CPPFLAGS) @@ -29,3 +30,10 @@ lib_test_cpuset_CPPFLAGS = $(LIB_TESTS_CPPFLAGS) lib_test_tt_SOURCES = lib/tt.c lib_test_tt_CPPFLAGS = $(LIB_TESTS_CPPFLAGS) + +noinst_LTLIBRARIES = lib/libcommon.la +lib_libcommon_la_SOURCES = lib/blkdev.c lib/md5.c + +if LINUX +lib_libcommon_la_SOURCES += lib/linux_version.c +endif diff --git a/login-utils/module.am b/login-utils/module.am index fe1ed66..17c4603 100644 --- a/login-utils/module.am +++ b/login-utils/module.am @@ -139,4 +139,4 @@ login_utils_checktty_test_SOURCES = login-utils/checktty.c login-utils/login.h login_utils_checktty_test_CPPFLAGS = -DMAIN_TEST_CHECKTTY $(AM_CPPFLAGS) login_utils_islocal_test_SOURCES = login-utils/islocal.c login_utils_islocal_test_CPPFLAGS = -DMAIN_TEST_ISLOCAL $(AM_CPPFLAGS) - +login_utils_islocal_test_LDADD = lib/libcommon.la diff --git a/misc-utils/module.am b/misc-utils/module.am index c2adf8f..2e18689 100644 --- a/misc-utils/module.am +++ b/misc-utils/module.am @@ -7,7 +7,9 @@ usrbin_exec_PROGRAMS += misc-utils/cal misc-utils/ddate \ EXTRA_DIST += misc-utils/README.cal misc-utils/README.ddate \ misc-utils/README.namei misc-utils/README.namei2 -misc_utils_mcookie_SOURCES = misc-utils/mcookie.c lib/md5.c +misc_utils_mcookie_SOURCES = misc-utils/mcookie.c +misc_utils_mcookie_LDADD = lib/libcommon.la + misc_utils_script_LDADD = usrbin_exec_SCRIPTS += misc-utils/chkdupexe diff --git a/mount/module.am b/mount/module.am index 6537491..22a7a65 100644 --- a/mount/module.am +++ b/mount/module.am @@ -11,8 +11,7 @@ hdrs_mount = mount/fstab.h mount/mount_mntent.h mount/loop.h \ # generic sources for mount and umount srcs_mount = mount/fstab.c mount/mount_mntent.c mount/getusername.c \ mount/lomount.c mount/devname.c mount/devname.h $(srcs_common) \ - $(hdrs_mount) lib/env.c lib/linux_version.c lib/blkdev.c \ - lib/fsprobe.c lib/mangle.c + $(hdrs_mount) lib/env.c lib/fsprobe.c lib/mangle.c # generic flags for all programs (except losetup) # -- note that pkg-config autoconf macros (pkg.m4) does not differentiate @@ -26,18 +25,17 @@ mount_mount_SOURCES = mount/mount.c $(srcs_mount) lib/setproctitle.c \ lib/strtosize.c mount_mount_CFLAGS = $(SUID_CFLAGS) $(cflags_common) mount_mount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) -mount_mount_LDADD = $(ldadd_common) +mount_mount_LDADD = $(ldadd_common) lib/libcommon.la mount_umount_SOURCES = mount/umount.c $(srcs_mount) mount_umount_CFLAGS = $(SUID_CFLAGS) $(cflags_common) mount_umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) -mount_umount_LDADD = $(ldadd_common) +mount_umount_LDADD = $(ldadd_common) lib/libcommon.la mount_swapon_SOURCES = mount/swapon.c mount/swap_constants.h \ - lib/linux_version.c lib/blkdev.c lib/fsprobe.c \ - lib/canonicalize.c lib/mangle.c + lib/fsprobe.c lib/canonicalize.c lib/mangle.c mount_swapon_CFLAGS = $(cflags_common) -mount_swapon_LDADD = $(ldadd_common) +mount_swapon_LDADD = $(ldadd_common) lib/libcommon.la mount_losetup_SOURCES = mount/lomount.c $(srcs_common) mount/loop.h \ mount/lomount.h lib/strtosize.c diff --git a/partx/module.am b/partx/module.am index 6b2ccc8..5a7f09b 100644 --- a/partx/module.am +++ b/partx/module.am @@ -5,8 +5,8 @@ usrsbin_exec_PROGRAMS += partx/addpart partx/delpart partx/partx partx_partx_SOURCES = partx/bsd.c partx/dos.c partx/partx.c \ partx/solaris.c partx/unixware.c partx/gpt.c \ partx/crc32.c partx/efi.h partx/gpt.h partx/crc32.h \ - partx/partx.h partx/dos.h lib/blkdev.c \ - $(linux_version_srcs) + partx/partx.h partx/dos.h +partx_partx_LDADD = lib/libcommon.la dist_man_MANS += partx/addpart.8 partx/delpart.8 partx/partx.8 -- 1.7.1.1 -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html