auxdir-cc-pr15981.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #! /bin/sh
  2. # Copyright (C) 2014-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 automake bug#15981: automake 1.14 may use $ac_aux_dir
  17. # before it is defined, leading to error messages such as:
  18. # "/bin/sh: /home/david/missing: No such file or directory"
  19. required=cc
  20. . test-init.sh
  21. cat > configure.ac <<END
  22. AC_INIT([$me], [0.0])
  23. AC_USE_SYSTEM_EXTENSIONS
  24. AM_INIT_AUTOMAKE([1.11 foreign])
  25. AC_CONFIG_FILES([Makefile])
  26. AC_SUBST([MISSING])
  27. AC_OUTPUT
  28. test -n "\${MISSING}"
  29. END
  30. echo 'int main (void) { return 0; }' > foo.c
  31. cat > Makefile.am <<'END'
  32. bin_PROGRAMS = foo
  33. # Without quotes around '--help' and with an empty $(MISSING), make might
  34. # strip the trailing '--', call Bash's 'help' builtin, and have this test
  35. # succeed spuriously. Yes, that has happened in practice :-(
  36. test:
  37. $(MISSING) '--help'
  38. END
  39. $ACLOCAL
  40. $AUTOCONF
  41. $AUTOMAKE
  42. ./configure 2>stderr || { cat stderr >&2; exit 1; }
  43. cat stderr >&2
  44. $FGREP "missing" stderr && exit 1
  45. $MAKE all
  46. $MAKE test
  47. :