subobj11a.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 that automake works around a bug of Solaris Make. The bug is the
  17. # following. If we have a Makefile containg a file inclusion like this:
  18. # include .//foo.mk
  19. # Solaris make fails with a message like:
  20. # make: ... can't find '/foo.mk': No such file or directory
  21. # make: fatal error ... read of include file '/foo.mk' failed
  22. # (even if the file 'foo.mk' exists). The error disappear by collapsing
  23. # the repeated slash '/' characters into a single one.
  24. #
  25. # See also sister "grepping" test 'subobj11b.sh', and related test
  26. # 'subobj11c.sh'.
  27. required=cc
  28. . test-init.sh
  29. cat >> configure.ac << 'END'
  30. AC_PROG_CC
  31. AC_OUTPUT
  32. END
  33. cat > Makefile.am << 'END'
  34. AUTOMAKE_OPTIONS = subdir-objects
  35. bin_PROGRAMS = foo
  36. ## The './/' below is meant.
  37. foo_SOURCES = .//src/foo.c
  38. END
  39. mkdir src
  40. cat > src/foo.c << 'END'
  41. int main(void)
  42. {
  43. return 0;
  44. }
  45. END
  46. $ACLOCAL
  47. $AUTOCONF
  48. $AUTOMAKE -a
  49. ./configure --enable-dependency-tracking
  50. depdir=$(sed -n 's/^ *DEPDIR *= *//p' Makefile)
  51. if test x"$depdir" != x; then
  52. depdir=src/$depdir
  53. else
  54. echo "$me: cannot extract value of DEPDIR from Makefile" >&2
  55. exit 1
  56. fi
  57. ls -l "$depdir"
  58. test -f "$depdir"/foo.Po
  59. echo 'quux:; echo "z@rd@z" >$@' >> "$depdir"/foo.Po
  60. $MAKE quux
  61. $FGREP "z@rd@z" quux
  62. $MAKE
  63. DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
  64. DISTCHECK_CONFIGURE_FLAGS='--disable-dependency-tracking' $MAKE distcheck
  65. :