depcomp8b.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 for regressions in computation of names of .Plo files for
  17. # automatic dependency tracking.
  18. # Keep this in sync with sister test 'depcomp8a.sh', which checks the
  19. # same thing for non-libtool objects.
  20. required='cc libtoolize'
  21. . test-init.sh
  22. cat >> configure.ac << 'END'
  23. AC_PROG_CC
  24. #x AM_PROG_CC_C_O
  25. AM_PROG_AR
  26. AC_PROG_LIBTOOL
  27. AC_OUTPUT
  28. END
  29. cat > Makefile.am << 'END'
  30. ## FIXME: stop disabling the warnings in the 'unsupported' category
  31. ## FIXME: once the 'subdir-objects' option has been mandatory.
  32. AUTOMAKE_OPTIONS = -Wno-unsupported
  33. lib_LTLIBRARIES = libzardoz.la
  34. libzardoz_la_SOURCES = foo.c sub/bar.c
  35. END
  36. mkdir sub
  37. echo 'int foo (void) { return 0; }' > foo.c
  38. echo 'int bar (void) { return 0; }' > sub/bar.c
  39. libtoolize
  40. $ACLOCAL
  41. # FIXME: stop disabling the warnings in the 'unsupported' category
  42. # FIXME: once the 'subdir-objects' option has been mandatory.
  43. $AUTOMAKE -a -Wno-unsupported
  44. grep include Makefile.in # For debugging.
  45. grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
  46. grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
  47. grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1
  48. $AUTOCONF
  49. # Don't reject slower dependency extractors, for better coverage.
  50. ./configure --enable-dependency-tracking
  51. $MAKE
  52. DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
  53. # Try again with subdir-objects option.
  54. echo AUTOMAKE_OPTIONS += subdir-objects >> Makefile.am
  55. $AUTOMAKE
  56. grep include Makefile.in # For debugging.
  57. grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
  58. grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
  59. $EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
  60. $AUTOCONF
  61. # Don't reject slower dependency extractors, for better coverage.
  62. ./configure --enable-dependency-tracking
  63. $MAKE
  64. DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
  65. :