2
0

dist-auxfile.sh 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #! /bin/sh
  2. # Copyright (C) 2011-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. # Files specified by AC_REQUIRE_AUX_FILE must exist, and they get
  17. # automatically distributed by the top-level Makefile.am.
  18. # Automake bug#9651 reported that this didn't happen when the build-aux
  19. # directory was set to '.' by AC_CONFIG_AUX_DIR.
  20. am_create_testdir=empty
  21. . test-init.sh
  22. i=0
  23. for auxdir in build-aux ''; do
  24. echo "*** Testing with auxdir '$auxdir' ***"
  25. i=$(($i + 1))
  26. mkdir T$i.d
  27. cd T$i.d
  28. unindent > configure.ac <<END
  29. AC_INIT([$me], [1.0])
  30. AC_CONFIG_AUX_DIR([${auxdir:-.}])
  31. AM_INIT_AUTOMAKE
  32. AC_REQUIRE_AUX_FILE([foo.txt])
  33. AC_REQUIRE_AUX_FILE([bar.sh])
  34. AC_REQUIRE_AUX_FILE([zardoz])
  35. AC_CONFIG_FILES([Makefile subdir/Makefile])
  36. AC_OUTPUT
  37. END
  38. echo auxdir = ${auxdir:+"$auxdir/"} > Makefile.am
  39. unindent >> Makefile.am <<'END'
  40. SUBDIRS = subdir
  41. test: distdir
  42. ls -l $(distdir) $(distdir)/* ;: For debugging.
  43. @echo DIST_COMMON = $(DIST_COMMON) ;: Likewise.
  44. echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)foo.txt '
  45. echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)bar.sh '
  46. echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)zardoz '
  47. test -f $(distdir)/$(auxdir)foo.txt
  48. test -f $(distdir)/$(auxdir)bar.sh
  49. test -f $(distdir)/$(auxdir)zardoz
  50. .PHONY: test
  51. check-local: test
  52. END
  53. mkdir subdir
  54. : > subdir/Makefile.am
  55. test -z "$auxdir" || mkdir "$auxdir" || exit 99
  56. if test -z "$auxdir"; then
  57. auxdir=.
  58. auxdir_rx='\.'
  59. else
  60. auxdir_rx=$auxdir
  61. fi
  62. $ACLOCAL
  63. $AUTOCONF
  64. AUTOMAKE_fails
  65. grep "^configure\\.ac:4:.* required file.*$auxdir_rx/foo\\.txt" stderr
  66. grep "^configure\\.ac:5:.* required file.*$auxdir_rx/bar\\.sh" stderr
  67. grep "^configure\\.ac:6:.* required file.*$auxdir_rx/zardoz" stderr
  68. touch $auxdir/foo.txt $auxdir/bar.sh $auxdir/zardoz
  69. cp "$am_scriptdir"/missing "$am_scriptdir"/install-sh $auxdir \
  70. || fatal_ "fetching auxiliary scripts 'missing' and 'install-sh'"
  71. $AUTOMAKE
  72. ./configure
  73. $MAKE test
  74. $EGREP '(foo\.txt|bar\.sh|zardoz)' subdir/Makefile.in && exit 1
  75. $MAKE distcheck
  76. cd ..
  77. done
  78. :