remake-config-status-dependencies.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 CONFIG_STATUS_DEPENDENCIES.
  17. . test-init.sh
  18. cat >> configure.ac <<'END'
  19. . ${srcdir}/version.sh
  20. AC_SUBST([EXTRA_VERSION])
  21. AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version.sh'])
  22. AC_OUTPUT
  23. END
  24. echo EXTRA_VERSION=1.0 > version.sh
  25. cat > Makefile.am <<'END'
  26. .PHONY: test-1 test-2 test-3
  27. check-local: test-3
  28. test-1:
  29. test $(EXTRA_VERSION) = 1.0
  30. test-2:
  31. test $(EXTRA_VERSION) = 2.1
  32. test-3:
  33. test $(EXTRA_VERSION) = 3.14
  34. END
  35. $ACLOCAL
  36. $AUTOCONF
  37. $AUTOMAKE
  38. ./configure
  39. $MAKE test-1
  40. $sleep
  41. echo EXTRA_VERSION=2.1 > version.sh
  42. using_gmake || $MAKE Makefile
  43. $MAKE test-2
  44. $MAKE distclean
  45. mkdir build
  46. cd build
  47. ../configure
  48. $MAKE test-2
  49. $sleep
  50. echo EXTRA_VERSION=3.14 > ../version.sh
  51. using_gmake || $MAKE Makefile
  52. $MAKE test-3
  53. # Contents of $(CONFIG_STATUS_DEPENDENCIES) are *not* to be
  54. # automatically distributed; there is no generic good reason
  55. # for that.
  56. $MAKE distdir
  57. test ! -e $distdir/version.sh
  58. test -f $distdir/configure || exit 99 # Sanity check.
  59. :