backcompat.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #! /bin/sh
  2. # Copyright (C) 2010-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 usage of AM_INIT_AUTOMAKE with two or three arguments, for
  17. # backward-compatibility.
  18. . test-init.sh
  19. cat > Makefile.am <<'END'
  20. .PHONY: test display
  21. ## Might be useful for debugging.
  22. display:
  23. ## The following should be substituted by AM_INIT_AUTOMAKE.
  24. @echo PACKAGE = $(PACKAGE)
  25. @echo VERSION = $(VERSION)
  26. ## The following should not be substituted, as we used the
  27. ## old form of AC_INIT.
  28. @echo PACKAGE_NAME = $(PACKAGE_NAME)
  29. @echo PACKAGE_VERSION = $(PACKAGE_VERSION)
  30. @echo PACKAGE_TARNAME = $(PACKAGE_TARNAME)
  31. @echo PACKAGE_STRING = $(PACKAGE_STRING)
  32. test: display
  33. test x'$(PACKAGE)' = x'FooBar'
  34. test x'$(VERSION)' = x'0.7.1'
  35. test x'$(PACKAGE_NAME)' = x
  36. test x'$(PACKAGE_VERSION)' = x
  37. test x'$(PACKAGE_TARNAME)' = x
  38. test x'$(PACKAGE_STRING)' = x
  39. END
  40. for ac_init in 'AC_INIT' 'AC_INIT([Makefile.am])'; do
  41. for am_extra_args in '' ', []' ', [:]' ', [false]'; do
  42. rm -rf autom4te*.cache config* Makefile.in Makefile
  43. unindent > configure.ac <<END
  44. $ac_init
  45. AM_INIT_AUTOMAKE([FooBar], [0.7.1]$am_extra_args)
  46. AC_CONFIG_FILES([Makefile])
  47. AC_OUTPUT
  48. END
  49. cat configure.ac # For debugging.
  50. $ACLOCAL
  51. $AUTOCONF
  52. $AUTOMAKE -Wno-obsolete
  53. ./configure
  54. $MAKE test
  55. done
  56. done
  57. :