aclocal-path-install.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. # ACLOCAL_PATH and '--install' interactions.
  17. am_create_testdir=empty
  18. . test-init.sh
  19. cat > configure.ac << 'END'
  20. AC_INIT
  21. AM_FOO
  22. END
  23. mkdir acdir pdir ldir
  24. ACLOCAL="$ACLOCAL --system-acdir=$(pwd)/acdir"
  25. ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
  26. cat > acdir/foo.m4 << 'END'
  27. AC_DEFUN([AM_FOO], [:])
  28. END
  29. cat > pdir/bar.m4 << 'END'
  30. AC_DEFUN([AM_BAR], [:])
  31. END
  32. # The '--install' option should never cause anything to be installed
  33. # in a directory specified in ACLOCAL_PATH.
  34. $ACLOCAL --install 2>stderr && { cat stderr >&2; exit 1; }
  35. cat stderr >&2
  36. grep 'impossible without -I .* nor AC_CONFIG_MACRO_DIR' stderr
  37. test ! -e pdir/foo.m4
  38. # The '--install' option should cause a required macro found in a
  39. # directory specified in ACLOCAL_PATH to be installed locally.
  40. echo AM_BAR >> configure.ac
  41. $ACLOCAL --install -I ldir
  42. diff pdir/bar.m4 ldir/bar.m4
  43. :