lisp-subdir-mix.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. # Check compiling elisp files in different subdirectories, where a
  17. # file in a subdirectory might require a file in another one.
  18. # This doesn't work out of the box, but can be made to work with a
  19. # judicious use of $(AM_ELCFLAGS).
  20. required=emacs
  21. . test-init.sh
  22. cat >> configure.ac << 'END'
  23. AM_PATH_LISPDIR
  24. AC_OUTPUT
  25. END
  26. cat > Makefile.am << 'END'
  27. dist_lisp_LISP = \
  28. am-here.el \
  29. sub1/am-one.el \
  30. sub2/am-two.el \
  31. sub3/subsub/am-three.el
  32. AM_ELCFLAGS = \
  33. -L $(srcdir)/sub1 \
  34. -L $(srcdir)/sub2 \
  35. -L $(srcdir)/sub3/subsub
  36. elc-test:
  37. test -f sub1/am-one.elc
  38. test -f sub2/am-two.elc
  39. test -f sub3/subsub/am-three.elc
  40. .PHONY: elc-test
  41. check-local: elc-test
  42. END
  43. mkdir sub1 sub2 sub3 sub3/subsub
  44. cat > am-here.el << 'END'
  45. (provide 'am-here)
  46. (require 'am-one)
  47. (require 'am-two)
  48. (require 'am-three)
  49. END
  50. cat > sub1/am-one.el << 'END'
  51. (require 'am-here)
  52. (provide 'am-one)
  53. (require 'am-two)
  54. (require 'am-three)
  55. END
  56. cat > sub2/am-two.el << 'END'
  57. (require 'am-here)
  58. (require 'am-one)
  59. (provide 'am-two)
  60. (require 'am-three)
  61. END
  62. cat > sub3/subsub/am-three.el << 'END'
  63. (require 'am-here)
  64. (require 'am-one)
  65. (require 'am-two)
  66. (provide 'am-three)
  67. END
  68. $ACLOCAL
  69. $AUTOCONF
  70. $AUTOMAKE --add-missing
  71. ./configure
  72. $MAKE
  73. $MAKE elc-test
  74. $MAKE clean
  75. for x in am-here sub1/am-one sub2/am-two sub3/subsub/am-three; do
  76. test -f $x.el
  77. test ! -e $x.elc
  78. done
  79. $MAKE distcheck
  80. :