output12.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #! /bin/sh
  2. # Copyright (C) 2005-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. # Make sure an AC_CONFIG_FILES process filenames with AC_SUBST variables.
  17. . test-init.sh
  18. cat >> configure.ac << \END
  19. AC_SUBST([FOO], [foo])
  20. AC_SUBST([file1], [this.in])
  21. echo @FOO@ >$file1
  22. AC_SUBST([file2], [that])
  23. AC_SUBST([file3], [mumble])
  24. AC_SUBST([file4], [foo])
  25. AC_CONFIG_FILES([this:$file1],, [file1=$file1])
  26. AC_CONFIG_FILES([sub/this:$file1])
  27. AC_CONFIG_FILES([${file2}:this],, [file2=$file2])
  28. AC_CONFIG_FILES([${file3}],, [file3=$file3])
  29. AC_CONFIG_FILES([${file4}:foo.in],, [file4=$file4])
  30. AC_CONFIG_FILES([sub/Makefile])
  31. AC_OUTPUT
  32. END
  33. mkdir sub
  34. cat >Makefile.am <<\EOF
  35. SUBDIRS = sub
  36. DISTCLEANFILES = $(file1)
  37. dist-hook:
  38. test -f $(distdir)/foo.in
  39. test ! -f $(distdir)/this
  40. EOF
  41. echo @FOO@ >mumble.in
  42. echo @FOO@ >foo.in
  43. : >sub/Makefile.am
  44. $ACLOCAL
  45. $AUTOCONF
  46. $AUTOMAKE
  47. ./configure
  48. $MAKE distcheck
  49. cd sub
  50. rm -f this
  51. $MAKE this
  52. grep foo this