backcompat3.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. # Backward-compatibility test: check what happens when AC_INIT and
  17. # AM_INIT_AUTOMAKE are both given two or more arguments.
  18. am_create_testdir=empty
  19. . test-init.sh
  20. empty=''
  21. AUTOMAKE="$AUTOMAKE -Wno-obsolete"
  22. cat > Makefile.am <<'END'
  23. ## Leading ':;' here required to work around bugs of (at least) bash 3.2
  24. got: Makefile
  25. @:; { \
  26. echo 'PACKAGE = $(PACKAGE)'; \
  27. echo 'VERSION = $(VERSION)'; \
  28. echo 'PACKAGE_NAME = $(PACKAGE_NAME)'; \
  29. echo 'PACKAGE_VERSION = $(PACKAGE_VERSION)'; \
  30. echo 'PACKAGE_STRING = $(PACKAGE_STRING)'; \
  31. echo 'PACKAGE_TARNAME = $(PACKAGE_TARNAME)'; \
  32. echo 'PACKAGE_BUGREPORT = $(PACKAGE_BUGREPORT)'; \
  33. echo 'PACKAGE_URL = $(PACKAGE_URL)'; \
  34. } >$@
  35. END
  36. ### Run 1 ###
  37. cat > configure.ac <<END
  38. AC_INIT([ac_name], [ac_version])
  39. AM_INIT_AUTOMAKE([am_name], [am_version])
  40. AC_CONFIG_FILES([Makefile])
  41. AC_OUTPUT
  42. END
  43. cat configure.ac
  44. $ACLOCAL
  45. $AUTOCONF
  46. $AUTOMAKE -a
  47. ./configure
  48. cat >exp <<END
  49. PACKAGE = am_name
  50. VERSION = am_version
  51. PACKAGE_NAME = ac_name
  52. PACKAGE_VERSION = ac_version
  53. PACKAGE_STRING = ac_name ac_version
  54. PACKAGE_TARNAME = ac_name
  55. PACKAGE_BUGREPORT = $empty
  56. PACKAGE_URL = $empty
  57. END
  58. $MAKE got
  59. diff exp got
  60. ### Run 2 ###
  61. cat > configure.ac <<'END'
  62. AC_INIT([ac_name], [ac_version], [ac_bugreport], [ac_tarname],
  63. [ac_url])],
  64. AM_INIT_AUTOMAKE([am_name], [am_version])
  65. AC_CONFIG_FILES([Makefile])
  66. AC_OUTPUT
  67. END
  68. cat configure.ac
  69. $ACLOCAL
  70. $AUTOCONF
  71. $AUTOMAKE
  72. ./configure
  73. cat >exp <<END
  74. PACKAGE = am_name
  75. VERSION = am_version
  76. PACKAGE_NAME = ac_name
  77. PACKAGE_VERSION = ac_version
  78. PACKAGE_STRING = ac_name ac_version
  79. PACKAGE_TARNAME = ac_tarname
  80. PACKAGE_BUGREPORT = ac_bugreport
  81. PACKAGE_URL = ac_url
  82. END
  83. $MAKE got
  84. diff exp got
  85. ### Run 3 ###
  86. cat > configure.ac <<END
  87. AC_INIT([ac_name], [ac_version])
  88. AM_INIT_AUTOMAKE([am_name], [am_version], [am_foo_quux])
  89. AC_CONFIG_FILES([Makefile])
  90. AC_OUTPUT
  91. END
  92. cat configure.ac
  93. $ACLOCAL
  94. $AUTOCONF
  95. $AUTOMAKE
  96. ./configure
  97. cat >exp <<END
  98. PACKAGE = am_name
  99. VERSION = am_version
  100. PACKAGE_NAME = ac_name
  101. PACKAGE_VERSION = ac_version
  102. PACKAGE_STRING = ac_name ac_version
  103. PACKAGE_TARNAME = ac_name
  104. PACKAGE_BUGREPORT = $empty
  105. PACKAGE_URL = $empty
  106. END
  107. $MAKE got
  108. diff exp got
  109. $FGREP am_foo_quux Makefile.in Makefile configure config.status && exit 1
  110. ### Done ###
  111. :