From: Ralf Wildenhues Date: Tue, 9 Sep 2008 17:53:14 +0000 (+0200) Subject: simplify installation rules, using new Automake X-Git-Tag: v7.0~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9903062cf26880a07772b14617196726149d12a;p=platform%2Fupstream%2Fcoreutils.git simplify installation rules, using new Automake 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'. --- 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/ *\ */ /;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