doc: typos in test file.
[automake.git] / t / stdlib2.sh
blob3ad10c141e389c23c2763f8f2a8f2db7c6d5d9f9
1 #! /bin/sh
2 # Copyright (C) 2003-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 for AM_LDFLAGS = -module
18 # Report from Kevin P. Fleming.
19 required=libtool
20 . test-init.sh
22 : > README
23 : > NEWS
24 : > AUTHORS
25 : > ChangeLog
26 : > ltconfig
27 : > ltmain.sh
28 : > config.guess
29 : > config.sub
31 cat >> configure.ac << 'END'
32 AC_PROG_CC
33 AM_PROG_AR
34 AC_PROG_LIBTOOL
35 AC_OUTPUT
36 END
38 : > Makefile.inc
40 cat > Makefile.am << 'END'
41 include Makefile.inc
42 lib_LTLIBRARIES = nonstandard.la
43 nonstandard_la_SOURCES = foo.c
44 FOO = -module
45 END
47 $ACLOCAL
48 AUTOMAKE_fails --add-missing --gnu
49 grep 'Makefile.am:2:.*nonstandard.la.*standard libtool library name' stderr
50 grep 'Makefile.am:2:.*libnonstandard.la' stderr
52 # We will use -Wno-gnu to disable the warning about setting LDFLAGS (below)
53 # Make sure nonstandard names are diagnosed anyway.
54 AUTOMAKE_fails --add-missing --gnu -Wno-gnu
55 grep 'Makefile.am:2:.*nonstandard.la.*standard libtool library name' stderr
56 grep 'Makefile.am:2:.*libnonstandard.la' stderr
58 # Make sure nonstandard_la_LDFLAGS is read even if LDFLAGS is used.
59 cat >Makefile.inc <<'EOF'
60 LDFLAGS = -lfoo
61 nonstandard_la_LDFLAGS = $(FOO)
62 EOF
63 $AUTOMAKE -Wno-gnu
65 # Make sure LDFLAGS is read even if nonstandard_la_LDFLAGS is used.
66 cat >Makefile.inc <<'EOF'
67 LDFLAGS = $(FOO)
68 nonstandard_la_LDFLAGS = -lfoo
69 EOF
70 $AUTOMAKE -Wno-gnu
72 # Make sure AM_LDFLAGS is not read if foo_LDFLAGS is used.
73 cat >Makefile.inc <<'EOF'
74 nonstandard_la_LDFLAGS = -lfoo
75 AM_LDFLAGS = -module
76 EOF
77 AUTOMAKE_fails
78 grep 'Makefile.am:2:.*nonstandard.la.*standard libtool library name' stderr
79 grep 'Makefile.am:2:.*libnonstandard.la' stderr
81 echo 'AM_LDFLAGS = -module' > Makefile.inc
82 $AUTOMAKE
84 # For module, Automake should not suggest the lib prefix.
85 cat > Makefile.am << 'END'
86 include Makefile.inc
87 lib_LTLIBRARIES = nonstandard
88 nonstandard_SOURCES = foo.c
89 FOO = -module
90 END
92 AUTOMAKE_fails
93 grep "Makefile.am:2:.*'nonstandard'.*standard libtool module name" stderr
94 grep 'Makefile.am:2:.*nonstandard.la' stderr