ltlibsrc.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #! /bin/sh
  2. # Copyright (C) 2003-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 to make sure a sensible default source for libraries is used.
  17. required='cc libtool'
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_PROG_CC
  21. AM_PROG_AR
  22. AC_PROG_LIBTOOL
  23. AC_OUTPUT
  24. END
  25. mkdir zoo.d
  26. cat > Makefile.am << 'END'
  27. AM_LDFLAGS = -module
  28. pkglib_LTLIBRARIES = zoo.d/bar.la old.la
  29. noinst_LTLIBRARIES = foo.la zoo.d/old2.la
  30. $(srcdir)/zoo_d_old2_la.c: $(srcdir)/old_la.c
  31. cp $(srcdir)/old_la.c $@
  32. AUTOMAKE_OPTIONS = -Wno-unsupported
  33. END
  34. cat > foo.c << 'END'
  35. int foo (void)
  36. {
  37. return 0;
  38. }
  39. END
  40. cp foo.c zoo.d/bar.c
  41. cp foo.c old_la.c
  42. libtoolize
  43. $ACLOCAL
  44. $AUTOCONF
  45. AUTOMAKE_fails -a
  46. grep '^Makefile\.am:2:.*old_la\.c' stderr
  47. grep '^Makefile\.am:2:.*old\.c' stderr
  48. grep '^Makefile\.am:3:.*zoo_d_old2_la\.c' stderr
  49. grep '^Makefile\.am:3:.*zoo\.d/old2\.c' stderr
  50. $AUTOMAKE -Wno-obsolete
  51. mkdir sub
  52. cd sub
  53. ../configure
  54. $MAKE
  55. test -f foo.la
  56. test -f zoo.d/bar.la
  57. test -f old.la
  58. test -f zoo.d/old2.la
  59. $MAKE distcheck
  60. :