confh.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #! /bin/sh
  2. # Copyright (C) 1999-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. # Test to make sure config.h works in a subdir.
  17. # Report from Alexandre Oliva.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_CONFIG_HEADERS([include/config.h])
  21. AC_OUTPUT
  22. END
  23. cat > Makefile.am << 'END'
  24. .PHONY: test1 test2
  25. test1:
  26. @echo DIST_COMMON = $(DIST_COMMON)
  27. echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h '
  28. test2: distdir
  29. ls -l $(distdir)/*
  30. test -f $(distdir)/acconfig.h
  31. check-local: test1 test2
  32. END
  33. mkdir include
  34. : > include/config.h.in
  35. : > acconfig.h
  36. # The test used to fail if 'include/Makefile.am' was created (!)
  37. : > include/Makefile.am
  38. $ACLOCAL
  39. $AUTOCONF
  40. $AUTOHEADER
  41. $AUTOMAKE
  42. ./configure
  43. $MAKE test1
  44. $MAKE test2
  45. $MAKE distcheck
  46. # Make sure re-running automake in a different way generates same
  47. # Makefile.in.
  48. mv Makefile.in Makefile.sav
  49. $ACLOCAL
  50. $AUTOMAKE Makefile
  51. diff Makefile.sav Makefile.in
  52. :