Merge branch 'maint'
[platform/upstream/automake.git] / t / lisp6.sh
1 #! /bin/sh
2 # Copyright (C) 2004-2012 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
17 # Test for conditional _LISP.
18
19 required=emacs
20 . ./defs || Exit 1
21
22 cat > Makefile.am << 'EOF'
23 dist_lisp_LISP = am-one.el
24 if WANT_TWO
25   dist_lisp_LISP += am-two.el
26 endif
27 dist_noinst_LISP = am-three.el
28
29 dist-test: distdir
30         test -f $(distdir)/am-one.el
31         test -f $(distdir)/am-two.el
32         test -f $(distdir)/am-three.el
33 EOF
34
35 cat >> configure.ac << 'EOF'
36 AM_CONDITIONAL([WANT_TWO], [test -n "$want_two"])
37 AM_PATH_LISPDIR
38 AC_OUTPUT
39 EOF
40
41 echo "(provide 'am-one)" > am-one.el
42 echo "(require 'am-one)" > am-two.el
43 echo "(require 'am-one)" > am-three.el
44
45 $ACLOCAL
46 $AUTOCONF
47 $AUTOMAKE --add-missing
48
49 ./configure "--with-lispdir=`pwd`/lisp"
50
51 $MAKE
52 test -f am-one.elc
53 test ! -f am-two.elc
54 test -f am-three.elc
55 test -f elc-stamp
56
57 $MAKE install
58 test -f lisp/am-one.el
59 test -f lisp/am-one.elc
60 test ! -f lisp/am-two.el
61 test ! -f lisp/am-two.elc
62 test ! -f lisp/am-three.el
63 test ! -f lisp/am-three.elc
64
65 $MAKE dist-test
66
67 $MAKE distclean
68 test ! -f am-one.elc
69 test ! -f am-two.elc
70 test ! -f am-three.elc
71 test ! -f elc-stamp
72
73 ./configure "--with-lispdir=`pwd`/lisp" want_two=1
74
75 $MAKE
76 test -f am-one.elc
77 test -f am-two.elc
78 test -f am-three.elc
79 test -f elc-stamp
80
81 # Let's mutilate the source tree, to check the recover rule.
82 rm -f am-*.elc
83 $MAKE
84 test -f am-one.elc
85 test -f am-two.elc
86 test -f am-three.elc
87 test -f elc-stamp
88
89 $MAKE install
90 test -f lisp/am-one.el
91 test -f lisp/am-one.elc
92 test -f lisp/am-two.el
93 test -f lisp/am-two.elc
94 test ! -f lisp/am-three.el
95 test ! -f lisp/am-three.elc
96
97 $MAKE dist-test
98
99 $MAKE distclean
100 test ! -f am-one.elc
101 test ! -f am-two.elc
102 test ! -f am-three.elc
103 test ! -f elc-stamp
104
105 :