transform3.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #! /bin/sh
  2. # Copyright (C) 2012-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 does not transform too much
  17. # stuff (in particular, pgklibdir, pkgdatadir and pkglibexecdir).
  18. required=cc
  19. . test-init.sh
  20. cat > configure.ac <<'END'
  21. AC_INIT([foo], [1.0])
  22. AM_INIT_AUTOMAKE
  23. AC_CONFIG_FILES([Makefile])
  24. AC_PROG_CC
  25. AM_PROG_AR
  26. AC_PROG_RANLIB
  27. AC_OUTPUT
  28. END
  29. cat > Makefile.am <<'END'
  30. bin_SCRIPTS = foo
  31. pkgdata_DATA = bar.txt
  32. pkglib_LIBRARIES = libzap.a
  33. pkglibexec_SCRIPTS = mu
  34. test-install: install
  35. find $(prefix) ;: For debugging.
  36. test -f $(bindir)/gnu-foo
  37. test -x $(bindir)/gnu-foo
  38. test -f $(datadir)/foo/bar.txt
  39. test ! -d $(datadir)/gnu-foo
  40. test -f $(libdir)/foo/libzap.a
  41. test ! -d $(libdir)/gnu-foo
  42. test -f $(libexecdir)/foo/gnu-mu
  43. test -x $(libexecdir)/foo/gnu-mu
  44. test ! -d $(libexecdir)/gnu-foo
  45. test-installdirs: installdirs
  46. find $(prefix) ;: For debugging.
  47. test -d $(datadir)/foo
  48. test ! -d $(datadir)/gnu-foo
  49. test -d $(libdir)/foo
  50. test ! -d $(libdir)/gnu-foo
  51. test -d $(libexecdir)/foo
  52. test ! -d $(libexecdir)/gnu-foo
  53. END
  54. cat > libzap.c <<'END'
  55. int zap (void)
  56. {
  57. return 0;
  58. }
  59. END
  60. echo 'To be or not to be ...' > bar.txt
  61. cat > foo <<'END'
  62. #!/bin/sh
  63. exit 0
  64. END
  65. cp foo mu
  66. chmod a+x foo mu
  67. $ACLOCAL
  68. $AUTOCONF
  69. $AUTOMAKE -a
  70. ./configure --program-prefix=gnu- --prefix "$(pwd)/inst"
  71. $MAKE test-install
  72. $MAKE uninstall
  73. test $(find inst -type f -print | wc -l) -eq 0
  74. # Opportunistically test for installdirs.
  75. rm -rf inst
  76. $MAKE test-installdirs
  77. :