conffile-leading-dot.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #! /bin/sh
  2. # Copyright (C) 2012-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. # Automake must complain if AC_CONFIG_FILES is passed something starting
  17. # with a dot (like "./Makefile"), since the remake rules might be subtly
  18. # broken in that case.
  19. required=GNUmake
  20. . test-init.sh
  21. cat > configure.ac << END
  22. AC_INIT([$me], [1.0])
  23. AM_INIT_AUTOMAKE
  24. AC_CONFIG_FILES([./Makefile])
  25. AC_CONFIG_FILES([./foo:a.in:b.in:c.in])
  26. AC_OUTPUT
  27. END
  28. touch a.in b.in c.in Makefile.am
  29. $ACLOCAL
  30. AUTOMAKE_fails -Wnone -Wunsupported
  31. grep "^configure\.ac:3:.*'\\./Makefile'" stderr
  32. grep "^configure\.ac:3:.* omit leading '\\./'" stderr
  33. grep "^configure\.ac:3:.*remake rules might be subtly broken" stderr
  34. grep "^configure\.ac:4:.*'\\./foo'" stderr
  35. grep "^configure\.ac:4:.* omit leading '\\./'" stderr
  36. grep "^configure\.ac:4:.*remake rules might be subtly broken" stderr
  37. # Check that our warning was actually justified.
  38. sed 's/^AM_INIT_AUTOMAKE/&([-Wall -Wno-unsupported])/' <configure.ac >t
  39. mv -f t configure.ac
  40. rm -rf autom4te*.cache
  41. $ACLOCAL
  42. $AUTOCONF
  43. $AUTOMAKE -Wall -Wno-unsupported
  44. ./configure
  45. $MAKE
  46. $sleep
  47. touch Makefile.am
  48. # Check that remake rules do truly break -- otherwise automake is
  49. # giving a bogus warning.
  50. run_make -e FAIL -E
  51. grep "config\\.status:.*invalid argument.*Makefile" stderr
  52. :