2
0

aclocal-acdir.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #! /bin/sh
  2. # Copyright (C) 2011-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 aclocal's '--automake-acdir' and '--system-acdir' options. Also
  17. # check that stuff in the automake acdir takes precedence over stuff in
  18. # the system acdir.
  19. . test-init.sh
  20. mkdir am sys
  21. # FIXME: remove in Automake 2.0
  22. mkdir am/internal
  23. : > am/internal/ac-config-macro-dirs.m4
  24. cat >> configure.ac <<'END'
  25. MY_MACRO
  26. END
  27. cat > am/foo.m4 <<'END'
  28. AC_DEFUN([AM_INIT_AUTOMAKE], [fake--init--automake])
  29. END
  30. cat > sys/foo.m4 <<'END'
  31. AC_DEFUN([MY_MACRO], [my--macro])
  32. END
  33. $ACLOCAL --automake-acdir am
  34. $AUTOCONF --force
  35. $FGREP 'fake--init--automake' configure
  36. $FGREP 'MY_MACRO' configure
  37. rm -rf autom4te*.cache
  38. $ACLOCAL --system-acdir sys
  39. $AUTOCONF --force
  40. $FGREP 'am__api_version' configure
  41. $FGREP 'my--macro' configure
  42. rm -rf autom4te*.cache
  43. $ACLOCAL --automake-acdir am --system-acdir sys
  44. $AUTOCONF --force
  45. $FGREP 'fake--init--automake' configure
  46. $FGREP 'my--macro' configure
  47. rm -rf autom4te*.cache
  48. $ACLOCAL --system-acdir sys --automake-acdir am
  49. $AUTOCONF --force
  50. $FGREP 'fake--init--automake' configure
  51. $FGREP 'my--macro' configure
  52. rm -rf autom4te*.cache
  53. # Stuff in automake acdir takes precedence over stuff in system acdir.
  54. cat > am/bar.m4 <<'END'
  55. AC_DEFUN([MY_MACRO], [am--macro])
  56. END
  57. $ACLOCAL --automake-acdir am --system-acdir sys
  58. $AUTOCONF --force
  59. $FGREP 'fake--init--automake' configure
  60. $FGREP 'am--macro' configure
  61. $FGREP 'my--macro' configure && exit 1 # Just to be sure.
  62. :