2
0

aclocal-deps.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 dependencies on aclocal.m4 are set correctly.
  17. # Report from Jim Meyering.
  18. required=cc
  19. . test-init.sh
  20. cat >>configure.ac <<EOF
  21. AC_CONFIG_MACRO_DIR([m4])
  22. AC_PROG_RANLIB
  23. AM_PROG_AR
  24. AC_PROG_CC
  25. MY_MACRO
  26. AC_CONFIG_FILES([lib/Makefile])
  27. AC_OUTPUT
  28. EOF
  29. mkdir m4
  30. cat >m4/mymacro.m4 <<EOF
  31. AC_DEFUN([MY_MACRO], [])
  32. EOF
  33. mkdir lib
  34. : > lib/foo.c
  35. : > lib/bar.c
  36. cat >lib/Makefile.am <<'EOF'
  37. noinst_LIBRARIES = liberi.a
  38. liberi_a_SOURCES = bar.c
  39. liberi_a_LIBADD = $(LIBOBJS)
  40. EOF
  41. cat >Makefile.am <<'EOF'
  42. SUBDIRS = lib
  43. EXTRA_DIST = m4/mymacro.m4
  44. check-foo: distdir
  45. test -f $(distdir)/lib/foo.c
  46. test -f $(distdir)/lib/bar.c
  47. check-not-foo: distdir
  48. test ! -f $(distdir)/lib/foo.c
  49. test -f $(distdir)/lib/bar.c
  50. EOF
  51. $ACLOCAL
  52. $AUTOCONF
  53. $AUTOMAKE --add-missing
  54. ./configure
  55. $MAKE check-not-foo
  56. # Update one of the macros. This should cause ./configure, Makefile.in,
  57. # Makefile, lib/Makefile.in, and lib/Makefile to be updated.
  58. cat >m4/mymacro.m4 <<'EOF'
  59. AC_DEFUN([MY_MACRO], [AC_LIBOBJ([foo])])
  60. EOF
  61. using_gmake || $MAKE
  62. $MAKE check-foo
  63. :