lisp4.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. # Make sure setting ELCFILES= disable byte-compilation as documented.
  17. # Report from Simon Josefsson.
  18. required=emacs
  19. . test-init.sh
  20. cat > Makefile.am << 'EOF'
  21. lisp_LISP = am-one.el am-two.el am-three.el
  22. EXTRA_DIST = am-one.el am-two.el
  23. ELCFILES=
  24. am-three.el:
  25. echo "(provide 'am-three)" > $@
  26. CLEANFILES = am-three.el
  27. test:
  28. test ! -f am-one.elc
  29. test ! -f am-two.elc
  30. test ! -f am-three.elc
  31. install-test: install
  32. test -f "$(lispdir)/am-one.el"
  33. test -f "$(lispdir)/am-two.el"
  34. test -f "$(lispdir)/am-three.el"
  35. test ! -f "$(lispdir)/am-one.elc"
  36. test ! -f "$(lispdir)/am-two.elc"
  37. test ! -f "$(lispdir)/am-three.elc"
  38. not-installed:
  39. find "$(lispdir)" | grep '\.el$$' && exit 1; :
  40. find "$(lispdir)" | grep '\.elc$$' && exit 1; :
  41. EOF
  42. cat >> configure.ac << 'EOF'
  43. AM_PATH_LISPDIR
  44. AC_OUTPUT
  45. EOF
  46. echo "(require 'am-two)" > am-one.el
  47. echo "(require 'am-three) (provide 'am-two)" > am-two.el
  48. # am-tree.el is a built source
  49. $ACLOCAL
  50. $AUTOCONF
  51. $AUTOMAKE --add-missing
  52. cwd=$(pwd) || fatal_ "getting current working directory"
  53. ./configure --prefix "$cwd"
  54. $MAKE
  55. $MAKE test
  56. $MAKE install-test
  57. $MAKE uninstall
  58. $MAKE not-installed
  59. # Fake the absence of emacs.
  60. # *.el files should not be installed, but "make install" and
  61. # "make uninstall" should continue to work.
  62. ./configure EMACS=no --prefix "$cwd"
  63. $MAKE
  64. $MAKE test
  65. $MAKE install
  66. $MAKE not-installed
  67. $MAKE uninstall
  68. :