lisp-loadpath.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #! /bin/sh
  2. # Copyright (C) 2012-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. # Emacs lisp files in both $(srcdir) and $(builddir) are found if
  17. # required by other files. Related to automake bug#11806.
  18. required=emacs
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AM_PATH_LISPDIR
  22. AC_OUTPUT
  23. END
  24. cat > Makefile.am << 'END'
  25. noinst_LISP = requirer.el
  26. lisp_LISP = foo.el
  27. lisp_DATA = bar.el
  28. END
  29. echo "(require 'foo) (require 'bar)" >> requirer.el
  30. echo "(provide 'foo)" > foo.el
  31. echo "(provide 'bar)" > bar.el
  32. $ACLOCAL
  33. $AUTOCONF
  34. $AUTOMAKE -a
  35. mkdir build
  36. cd build
  37. ../configure
  38. $MAKE
  39. test -f requirer.elc
  40. test -f foo.elc
  41. test ! -e bar.elc
  42. $MAKE clean
  43. test ! -e requirer.elc
  44. test ! -e foo.elc
  45. # In the spirit of VPATH, stuff in the builddir is preferred to
  46. # stuff in the srcdir.
  47. echo "(provide" > ../foo.el # Break it.
  48. echo "defun)" > ../bar.el # Likewise.
  49. $MAKE && exit 1
  50. $sleep
  51. echo "(provide 'foo)" > foo.el
  52. echo "(provide 'bar)" > bar.el
  53. $MAKE
  54. test -f requirer.elc
  55. test -f foo.elc
  56. test ! -e bar.elc
  57. :