test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / t / lisp6.sh
blobd5467d054b1f2a13fa12d54ae4b8843c0dd4b304
1 #! /bin/sh
2 # Copyright (C) 2004-2024 Free Software Foundation, Inc.
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.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Test for conditional _LISP.
19 required=emacs
20 . test-init.sh
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
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
35 cat >> configure.ac << 'EOF'
36 AM_CONDITIONAL([WANT_TWO], [test -n "$want_two"])
37 AM_PATH_LISPDIR
38 AC_OUTPUT
39 EOF
41 # Avoid possible spurious influences from the environment.
42 unset want_two
44 echo "(provide 'am-one)" > am-one.el
45 echo "(require 'am-one)" > am-two.el
46 echo "(require 'am-one)" > am-three.el
48 $ACLOCAL
49 $AUTOCONF
50 $AUTOMAKE --add-missing
52 cwd=$(pwd) || fatal_ "getting current working directory"
54 ./configure --with-lispdir="$cwd/lisp"
56 $MAKE
57 test -f am-one.elc
58 test ! -e am-two.elc
59 test -f am-three.elc
61 $MAKE install
62 test -f lisp/am-one.el
63 test -f lisp/am-one.elc
64 test ! -e lisp/am-two.el
65 test ! -e lisp/am-two.elc
66 test ! -e lisp/am-three.el
67 test ! -e lisp/am-three.elc
69 $MAKE dist-test
71 $MAKE distclean
72 test ! -e am-one.elc
73 test ! -e am-two.elc
74 test ! -e am-three.elc
76 ./configure --with-lispdir="$cwd/lisp" want_two=1
78 $MAKE
79 test -f am-one.elc
80 test -f am-two.elc
81 test -f am-three.elc
83 # Let's mutilate the source tree, to check the recover rule.
84 rm -f am-*.elc
85 $MAKE
86 test -f am-one.elc
87 test -f am-two.elc
88 test -f am-three.elc
90 $MAKE install
91 test -f lisp/am-one.el
92 test -f lisp/am-one.elc
93 test -f lisp/am-two.el
94 test -f lisp/am-two.elc
95 test ! -e lisp/am-three.el
96 test ! -e lisp/am-three.elc
98 $MAKE dist-test
100 $MAKE distclean
101 test ! -e am-one.elc
102 test ! -e am-two.elc
103 test ! -e am-three.elc