pr224.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #! /bin/sh
  2. # Copyright (C) 2002-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 PR automake/224: $(top_srcdir) w.r.t. dependencies.
  17. #
  18. # == Description ==
  19. # Dependency tracking data should be stored in in the relative path
  20. # of the source file, as opposed the object file.
  21. # I.e., for 'foo.c' in '$(top_srcdir)/bar', being built in
  22. # '$(top_srcdir)/build', the location of the '.deps' directory
  23. # should be '$(top_builddir)/bar/.deps'.
  24. required=cc
  25. . test-init.sh
  26. mkdir foo
  27. cat >foo/main.c <<'EOF'
  28. int main (void)
  29. {
  30. return 0;
  31. }
  32. EOF
  33. cat >Makefile.am <<'EOF'
  34. AUTOMAKE_OPTIONS = subdir-objects
  35. bin_PROGRAMS = bar
  36. bar_SOURCES = foo/main.c
  37. EOF
  38. cat >>configure.ac <<'EOF'
  39. AC_PROG_CC
  40. AC_OUTPUT
  41. EOF
  42. mkdir build
  43. $ACLOCAL
  44. $AUTOCONF
  45. $AUTOMAKE -a
  46. cd build
  47. ../configure
  48. $MAKE
  49. test -d foo/.deps
  50. $MAKE distclean
  51. test -d foo/.deps && exit 1
  52. :