aclocal-path.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # Check basic ACLOCAL_PATH support.
  17. am_create_testdir=empty
  18. . test-init.sh
  19. cat > configure.ac << 'END'
  20. AC_INIT
  21. AM_FOO_MACRO
  22. AM_BAR_MACRO
  23. AM_BAZ_MACRO
  24. END
  25. mkdir mdir1 mdir2 mdir3
  26. cat > mdir1/foo.m4 << 'END'
  27. AC_DEFUN([AM_FOO_MACRO], [am--foo])
  28. END
  29. cat > mdir2/bar.m4 << 'END'
  30. AC_DEFUN([AM_BAR_MACRO], [am--bar])
  31. END
  32. cat > mdir3/baz.m4 << 'END'
  33. AC_DEFUN([AM_BAZ_MACRO], [am--baz])
  34. END
  35. ACLOCAL_PATH=mdir1:./mdir2:$(pwd)/mdir3 $ACLOCAL
  36. $AUTOCONF
  37. # there should be no m4_include in aclocal.m4, even though ACLOCAL_PATH
  38. # contains 'mdir1' and './mdir2' as relative directories. Only -I
  39. # directories should be subject to file inclusion.
  40. $FGREP m4_include aclocal.m4 && exit 1
  41. $EGREP 'AM_(FOO|BAR|BAZ)_MACRO' configure && exit 1
  42. $FGREP 'am--foo' configure
  43. $FGREP 'am--bar' configure
  44. $FGREP 'am--baz' configure
  45. :