libobj16b.sh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. # Make sure AC_LIBOBJ and friends work.
  17. # Please keep this in sync with sister test 'libobj16a.sh'.
  18. required=cc
  19. . test-init.sh
  20. mv configure.ac configure.proto
  21. cat >> configure.proto << 'END'
  22. AC_PROG_CC
  23. AM_PROG_AR
  24. AC_PROG_RANLIB
  25. %LIBOBJ-STUFF% # Will be activated later.
  26. AC_OUTPUT
  27. END
  28. cat > Makefile.am << 'END'
  29. noinst_LIBRARIES = libtu.a
  30. libtu_a_SOURCES =
  31. libtu_a_LIBADD = @LIBOBJS@
  32. include extra-checks.am
  33. .PHONY: $(extra_checks) pre-test
  34. pre-test: distdir
  35. ls -l $(srcdir) $(builddir) $(distdir)
  36. $(AR) tv libtu.a
  37. $(extra_checks): pre-test
  38. check-local: $(extra_checks)
  39. maude-src:
  40. grep dummy_maude $(srcdir)/maude.c
  41. maude-dist:
  42. grep dummy_maude $(distdir)/maude.c
  43. liver-src:
  44. grep dummy_liver $(srcdir)/liver.c
  45. liver-dist:
  46. grep dummy_liver $(distdir)/liver.c
  47. liver-not-dist: distdir
  48. test ! -r $(distdir)/liver.c
  49. maude-not-dist: distdir
  50. test ! -r $(distdir)/maude.c
  51. maude-lib:
  52. $(AR) t libtu.a | grep maude
  53. maude-not-lib:
  54. $(AR) t libtu.a | grep maude && exit 1; exit 0
  55. liver-lib:
  56. $(AR) t libtu.a | grep liver
  57. liver-not-lib:
  58. $(AR) t libtu.a | grep liver && exit 1; exit 0
  59. END
  60. cat > maude.c << 'END'
  61. extern int dummy_maude;
  62. END
  63. cat > liver.c << 'END'
  64. extern int dummy_liver;
  65. END
  66. sed '/%LIBOBJ-STUFF%/{
  67. s/.*//
  68. i\
  69. AC_LIBOBJ(maude) dnl: do not quote this!
  70. }' configure.proto > configure.ac
  71. cat configure.ac # For debugging.
  72. cat > extra-checks.am << 'END'
  73. extra_checks = maude-src maude-dist maude-lib liver-not-dist
  74. END
  75. $ACLOCAL
  76. $AUTOCONF
  77. $AUTOMAKE --add-missing
  78. ./configure
  79. $MAKE
  80. $MAKE check
  81. $MAKE distcheck
  82. $MAKE distclean
  83. # Avoid timestamp-related differences.
  84. rm -rf autom4te*.cache
  85. cat > extra-checks.am << 'END'
  86. extra_checks = maude-src maude-dist liver-src liver-dist
  87. if MAUDE_COND
  88. extra_checks += maude-lib liver-not-lib
  89. else
  90. extra_checks += maude-not-lib liver-lib
  91. endif
  92. END
  93. sed '/%LIBOBJ-STUFF%/{
  94. s/.*//
  95. i\
  96. AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
  97. if test x"$MAUDE" = x"yes"; then\
  98. AC_LIBOBJ(maude) dnl: do not quote this!\
  99. else\
  100. AC_LIBOBJ(liver) dnl: do not quote this!\
  101. fi\
  102. AC_LIBSOURCE(maude.c) dnl: do not quote this!\
  103. AC_LIBSOURCE(liver.c) dnl: do not quote this!
  104. }' configure.proto > configure.ac
  105. cat configure.ac # For debugging.
  106. $ACLOCAL
  107. $AUTOCONF
  108. $AUTOMAKE
  109. ./configure MAUDE=yes
  110. $MAKE
  111. $MAKE check
  112. $MAKE distcheck
  113. $MAKE distclean
  114. ./configure MAUDE=no
  115. $MAKE
  116. $MAKE check
  117. $MAKE distcheck
  118. $MAKE distclean
  119. :