diff options
author | Tom Tromey <tromey@redhat.com> | 2001-02-18 00:35:19 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2001-02-18 00:35:19 +0000 |
commit | eb0b15383b024770d3512bb2d82ecaeb4d4616bc (patch) | |
tree | 868e6986a5f8ee2eca4784ab4904f745ff64e0fe /m4/strip.m4 | |
parent | 473d383153733d6fa76d5af745bcc762d6671eee (diff) | |
download | automake-eb0b15383b024770d3512bb2d82ecaeb4d4616bc.tar.gz |
2001-02-17 Tom Tromey <tromey@redhat.com>
* automake.in (handle_merge_targets): Use double quotes around
setting of INSTALL_STRIP_PROGRAM.
* m4/strip.m4 (AM_PROG_INSTALL_STRIP): Set INSTALL_STRIP_PROGRAM
to absolute path at runtime.
(AM_PROG_STRIP): Don't explicitly test $STRIP.
2001-01-28 Alexandre Duret-Lutz <duret_g@epita.fr>
* m4/strip.m4: New file.
* m4/Makefile.am (m4data_DATA): Add strip.m4.
* m4/init.m4: Call AM_PROG_INSTALL_STRIP.
* m4/missing.m4 (AM_AUX_DIR_EXPAND): New function.
(AM_MISSING_INSTALL_SH, AM_MISSING_HAS_RUN): Use $am_aux_dir instead
of $ac_aux_dir, and require AM_AUX_DIR_EXPAND.
* m4/depend.m4 (AM_DEP_TRACK): Likewise.
* automake.in (handle_merge_targets): In the install-strip rule,
set INSTALL_PROGRAM to INSTALL_STRIP_PROGRAM, and INSTALL_PROGRAM_ENV
to INSTALL_STRIP_PROGRAM_ENV; don't use INSTALL_STRIP_FLAG.
* progs.am (install-@DIR@PROGRAMS): Adapt to use INSTALL_PROGRAM_ENV,
don't use INSTALL_STRIP_FLAG any longer.
* header-vars.am (INSTALL_STRIP_FLAG): Remove.
(INSTALL_PROGRAM_ENV): New variable.
Diffstat (limited to 'm4/strip.m4')
-rw-r--r-- | m4/strip.m4 | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/m4/strip.m4 b/m4/strip.m4 new file mode 100644 index 000000000..2948166a6 --- /dev/null +++ b/m4/strip.m4 @@ -0,0 +1,46 @@ +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross=compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so if we ever +# need to use a non standard strip, we just have to make sure we use +# install-sh with the STRIPPROG variable set. +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_MISSING_INSTALL_SH]) +dnl Don't test for $cross_compiling = yes, it might be `maybe'... +if test "$cross_compiling" != no; then + # since we are cross-compiling, we need to check for a suitable `strip' + AM_PROG_STRIP + if test -z "$STRIP"; then + AC_MSG_WARN([strip missing, install-strip will not strip binaries]) + fi +fi + +# If $STRIP is defined (either by the user, or by AM_PROG_STRIP), +# instruct install-strip to use install-sh and the given $STRIP program. +# Otherwise, just use ${INSTALL}: the idea is to use the vendor install +# as much as possible, because it's faster. +if test -z "$STRIP"; then + # The top level make will set INSTALL_PROGRAM=$(INSTALL_STRIP_PROGRAM) + # and the double dolard below is there to make sure that ${INSTALL} + # is substitued in the sub-makes, not at the top-level; this is + # needed if ${INSTALL} is a relative path (ajusted in each subdirectory + # by config.status). + INSTALL_STRIP_PROGRAM='$${INSTALL} -s' + INSTALL_STRIP_PROGRAM_ENV='' +else + _am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`" + INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s" + INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='$STRIP'" +fi +AC_SUBST([INSTALL_STRIP_PROGRAM]) +AC_SUBST([INSTALL_STRIP_PROGRAM_ENV])]) + +AC_DEFUN([AM_PROG_STRIP], +[# Check for `strip', unless the installer +# has set the STRIP environment variable. +# Note: don't explicitly check for -z "$STRIP" here because +# that will cause problems if AC_CANONICAL_* is AC_REQUIREd after +# this macro, and anyway it doesn't have an effect anyway. +AC_CHECK_TOOL([STRIP],[strip]) +]) |