From: Andre Noll Date: Mon, 18 Jul 2016 16:49:31 +0000 (+0200) Subject: build: Do not strip installed executables by default. X-Git-Tag: v0.6.0~9^2~2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=9f3fe55418589acab8dfb809e787f15a46f7d174 build: Do not strip installed executables by default. The "install" target currently strips all executables while installing them, which is not recommended according to GNU conventions. Instead, there should exist the "install-strip" target for this purpose. Moreover, the current install target assumes the GNU variant of the install utility because we call install with --strip-program, an option which is not available on *BSD. This patch addresses both issues. It removes the autoconf check and lets the user directly define the path to the install executable by setting INSTALL, INSTALL_PROGRAM, INSTALL_DATA, as recommended by the GNU project. These variables are used in the commands to be executed when the install target is made. They have reasonable and portable defaults, so not setting them at all should be fine on all supported platforms, addressing the issue with --strip-program. The new phony target install-strip runs install -s but does not try to be smart about how to tell the install implementation which strip program to use. The cross compiling example can be simplified to reflect the fact that CROSS_COMPILE is no longer used in the Makefile. --- diff --git a/INSTALL b/INSTALL index 85b4fab1..547036b1 100644 --- a/INSTALL +++ b/INSTALL @@ -16,10 +16,8 @@ Installing paraslash from git Example for cross-compiling ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - export CROSS_COMPILE='armv6j-hardfloat-linux-gnueabi-' + export CC='armv6j-hardfloat-linux-gnueabi-gcc' export PATH="/usr/cross/arm/bin:$PATH" - export CC=${CROSS_COMPILE}gcc - export LDFLAGS=' -L/usr/sysroot/arm/lib -L/usr/sysroot/arm/usr/lib @@ -29,7 +27,7 @@ Example for cross-compiling autoconf autoheader ./configure --host=arm-linux-gnueabi --prefix /usr/sysroot/arm/usr/local - make CROSS_COMPILE=$CROSS_COMPILE + make For details see the user manual: diff --git a/Makefile.in b/Makefile.in index ec55c8e3..00a3d18f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -8,7 +8,6 @@ datarootdir := @datarootdir@ PACKAGE_TARNAME := @PACKAGE_TARNAME@ PACKAGE_VERSION := @PACKAGE_VERSION@ -INSTALL := @INSTALL@ M4 := @M4@ GENGETOPT := @GENGETOPT@ HELP2MAN := @HELP2MAN@ diff --git a/Makefile.real b/Makefile.real index 4970696b..ef4b51c4 100644 --- a/Makefile.real +++ b/Makefile.real @@ -9,7 +9,6 @@ endif vardir := /var/paraslash mandir := $(datarootdir)/man/man1 -STRIP := $(CROSS_COMPILE)strip MKDIR_P := mkdir -p prefixed_executables := $(addprefix para_, $(executables)) @@ -63,8 +62,9 @@ tarball_pfx := $(PACKAGE_TARNAME)-$(GIT_VERSION) tarball_delete := $(addprefix $(tarball_pfx)/, web .gitignore) tarball := $(tarball_pfx).tar.bz2 -.PHONY: all mostlyclean clean distclean maintainer-clean install man tarball all: $(prefixed_executables) $(man_pages) +.PHONY: all mostlyclean clean distclean maintainer-clean install \ + install-strip man tarball man: $(man_pages) tarball: $(tarball) @@ -353,11 +353,17 @@ maintainer-clean: distclean $(Q) rm -f *.tar.bz2 $(Q) rm -f GPATH GRTAGS GSYMS GTAGS -install: all man +INSTALL ?= install +INSTALL_PROGRAM ?= $(INSTALL) +INSTALL_DATA ?= $(INSTALL) -m 644 +ifneq ($(findstring strip, $(MAKECMDGOALS)),) + strip_option := -s +endif + +install install-strip: all man $(MKDIR_P) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir) - $(INSTALL) -s --strip-program $(STRIP) -m 755 \ - $(prefixed_executables) $(DESTDIR)$(bindir) - $(INSTALL) -m 644 $(man_pages) $(DESTDIR)$(mandir) + $(INSTALL) $(strip_option) $(prefixed_executables) $(DESTDIR)$(bindir) + $(INSTALL_DATA) $(man_pages) $(DESTDIR)$(mandir) $(MKDIR_P) $(DESTDIR)$(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain $(tarball): diff --git a/configure.ac b/configure.ac index 0b00cc2a..17227125 100644 --- a/configure.ac +++ b/configure.ac @@ -63,10 +63,6 @@ AC_PATH_PROG([HELP2MAN], [help2man]) test -z "$HELP2MAN" && AC_MSG_ERROR( [help2man is required to build this package]) -AC_PATH_PROG([INSTALL], [install]) -test -z "$INSTALL" && AC_MSG_ERROR( - [The install program is required to build this package]) - AC_PROG_CC AC_PROG_CPP