remake-configure-dependencies.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #! /bin/sh
  2. # Copyright (C) 2013-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 CONFIGURE_DEPENDENCIES.
  17. . test-init.sh
  18. cat > configure.ac <<'END'
  19. AC_INIT([confdeps], m4_esyscmd([./print-version]))
  20. AM_INIT_AUTOMAKE([foreign])
  21. AC_CONFIG_FILES([Makefile])
  22. AC_OUTPUT
  23. END
  24. # Needless to say, the autom4te cache happily break this test.
  25. cat > .autom4te.cfg <<'END'
  26. begin-language: "Autoconf-without-aclocal-m4"
  27. args: --no-cache
  28. end-language: "Autoconf-without-aclocal-m4"
  29. END
  30. cat > Makefile.am <<'END'
  31. EXTRA_DIST = .autom4te.cfg
  32. CONFIGURE_DEPENDENCIES = $(top_srcdir)/print-version
  33. test-1:
  34. test $(VERSION) = 1.0
  35. test-2:
  36. test $(VERSION) = 2.1
  37. test-3:
  38. test $(VERSION) = 3.14
  39. .PHONY: test-1 test-2 test-3
  40. # Contents of $(CONFIGURE_DEPENDENCIES) are to be automatically
  41. # distributed.
  42. local-check: test-3 distdir
  43. test -f $(distdir)/print-version
  44. END
  45. (echo '#!/bin/sh' && echo 'printf %s 1.0') > print-version
  46. chmod a+x print-version
  47. $ACLOCAL
  48. $AUTOCONF
  49. $AUTOMAKE
  50. ./configure
  51. $MAKE test-1
  52. $sleep
  53. (echo '#!/bin/sh' && echo 'printf %s 2.1') > print-version
  54. using_gmake || $MAKE Makefile
  55. $MAKE test-2
  56. $MAKE distclean
  57. mkdir build
  58. cd build
  59. ../configure
  60. $MAKE test-2
  61. $sleep
  62. (echo '#!/bin/sh' && echo 'printf %s 3.14') > ../print-version
  63. using_gmake || $MAKE Makefile
  64. $MAKE test-3
  65. # Check that $(CONFIGURE_DEPENDENCIES) are automatically distributed.
  66. $MAKE distcheck
  67. :