lisp5.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #! /bin/sh
  2. # Copyright (C) 2003-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. # Same as 'lisp4.sh', but using the now-recommended way to install
  17. # non-bytecompiled *.el files.
  18. required=emacs
  19. . test-init.sh
  20. cat > Makefile.am << 'EOF'
  21. lisp_DATA = am-one.el am-two.el am-three.el
  22. EXTRA_DIST = am-one.el am-two.el
  23. am-three.el:
  24. echo "(provide 'am-three)" > $@
  25. CLEANFILES = am-three.el
  26. test:
  27. test ! -f am-one.elc
  28. test ! -f am-two.elc
  29. test ! -f am-three.elc
  30. install-test: install
  31. test -f "$(lispdir)/am-one.el"
  32. test -f "$(lispdir)/am-two.el"
  33. test -f "$(lispdir)/am-three.el"
  34. test ! -f "$(lispdir)/am-one.elc"
  35. test ! -f "$(lispdir)/am-two.elc"
  36. test ! -f "$(lispdir)/am-three.elc"
  37. not-installed:
  38. find "$(lispdir)" | grep '\.el$$' && exit 1; :
  39. find "$(lispdir)" | grep '\.elc$$' && exit 1; :
  40. EOF
  41. cat >> configure.ac << 'EOF'
  42. AM_PATH_LISPDIR
  43. AC_OUTPUT
  44. EOF
  45. echo "(require 'am-two)" > am-one.el
  46. echo "(require 'am-three) (provide 'am-two)" > am-two.el
  47. # am-tree.el is a built source
  48. $ACLOCAL
  49. $AUTOCONF
  50. $AUTOMAKE --add-missing
  51. cwd=$(pwd) || fatal_ "getting current working directory"
  52. ./configure --prefix "$cwd"
  53. $MAKE
  54. $MAKE test
  55. $MAKE install-test
  56. $MAKE uninstall
  57. $MAKE not-installed
  58. # Fake the absence of emacs.
  59. # *.el files SHOULD be installed by "make install" (and uninstalled
  60. # by "make uninstall").
  61. ./configure EMACS=no --prefix "$cwd"
  62. $MAKE
  63. $MAKE test
  64. $MAKE install-test
  65. $MAKE uninstall
  66. $MAKE not-installed
  67. :