strip.m4 1.4 KB

12345678910111213141516171819202122232425262728
  1. ## -*- Autoconf -*-
  2. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  3. #
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # AM_PROG_INSTALL_STRIP
  8. # ---------------------
  9. # One issue with vendor 'install' (even GNU) is that you can't
  10. # specify the program used to strip binaries. This is especially
  11. # annoying in cross-compiling environments, where the build's strip
  12. # is unlikely to handle the host's binaries.
  13. # Fortunately install-sh will honor a STRIPPROG variable, so we
  14. # always use install-sh in "make install-strip", and initialize
  15. # STRIPPROG with the value of the STRIP variable (set by the user).
  16. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  17. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  18. # Installed binaries are usually stripped using 'strip' when the user
  19. # run "make install-strip". However 'strip' might not be the right
  20. # tool to use in cross-compilation environments, therefore Automake
  21. # will honor the 'STRIP' environment variable to overrule this program.
  22. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  23. if test "$cross_compiling" != no; then
  24. AC_CHECK_TOOL([STRIP], [strip], :)
  25. fi
  26. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  27. AC_SUBST([INSTALL_STRIP_PROGRAM])])