aclocal-deps-subdir.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. # Test to make sure that aclocal.m4's dependencies are honored in
  17. # sub-directories. See also related tests 'remake-subdir*.sh'.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_CONFIG_MACRO_DIR([m4])
  21. FOO_TEST([GREPME])
  22. AC_CONFIG_FILES([sub/Makefile])
  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([FOO_TEST], [echo $@])' > m4/moredefs.m4
  32. $ACLOCAL
  33. $AUTOCONF
  34. $AUTOMAKE --copy --add-missing
  35. ./configure
  36. $MAKE
  37. # Update an aclocal.m4 dependency, then make sure all Makefiles are
  38. # updated, even from a sub-directory. Check that AU_ALIAS is
  39. # recognized. Change the definition of FOO_TEST to check that its new
  40. # definition is used.
  41. $sleep # Modified configure dependencies must be newer than config.status.
  42. echo 'AU_ALIAS([FOO_TEST], [AC_SUBST])' > m4/moredefs.m4
  43. cd sub
  44. $MAKE
  45. cd ..
  46. grep GREPME Makefile
  47. grep GREPME sub/Makefile
  48. # Make sure configure dependencies are distributed.
  49. $MAKE distdir
  50. test -f $me-1.0/m4/moredefs.m4
  51. # Change the definition of FOO_TEST to check that its new definition is
  52. # used. Check that AC_DEFUN_ONCE is caught.
  53. $sleep # Modified configure dependencies must be newer than config.status.
  54. echo 'AC_DEFUN_ONCE([FOO_TEST], [AC_SUBST(__$1__)])' > m4/moredefs.m4
  55. $MAKE
  56. grep 'm4/moredefs\.m4' aclocal.m4
  57. grep '__GREPME__' configure
  58. :