repeated-options.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. # Check that automake does not complain on repeated options, nor
  17. # generate broken or incorrect makefiles.
  18. required='cc bzip2'
  19. . test-init.sh
  20. cat >configure.ac <<END
  21. AC_INIT([$me], [1.0])
  22. AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip no-dist-gzip dist-bzip2])
  23. AC_PROG_CC
  24. AC_CONFIG_FILES([Makefile])
  25. AC_OUTPUT
  26. END
  27. cat > Makefile.am <<'END'
  28. AUTOMAKE_OPTIONS = parallel-tests subdir-objects subdir-objects
  29. AUTOMAKE_OPTIONS += dist-bzip2 parallel-tests
  30. TESTS = foo.test
  31. EXTRA_DIST = $(TESTS)
  32. TESTS_ENVIRONMENT = EXEEXT='$(EXEEXT)'
  33. bin_PROGRAMS = sub/foo
  34. .PHONY: test-build
  35. test-build:
  36. ls -l . sub
  37. test -f sub/foo.$(OBJEXT)
  38. test -f sub/foo$(EXEEXT)
  39. END
  40. mkdir sub
  41. cat > foo.test <<'END'
  42. #!/bin/sh
  43. test -f sub/foo$EXEEXT && test -x sub/foo$EXEEXT
  44. END
  45. chmod a+x foo.test
  46. cat > sub/foo.c <<'END'
  47. int main (void)
  48. {
  49. return 0;
  50. }
  51. END
  52. cp "$am_scriptdir"/test-driver .
  53. $ACLOCAL
  54. $AUTOMAKE --foreign --foreign -Wall 2>stderr || { cat stderr >&2; exit 1; }
  55. test -s stderr && { cat stderr >&2; exit 1; }
  56. rm -f stderr
  57. $AUTOCONF
  58. ./configure
  59. $MAKE
  60. $MAKE test-build
  61. $MAKE check
  62. ls -l
  63. test -f foo.log
  64. test -f test-suite.log
  65. $MAKE clean
  66. $MAKE distcheck
  67. ls -l
  68. test -f $me-1.0.tar.bz2
  69. test ! -e $me-1.0.tar.gz
  70. :