depcomp8a.sh 2.3 KB

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