autodist-configure-no-subdir.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #! /bin/sh
  2. # Copyright (C) 2011-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. # Check that 'configure', 'configure.ac' and 'configure.in' are *not*
  17. # automatically distributed when placed in a subdirectory.
  18. # Related to automake bug#7819.
  19. . test-init.sh
  20. cat >> configure.ac <<END
  21. AC_CONFIG_FILES([sub/Makefile])
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am <<'END'
  25. SUBDIRS = sub
  26. dontbuild = echo target $@ should not be built >&2; exit 1
  27. sub/configure:
  28. $(dontbuild)
  29. sub/configure.ac:
  30. $(dontbuild)
  31. sub/configure.in:
  32. $(dontbuild)
  33. check-local: distdir
  34. ls -l $(distdir)/sub
  35. test ! -f $(distdir)/sub/configure
  36. test ! -f $(distdir)/sub/configure.in
  37. test ! -f $(distdir)/sub/configure.ac
  38. END
  39. mkdir sub
  40. cat > sub/Makefile.am <<'END'
  41. dontbuild = echo target $@ should not be built >&2; exit 1
  42. configure:
  43. $(dontbuild)
  44. configure.ac:
  45. $(dontbuild)
  46. configure.in:
  47. $(dontbuild)
  48. check-local:
  49. echo $(DISTFILES) | grep 'configure' && exit 1; :
  50. echo $(DIST_COMMON) | grep 'configure' && exit 1; :
  51. END
  52. : > sub/configure.ac
  53. : > sub/configure.in
  54. : > sub/configure
  55. $ACLOCAL
  56. $AUTOMAKE
  57. $AUTOCONF
  58. ./configure
  59. $MAKE check
  60. :