aclocal-remake-misc.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #! /bin/sh
  2. # Copyright (C) 2003-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 aclocal.m4 is rebuilt whenever a configure
  17. # dependency changes. Test for acinclude.m4 and VPATH too.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. SOME_DEFS
  21. AC_CONFIG_FILES([sub/Makefile])
  22. AC_CONFIG_MACRO_DIR([m4])
  23. AC_OUTPUT
  24. END
  25. cat > Makefile.am << 'END'
  26. SUBDIRS = sub
  27. END
  28. mkdir sub
  29. : > sub/Makefile.am
  30. mkdir m4
  31. echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
  32. echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
  33. $ACLOCAL
  34. $AUTOCONF
  35. $AUTOMAKE --copy --add-missing
  36. mkdir build
  37. cd build
  38. ../configure
  39. $MAKE
  40. # Modified configure dependencies must be newer than config.status.
  41. $sleep
  42. # Update an aclocal.m4 dependency, then make sure all Makefiles
  43. # are updated, even from a sub-directory.
  44. echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
  45. # Because aclocal will run again, it should also pick up acinclude.m4.
  46. echo 'AC_SUBST([METOO])' > ../acinclude.m4
  47. cd sub
  48. $MAKE
  49. cd ..
  50. grep GREPME Makefile
  51. grep GREPME sub/Makefile
  52. grep GREPME sub/Makefile
  53. grep METOO Makefile
  54. grep METOO sub/Makefile
  55. grep METOO sub/Makefile
  56. # Make sure configure dependencies are distributed.
  57. $MAKE distdir
  58. test -f $me-1.0/m4/moredefs.m4
  59. test -f $me-1.0/m4/somedefs.m4
  60. test -f $me-1.0/acinclude.m4
  61. :