libobj-basic.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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_LIBSOURCE and AC_LIBSOURCES work.
  17. required=cc
  18. . test-init.sh
  19. mv configure.ac configure.proto
  20. cat >> configure.proto << 'END'
  21. AC_PROG_CC
  22. AM_PROG_AR
  23. AC_PROG_RANLIB
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am << 'END'
  27. noinst_LIBRARIES = libtu.a
  28. libtu_a_SOURCES = foo.c
  29. libtu_a_LIBADD = $(LIBOBJS)
  30. include extra-checks.am
  31. .PHONY: $(extra_checks) pre-test
  32. pre-test: distdir
  33. ls -l $(srcdir) $(builddir) $(distdir)
  34. $(AR) tv libtu.a
  35. $(extra_checks): pre-test
  36. check-local: $(extra_checks)
  37. maude-src:
  38. grep dummy_maude $(srcdir)/maude.c
  39. maude-dist:
  40. grep dummy_maude $(distdir)/maude.c
  41. liver-src:
  42. grep dummy_liver $(srcdir)/liver.c
  43. liver-dist:
  44. grep dummy_liver $(distdir)/liver.c
  45. liver-not-dist:
  46. test -d $(distdir)
  47. test ! -r $(distdir)/liver.c
  48. maude-not-dist:
  49. test -d $(distdir)
  50. test ! -r $(distdir)/maude.c
  51. END
  52. cat > foo.c << 'END'
  53. extern int dummy_foo;
  54. END
  55. cat > maude.c << 'END'
  56. extern int dummy_maude;
  57. END
  58. cat > liver.c << 'END'
  59. extern int dummy_liver;
  60. END
  61. # AC_LIBSOURCE should work also if called after AC_OUTPUT.
  62. cat configure.proto - > configure.ac <<END
  63. AC_LIBSOURCE([maude.c])
  64. END
  65. cat > extra-checks.am << 'END'
  66. extra_checks = maude-src maude-dist liver-not-dist
  67. END
  68. cp "$am_scriptdir/ar-lib" . || fatal_ "fetching auxiliary script 'ar-lib'"
  69. $ACLOCAL
  70. $AUTOCONF
  71. $AUTOMAKE
  72. ./configure
  73. $MAKE check
  74. $MAKE distcheck
  75. $MAKE distclean
  76. # Avoid timestamp-related differences.
  77. rm -rf autom4te*.cache
  78. cat > extra-checks.am << 'END'
  79. extra_checks = maude-src maude-dist liver-src liver-dist
  80. END
  81. # AC_LIBSOURCES should work also if called after AC_OUTPUT.
  82. cat configure.proto - > configure.ac <<END
  83. AC_LIBSOURCES([maude.c, liver.c])
  84. END
  85. $ACLOCAL
  86. $AUTOCONF
  87. $AUTOMAKE
  88. ./configure
  89. $MAKE check
  90. $MAKE distcheck
  91. :