2
0

pr87.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #! /bin/sh
  2. # Copyright (C) 2000-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/87.
  17. # "make distcheck" fails when two source dirs exist.
  18. required=cc
  19. . test-init.sh
  20. subdirs="foo bar"
  21. for i in $subdirs; do
  22. mkdir $i
  23. unindent >$i/$i.c <<EOF
  24. int main (void)
  25. {
  26. return 0;
  27. }
  28. EOF
  29. unindent >$i/Makefile.am <<EOF
  30. bin_PROGRAMS = $i
  31. ${i}_SOURCES = $i.c
  32. EOF
  33. done
  34. echo "SUBDIRS = $subdirs" > Makefile.am
  35. cat > configure.ac <<EOF
  36. AC_INIT([$me], [1.0])
  37. AC_CONFIG_SRCDIR([foo/foo.c])
  38. AC_CONFIG_AUX_DIR([.])
  39. AM_INIT_AUTOMAKE
  40. AC_PROG_CC
  41. AC_CONFIG_FILES([Makefile])
  42. AC_CONFIG_FILES([$(echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g')])
  43. AC_OUTPUT
  44. EOF
  45. mkdir build
  46. $ACLOCAL
  47. $AUTOCONF
  48. $AUTOMAKE -a
  49. # Regression test for bug where '.c.o:' is followed by blank line.
  50. (while read line; do
  51. if test "$line" = ".c.o:"; then
  52. read next
  53. if test -z "$next"; then
  54. exit 1
  55. else
  56. : # For shells with broken 'set -e'.
  57. fi
  58. break
  59. fi
  60. done) < foo/Makefile.in || exit 1
  61. cd build
  62. ../configure
  63. $MAKE distcheck
  64. :