lisp-subdir.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 subdirectories.
  17. required=emacs
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AM_PATH_LISPDIR
  21. AC_OUTPUT
  22. END
  23. cat > Makefile.am << 'END'
  24. nobase_lisp_LISP = sub/am-one.el sub/am-two.el sub/am-three.el
  25. nobase_dist_lisp_LISP = sub/am-three.el
  26. dist_noinst_LISP = sub/am-four.el
  27. EXTRA_DIST = sub/am-one.el sub/am-two.el
  28. END
  29. mkdir sub
  30. echo "(require 'am-two) (provide 'am-one)" > sub/am-one.el
  31. echo "(require 'am-three) (provide 'am-two)" > sub/am-two.el
  32. echo "(provide 'am-three)" > sub/am-three.el
  33. echo "(require 'am-one) (require 'am-two)" > sub/am-four.el
  34. $ACLOCAL
  35. $AUTOCONF
  36. $AUTOMAKE --add-missing
  37. ./configure --prefix="$(pwd)/inst" \
  38. --with-lispdir="$(pwd)/inst/elisp" \
  39. $MAKE
  40. # No byte-compiled elisp files in the top-level directory.
  41. test "$(echo *.elc)" = '*.elc'
  42. test -f sub/am-one.elc
  43. test -f sub/am-two.elc
  44. test -f sub/am-three.elc
  45. test -f sub/am-four.elc
  46. $MAKE clean
  47. test ! -e sub/am-one.elc
  48. test ! -e sub/am-two.elc
  49. test ! -e sub/am-three.elc
  50. test ! -e sub/am-four.elc
  51. # Check installation.
  52. sort > exp << 'END'
  53. inst/elisp/sub/am-one.elc
  54. inst/elisp/sub/am-two.elc
  55. inst/elisp/sub/am-three.elc
  56. END
  57. $MAKE install
  58. find inst # For debugging.
  59. find inst -name '*.elc' > lst || { cat lst; exit 1; }
  60. sort lst > got
  61. cat exp
  62. cat got
  63. diff exp got
  64. # Also check VPATH builds and uninstall completeness.
  65. $MAKE distcheck
  66. :