doc: update Vala documentation
[automake.git] / t / lex-lib.sh
blob2bb0c9604355dfe43c7d8bca4132b3fa314a7d00
1 #! /bin/sh
2 # Copyright (C) 1999-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 # Check that we can provide a personal 'yywrap' function in a custom
18 # library.
19 # See also test 'lex-lib-external.sh'.
21 required='cc lex'
22 . test-init.sh
24 cat >> configure.ac << 'END'
25 AC_PROG_CC
26 AM_PROG_AR
27 AC_PROG_RANLIB
28 LEXLIB=libmylex.a
29 AC_PROG_LEX
30 AC_OUTPUT
31 END
33 cat > Makefile.am << 'END'
34 AM_LFLAGS = --never-interactive
36 bin_PROGRAMS = lexer
37 lexer_SOURCES = foo.l
38 lexer_LDADD = $(LEXLIB)
39 EXTRA_lexer_DEPENDENCIES = $(LEXLIB)
40 noinst_LIBRARIES = libmylex.a
41 libmylex_a_SOURCES = mu.c
42 END
44 cat > mu.c << 'END'
45 int yywrap (void)
47 return 1;
49 END
51 cat > foo.l <<'END'
53 "END" return EOF;
56 int main (void)
58 return 0;
60 END
62 $ACLOCAL
63 $AUTOCONF
64 $AUTOMAKE -a
66 ./configure
67 $MAKE
68 test -f foo.c
69 test -f libmylex.a