transform.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #! /bin/sh
  2. # Copyright (C) 2002-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Make sure that --program-transform works.
  17. required=cc
  18. . test-init.sh
  19. cat >>configure.ac <<'END'
  20. AC_PROG_CC
  21. AC_OUTPUT
  22. END
  23. cat >Makefile.am <<'EOF'
  24. bin_PROGRAMS = h
  25. bin_SCRIPTS = h.sh
  26. man_MANS = h.1
  27. .PHONY: test-install
  28. test-install: install
  29. test -f inst/bin/gnu-h$(EXEEXT)
  30. test -f inst/bin/gnu-h.sh
  31. test -f inst/man/man1/gnu-h.1
  32. EOF
  33. cat >h.c <<'EOF'
  34. int main (void)
  35. {
  36. return 0;
  37. }
  38. EOF
  39. : > h.sh
  40. : > h.1
  41. $ACLOCAL
  42. $AUTOCONF
  43. $AUTOMAKE
  44. cwd=$(pwd) || fatal_ "getting current working directory"
  45. ./configure --program-prefix=gnu- --prefix "$cwd/inst" \
  46. --mandir "$cwd/inst/man"
  47. $MAKE
  48. $MAKE test-install
  49. $MAKE uninstall
  50. test $(find inst -type f -print | wc -l) -eq 0
  51. # Opportunistically test for installdirs.
  52. rm -rf inst
  53. $MAKE installdirs
  54. test -d inst/bin
  55. test -d inst/man/man1
  56. :