bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] simplify installation rules, using new Automake


From: Ralf Wildenhues
Subject: [PATCH] simplify installation rules, using new Automake
Date: Tue, 9 Sep 2008 19:53:14 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

This relies on development Automake to provide multi-file
installation, and avoids relying on undocumented Automake
interfaces.  It also removes special-casing for `['.
* configure.ac (AM_INIT_AUTOMAKE): Depend on 1.10a.
(CROSS_COMPILING): New Automake conditional.
* src/Makefile.am (install-exec-am, filtered_PROGS)
(d_bindir, cu-install-binPROGRAMS): Remove.
(INSTALL_PROGRAM) [!CROSS_COMPILING]: Set to `./ginstall'.
---

Hello Jim,

I wasn't sure why you needed the special-casing for '['.
Which shell has problems with it?  The commit which adds the
special-casing is 9d595099372e2eabbecce2f303058743e93f0748 from
May this year, I cannot find any details about the issue.
Posix seems unclear in whether '[' needs to be accepted unquoted.
But also, I don't have access to a shell which would need quoting.

Anyway, what do you think about this patch (requires git master
Automake)?  It has the small disadvantage of causing an unconditional
but otherwise harmless warning from automake (cannot be silenced with
-Wno-override), but the advantage that the undocumented interface
binPROGRAMS_INSTALL is not used any more.  The patch can be modified
to still use binPROGRAMS_INSTALL, in order to silence the warning,
but then I cannot apply this patch to Automake:
<http://thread.gmane.org/gmane.comp.sysutils.automake.patches/3197>.

Thanks,
Ralf

 configure.ac    |    4 +++-
 src/Makefile.am |   39 +++------------------------------------
 2 files changed, 6 insertions(+), 37 deletions(-)

diff --git a/configure.ac b/configure.ac
index e54479f..549c7ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ AC_CONFIG_SRCDIR(src/ls.c)
 AC_CONFIG_AUX_DIR(build-aux)
 AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
 
-AM_INIT_AUTOMAKE([1.10.1 dist-lzma])
+AM_INIT_AUTOMAKE([1.10a dist-lzma])
 
 AC_PROG_CC_STDC
 AM_PROG_CC_C_O
@@ -326,6 +326,8 @@ AC_SUBST([OPTIONAL_BIN_PROGS])
 NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default
 AC_SUBST([NO_INSTALL_PROGS_DEFAULT])
 
+AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
+
 # Arrange to rerun configure whenever the file, src/Makefile.am,
 # containing the list of program names changes.
 CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/src/Makefile.am'
diff --git a/src/Makefile.am b/src/Makefile.am
index 1eae015..dee26a4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -463,39 +463,6 @@ sc_tight_scope: $(all_programs)
            exit 1; } || :
 
 # Use the just-built ./ginstall, when not cross-compiling.
-# Override automake's install-one-at-a-time rule, when possible.
-install-exec-am:
-       @(./ginstall --version) > /dev/null 2>&1                \
-         && install=./ginstall                                 \
-         || install='$(INSTALL_PROGRAM)';                      \
-       case '$(program_transform_name):$(EXEEXT)' in           \
-         's,x,x,:') cu=cu-;; *) cu= ;; esac;                   \
-       $(MAKE) $(AM_MAKEFLAGS) binPROGRAMS_INSTALL="$$install" \
-         $${cu}install-binPROGRAMS
-       @$(NORMAL_INSTALL)
-       $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
-
-# The following rule is used only when --program-transform-name
-# has not been used and there is no .exe "extension".
-# Override the automake-generated rule so that we can install
-# all binaries with a single install command.  However, ...
-# install ginstall and [ separately.  "ginstall" because we rename
-# it to "install", and "[" because using it unquoted will cause a
-# syntax error with some shells.  Be careful to install each of these
-# exceptions only if it is to be installed (i.e., not excluded via
-# --enable-no-install-program=PROG_LIST.
-filtered_PROGS = \
-  `echo "$(bin_PROGRAMS)" | sed 's/ *\<ginstall\> */ /;s/ *\[ */ /'`
-d_bindir = $(DESTDIR)$(bindir)
-.PHONY: cu-install-binPROGRAMS
-cu-install-binPROGRAMS: $(bin_PROGRAMS)
-       $(NORMAL_INSTALL)
-       test -z "$(bindir)" || $(MKDIR_P) "$(d_bindir)"
-       test x = 'x$(bin_PROGRAMS)' && exit || :
-       case '$(bin_PROGRAMS)' in *\[*) \
-         echo "$(binPROGRAMS_INSTALL) '[' '$(d_bindir)/['"; \
-         $(binPROGRAMS_INSTALL) '[' '$(d_bindir)/[';; esac
-       case '$(bin_PROGRAMS)' in *ginstall*) \
-         echo "$(binPROGRAMS_INSTALL) ginstall '$(d_bindir)/install'";\
-         $(binPROGRAMS_INSTALL) ginstall '$(d_bindir)/install';; esac
-       $(binPROGRAMS_INSTALL) $(filtered_PROGS) '$(d_bindir)'
+if !CROSS_COMPILING
+INSTALL_PROGRAM = ./ginstall
+endif
-- 
1.6.0.1.286.g599f2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]