subpkg2.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #! /bin/sh
  2. # Copyright (C) 2003-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. # Try a DIST_SUBDIRS subpackage with no SUBDIRS.
  17. # Report from Gary V. Vaughan.
  18. . test-init.sh
  19. mkdir m4
  20. cat >m4/foo.m4 <<'EOF'
  21. AC_DEFUN([FOO],[
  22. AC_OUTPUT
  23. ])
  24. EOF
  25. cat >>configure.ac <<'END'
  26. AC_CONFIG_MACRO_DIR([m4])
  27. AC_CONFIG_SUBDIRS([sub])
  28. AC_OUTPUT
  29. END
  30. cat >Makefile.am <<'EOF'
  31. DIST_SUBDIRS = sub
  32. dist-hook:
  33. test -f $(distdir)/sub/script.in
  34. EOF
  35. mkdir sub
  36. cat >sub/configure.ac <<'EOF'
  37. AC_INIT([sub], [2.3])
  38. AM_INIT_AUTOMAKE
  39. AC_CONFIG_MACRO_DIR([../m4])
  40. AC_CONFIG_FILES([Makefile])
  41. AC_CONFIG_FILES([script])
  42. FOO
  43. EOF
  44. : >sub/script.in
  45. : >sub/Makefile.am
  46. $ACLOCAL
  47. $AUTOCONF
  48. $AUTOMAKE
  49. cd sub
  50. $ACLOCAL
  51. $FGREP 'm4_include([../m4/foo.m4])' aclocal.m4
  52. $AUTOCONF
  53. $AUTOMAKE -Wno-override
  54. cd ..
  55. ./configure
  56. $MAKE distcheck
  57. :