extra-deps-lt.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 EXTRA_*_DEPENDENCIES, libtool version; see 'extra-deps.sh' for
  17. # non-libtool variant.
  18. required='cc libtoolize'
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_PROG_CC
  22. AM_PROG_AR
  23. AC_PROG_LIBTOOL
  24. AC_SUBST([deps], [bardep])
  25. AC_OUTPUT
  26. END
  27. cat > Makefile.am << 'END'
  28. noinst_LTLIBRARIES = libfoo.la
  29. EXTRA_libfoo_la_DEPENDENCIES = libfoodep
  30. libfoodep:
  31. @echo making $@
  32. @: > $@
  33. CLEANFILES = libfoodep
  34. bin_PROGRAMS = bar
  35. bar_LDADD = libfoo.la
  36. EXTRA_bar_DEPENDENCIES = $(deps)
  37. EXTRA_DIST = bardep
  38. .PHONY: bar-has-been-updated
  39. bar-has-been-updated:
  40. is_newest bar$(EXEEXT) libfoo.la
  41. END
  42. cat >libfoo.c <<'END'
  43. int libfoo () { return 0; }
  44. END
  45. cat >bar.c <<'END'
  46. extern int libfoo ();
  47. int main () { return libfoo (); }
  48. END
  49. libtoolize
  50. $ACLOCAL
  51. $AUTOMAKE --add-missing
  52. $AUTOCONF
  53. ./configure
  54. # Hypothesis: EXTRA_*_DEPENDENCIES are honored.
  55. : >foodep
  56. : >foodep2
  57. : >bardep
  58. run_make -O
  59. grep 'making libfoodep' stdout
  60. rm -f bardep
  61. $MAKE && exit 1
  62. : >bardep
  63. $MAKE
  64. $sleep
  65. touch libfoo.la
  66. $MAKE
  67. $MAKE bar-has-been-updated
  68. $MAKE distcheck
  69. :