remake-macrodir.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. # Check that the aclocal honouring of AC_CONFIG_MACRO_DIR interacts
  17. # nicely with automatic rebuild rules.
  18. . test-init.sh
  19. cat >> configure.ac <<'END'
  20. AC_CONFIG_MACRO_DIR([macro-dir])
  21. my__FOO || AS_EXIT([1])
  22. AC_OUTPUT
  23. END
  24. : > Makefile.am
  25. mkdir macro-dir
  26. cat > macro-dir/foo.m4 <<'END'
  27. AC_DEFUN([my__FOO], [: > bar])
  28. END
  29. $ACLOCAL
  30. $AUTOCONF
  31. $AUTOMAKE
  32. $FGREP my__FOO configure && exit 1
  33. ./configure
  34. test -f bar
  35. rm -f bar
  36. $sleep
  37. cat > macro-dir/foo.m4 <<'END'
  38. AC_DEFUN([my__FOO], [: > baz])
  39. END
  40. $MAKE Makefile
  41. test -f baz
  42. test ! -r bar
  43. rm -f baz
  44. $sleep
  45. rm -f macro-dir/foo.m4
  46. cat > macro-dir/quux.m4 <<'END'
  47. AC_DEFUN([my__FOO], [: > quux])
  48. END
  49. $MAKE Makefile
  50. test -f quux
  51. test ! -r baz
  52. rm -f quux
  53. $sleep
  54. sed 's/^AC_CONFIG_MACRO_DIR/&([newdir])/' configure.ac > t
  55. mv -f t configure.ac
  56. mkdir newdir
  57. cat > newdir/mu.m4 <<'END'
  58. AC_DEFUN([my__FOO], [[: my__FOO do nothing]])
  59. END
  60. $MAKE Makefile
  61. $FGREP ': my__FOO do nothing' configure
  62. $MAKE distcheck
  63. :