1 # AM_PROG_INSTALL_STRIP
3 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 # One issue with vendor `install' (even GNU) is that you can't
21 # specify the program used to strip binaries. This is especially
22 # annoying in cross-compiling environments, where the build's strip
23 # is unlikely to handle the host's binaries.
24 # Fortunately install-sh will honor a STRIPPROG variable, so we
25 # always use install-sh in `make install-strip', and initialize
26 # STRIPPROG with the value of the STRIP variable (set by the user).
27 AC_DEFUN([AM_PROG_INSTALL_STRIP],
28 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
29 # Installed binaries are usually stripped using `strip' when the user
30 # run `make install-strip'. However `strip' might not be the right
31 # tool to use in cross-compilation environments, therefore Automake
32 # will honor the `STRIP' environment variable to overrule this program.
33 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
34 if test "$cross_compiling" != no; then
35 AC_CHECK_TOOL([STRIP], [strip], :)
37 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
38 AC_SUBST([INSTALL_STRIP_PROGRAM])])