lisp6.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #! /bin/sh
  2. # Copyright (C) 2004-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. # Test for conditional _LISP.
  17. required=emacs
  18. . test-init.sh
  19. cat > Makefile.am << 'EOF'
  20. dist_lisp_LISP = am-one.el
  21. if WANT_TWO
  22. dist_lisp_LISP += am-two.el
  23. endif
  24. dist_noinst_LISP = am-three.el
  25. dist-test: distdir
  26. test -f $(distdir)/am-one.el
  27. test -f $(distdir)/am-two.el
  28. test -f $(distdir)/am-three.el
  29. EOF
  30. cat >> configure.ac << 'EOF'
  31. AM_CONDITIONAL([WANT_TWO], [test -n "$want_two"])
  32. AM_PATH_LISPDIR
  33. AC_OUTPUT
  34. EOF
  35. # Avoid possible spurious influences from the environment.
  36. unset want_two
  37. echo "(provide 'am-one)" > am-one.el
  38. echo "(require 'am-one)" > am-two.el
  39. echo "(require 'am-one)" > am-three.el
  40. $ACLOCAL
  41. $AUTOCONF
  42. $AUTOMAKE --add-missing
  43. cwd=$(pwd) || fatal_ "getting current working directory"
  44. ./configure --with-lispdir="$cwd/lisp"
  45. $MAKE
  46. test -f am-one.elc
  47. test ! -e am-two.elc
  48. test -f am-three.elc
  49. $MAKE install
  50. test -f lisp/am-one.el
  51. test -f lisp/am-one.elc
  52. test ! -e lisp/am-two.el
  53. test ! -e lisp/am-two.elc
  54. test ! -e lisp/am-three.el
  55. test ! -e lisp/am-three.elc
  56. $MAKE dist-test
  57. $MAKE distclean
  58. test ! -e am-one.elc
  59. test ! -e am-two.elc
  60. test ! -e am-three.elc
  61. ./configure --with-lispdir="$cwd/lisp" want_two=1
  62. $MAKE
  63. test -f am-one.elc
  64. test -f am-two.elc
  65. test -f am-three.elc
  66. # Let's mutilate the source tree, to check the recover rule.
  67. rm -f am-*.elc
  68. $MAKE
  69. test -f am-one.elc
  70. test -f am-two.elc
  71. test -f am-three.elc
  72. $MAKE install
  73. test -f lisp/am-one.el
  74. test -f lisp/am-one.elc
  75. test -f lisp/am-two.el
  76. test -f lisp/am-two.elc
  77. test ! -e lisp/am-three.el
  78. test ! -e lisp/am-three.elc
  79. $MAKE dist-test
  80. $MAKE distclean
  81. test ! -e am-one.elc
  82. test ! -e am-two.elc
  83. test ! -e am-three.elc
  84. :