[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/22] build: simplify: get rid of some indirection variables
From: |
Stefano Lattarini |
Subject: |
[PATCH 10/22] build: simplify: get rid of some indirection variables |
Date: |
Sat, 1 Sep 2012 01:46:47 +0200 |
The code deciding which coreutils programs to build (depending on
defaults, system capabilities, and user requests) is overly complex
and rather confusing. Let's begin simplifying it by removing some
non-strictly-necessary indirection variables.
* configure.ac: Adjust and improve few comments.
(OPTIONAL_BIN_PROGS, OPTIONAL_PKGLIB_PROGS): Rename ...
(bin_PROGRAMS, pkglibexec_PROGRAMS): ... like these, respectively.
Ensure they aren't initialized in all Makefiles (which would lead
to spurious errors), by calling AM_SUBST_NOTMAKE on them.
* src/local.mk: Adjust and improve few comments.
(bin_PROGRAMS, pkglibexec_PROGRAMS): Simply define
to the corresponding '@substitution@'. Not strictly required,
but certainly clearer and safer.
---
configure.ac | 19 +++++++++++--------
src/local.mk | 7 ++++---
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8c41d62..7c0b19c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -435,22 +435,25 @@ MAN=`
done`
NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default
-OPTIONAL_PKGLIB_PROGS=`
- for p in $optional_pkglib_progs; do echo src/$p; done`
+
+# The programs built and installed by "make && make install".
# Since this is AC_SUBST'd, Automake won't be able to perform rewrite
-# with $(EXEEXT) appending on it, so we have to do it ourselves.
-OPTIONAL_BIN_PROGS=`
+# with $(EXEEXT) appending on it, so we have to do it ourselves -- in
+# this case, only for $(bin_PROGRAMS).
+bin_PROGRAMS=`
for p in $optional_bin_progs; do echo "src/$p\$(EXEEXT)"; done`
+pkglibexec_PROGRAMS=`
+ for p in $optional_pkglib_progs; do echo src/$p; done`
# Normalize whitespace.
MAN=`echo $MAN`
NO_INSTALL_PROGS_DEFAULT=`echo $NO_INSTALL_PROGS_DEFAULT`
-OPTIONAL_BIN_PROGS=`echo $OPTIONAL_BIN_PROGS`
-OPTIONAL_PKGLIB_PROGS=`echo $OPTIONAL_PKGLIB_PROGS`
+bin_PROGRAMS=`echo $bin_PROGRAMS`
+pkglibexec_PROGS=`echo $pkglibexec_PROGRAMS`
AC_SUBST([NO_INSTALL_PROGS_DEFAULT])
-AC_SUBST([OPTIONAL_BIN_PROGS])
-AC_SUBST([OPTIONAL_PKGLIB_PROGS])
+AC_SUBST([bin_PROGRAMS]) AM_SUBST_NOTMAKE([bin_PROGRAMS])
+AC_SUBST([pkglibexec_PROGRAMS]) AM_SUBST_NOTMAKE([pkglibexec_PROGRAMS])
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
diff --git a/src/local.mk b/src/local.mk
index 5146361..0909d95 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -29,12 +29,13 @@ EXTRA_PROGRAMS = \
$(build_if_possible__progs) \
$(default__progs)
-bin_PROGRAMS = $(OPTIONAL_BIN_PROGS)
+# The user can tweak these lists at configure time.
+bin_PROGRAMS = @bin_PROGRAMS@
+pkglibexec_PROGRAMS = @pkglibexec_PROGRAMS@
+# Needed by the testsuite.
noinst_PROGRAMS = src/setuidgid src/getlimits
-pkglibexec_PROGRAMS = $(OPTIONAL_PKGLIB_PROGS)
-
noinst_HEADERS = \
src/chown-core.h \
src/copy.h \
--
1.7.12
- [PATCH 00/22] Patches to avoid use of make recursion in the 'src/' subdir, Stefano Lattarini, 2012/08/31
- [PATCH 01/22] maint: add our 'bootstrap_post_import_hook' function, Stefano Lattarini, 2012/08/31
- [PATCH 02/22] build: refactor how lists of coreutils programs are defined, Stefano Lattarini, 2012/08/31
- [PATCH 04/22] build: fix generation of manpages for programs not built by default, Stefano Lattarini, 2012/08/31
- [PATCH 05/22] maint: improve remake rules for maintainers, Stefano Lattarini, 2012/08/31
- [PATCH 06/22] maint: remove unused target 'install-root', Stefano Lattarini, 2012/08/31
- [PATCH 07/22] maint: fix and simplify maintainer checks, Stefano Lattarini, 2012/08/31
- [PATCH 09/22] maint: update gitignore entries, Stefano Lattarini, 2012/08/31
- [PATCH 08/22] maint: fix one stray reference to src/Makefile.am, Stefano Lattarini, 2012/08/31
- [PATCH 03/22] build: don't use recursive make to build the 'src' subdirectory, Stefano Lattarini, 2012/08/31
- [PATCH 10/22] build: simplify: get rid of some indirection variables,
Stefano Lattarini <=
- [PATCH 12/22] build: one less unneeded make variable, Stefano Lattarini, 2012/08/31
- [PATCH 11/22] build: simplify and make more portable to non-GNU make, Stefano Lattarini, 2012/08/31
- [PATCH 13/22] build: rename dist_man1_MANS -> man1_MANS, Stefano Lattarini, 2012/08/31
- [PATCH 14/22] build: simplify: get rid of yet some more indirection variables, Stefano Lattarini, 2012/08/31
- [PATCH 15/22] build: enhance man pages cleaning and dependencies, Stefano Lattarini, 2012/08/31
- [PATCH 16/22] build: $(mandeps): new, factors out man pages dependencies, Stefano Lattarini, 2012/08/31
- [PATCH 17/22] maint: simplify declaration of "libexec" programs, Stefano Lattarini, 2012/08/31
- [PATCH 18/22] maint: typofix in comments, Stefano Lattarini, 2012/08/31
- [PATCH 19/22] maint: fix quoting problem in configure.ac, Stefano Lattarini, 2012/08/31
- [PATCH 20/22] build: fix VPATH issues in C compilation, Stefano Lattarini, 2012/08/31