[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/7] build: don't use foo_LDADD if there's no foo program
From: |
Stefano Lattarini |
Subject: |
[PATCH 3/7] build: don't use foo_LDADD if there's no foo program |
Date: |
Thu, 30 Aug 2012 18:19:54 +0200 |
For example, instead of factoring out the extra linker flags needed
by 'cp', 'mv' ind 'install' into a '$(copy_LDADD)' variable, factor
them out in a '$(copy_ldadd)' variable.
Partly a minor cleanup, partly a preparation for future changes.
* src/Makefile.am (copy_LDADD): Rename ...
(copy_ldadd): ... like this.
(remove_LDADD): Rename ...
(remove_ldadd): ... like this.
All uses adjusted. Some comments updated.
Signed-off-by: Stefano Lattarini <address@hidden>
---
src/Makefile.am | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 896c902..63c2b11 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -177,6 +177,10 @@ nodist_libver_a_SOURCES = version.c version.h
# Tell the linker to omit references to unused shared libraries.
AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
+# Extra libraries needed by more than one program. Will be updated later.
+copy_ldadd =
+remove_ldadd =
+
# Sometimes, the expansion of $(LIBINTL) includes -lc which may
# include modules defining variables like 'optind', so libcoreutils.a
# must precede $(LIBINTL) in order to ensure we use GNU getopt.
@@ -297,25 +301,22 @@ __LDADD = $(test_LDADD)
dir_LDADD = $(ls_LDADD)
vdir_LDADD = $(ls_LDADD)
-# Shared files
-copy_LDADD =
-cp_LDADD += $(copy_LDADD)
-ginstall_LDADD += $(copy_LDADD)
-mv_LDADD += $(copy_LDADD)
+cp_LDADD += $(copy_ldadd)
+ginstall_LDADD += $(copy_ldadd)
+mv_LDADD += $(copy_ldadd)
-remove_LDADD =
-mv_LDADD += $(remove_LDADD)
-rm_LDADD += $(remove_LDADD)
+mv_LDADD += $(remove_ldadd)
+rm_LDADD += $(remove_ldadd)
# for eaccess, euidaccess
-copy_LDADD += $(LIB_EACCESS)
-remove_LDADD += $(LIB_EACCESS)
+copy_ldadd += $(LIB_EACCESS)
+remove_ldadd += $(LIB_EACCESS)
sort_LDADD += $(LIB_EACCESS)
test_LDADD += $(LIB_EACCESS)
# for selinux use
+copy_ldadd += $(LIB_SELINUX)
chcon_LDADD += $(LIB_SELINUX)
-copy_LDADD += $(LIB_SELINUX)
ginstall_LDADD += $(LIB_SELINUX)
id_LDADD += $(LIB_SELINUX)
ls_LDADD += $(LIB_SELINUX)
@@ -326,7 +327,7 @@ runcon_LDADD += $(LIB_SELINUX)
stat_LDADD += $(LIB_SELINUX)
# for gettime, settime, utimecmp, utimens
-copy_LDADD += $(LIB_CLOCK_GETTIME)
+copy_ldadd += $(LIB_CLOCK_GETTIME)
date_LDADD += $(LIB_CLOCK_GETTIME)
ginstall_LDADD += $(LIB_CLOCK_GETTIME)
ls_LDADD += $(LIB_CLOCK_GETTIME)
@@ -357,11 +358,11 @@ factor_LDADD += $(LIB_GMP)
uptime_LDADD += $(GETLOADAVG_LIBS)
# for various ACL functions
-copy_LDADD += $(LIB_ACL)
+copy_ldadd += $(LIB_ACL)
ls_LDADD += $(LIB_ACL)
# for various xattr functions
-copy_LDADD += $(LIB_XATTR)
+copy_ldadd += $(LIB_XATTR)
# for print_unicode_char, proper_name_utf8
cat_LDADD += $(LIBICONV)
- [PATCH 0/7] Minor cleanup and refactoring., Stefano Lattarini, 2012/08/30
- [PATCH 1/7] build: move definition of 'all_programs' in cfg.mk, Stefano Lattarini, 2012/08/30
- [PATCH 2/7] build: some refactorings in cfg.mk, Stefano Lattarini, 2012/08/30
- [PATCH 5/7] maint: more uses of $(ASSORT), Stefano Lattarini, 2012/08/30
- [PATCH 4/7] maint: remove unused variable in src/Makefile.am, Stefano Lattarini, 2012/08/30
- [PATCH 7/7] maint: get rid of obsolete script 'cvsu', Stefano Lattarini, 2012/08/30
- [PATCH 6/7] build: don't use '$<' in non-suffix rules, Stefano Lattarini, 2012/08/30
- [PATCH 3/7] build: don't use foo_LDADD if there's no foo program,
Stefano Lattarini <=
- Re: [PATCH 0/7] Minor cleanup and refactoring., Jim Meyering, 2012/08/31
- Re: [PATCH 0/7] Minor cleanup and refactoring., Jim Meyering, 2012/08/31