doc: update Vala documentation
[automake.git] / t / specflg-dummy.sh
blob2b686cc23cfa18d6ad27845c961cac31698c31b2
1 #! /bin/sh
2 # Copyright (C) 2011-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 even "dummy" per-target flags triggers the use of renamed
18 # objects. I.e., a definition like 'foo_CFLAGS = $(AM_CFLAGS)' should
19 # always cause Automake to trigger the semantics for per-target CFLAGS,
20 # even if AM_CFLAGS is undefined. Similarly for other *FLAGS variables
21 # (CXXFLAGS, YFLAGS, LDFLAGS, ...)
23 . test-init.sh
25 # Disable shell globbing if possible.
26 (set +f) >/dev/null 2>&1 && set +f
28 oIFS=$IFS
29 nl='
32 matches=
33 add_match ()
35 matches="$matches$nl$1"
38 do_check ()
40 IFS=$nl
41 for string in $matches; do
42 IFS=$oIFS
43 $FGREP "$string" Makefile.in
44 done
45 IFS=$oIFS
48 # Fake libtool presence, so that we won't have to require it.
49 cat > acinclude.m4 <<END
50 AC_DEFUN([AC_PROG_LIBTOOL], [AC_SUBST([LIBTOOL], [dummy])])
51 END
52 : > ltmain.sh
54 cat >> configure.ac << 'END'
55 AC_PROG_CC
56 AC_PROG_CXX
57 AC_PROG_YACC
58 AC_PROG_LEX
59 AC_PROG_F77
60 AC_PROG_FC
61 AM_PROG_GCJ
62 AM_PROG_AR
63 AC_PROG_RANLIB
64 AC_PROG_LIBTOOL
65 AM_PROG_UPC
66 AC_PROG_OBJC
67 END
69 cat > Makefile.am <<'END'
70 bin_PROGRAMS =
71 lib_LIBRARIES =
72 lib_LTLIBRARIES =
73 END
75 $ACLOCAL
77 cat >> Makefile.am <<'END'
78 bin_PROGRAMS += prog1
79 prog1_SOURCES = source1.c
80 prog1_CFLAGS = $(AM_CFLAGS)
81 END
83 add_match 'prog1-source1.$(OBJEXT)'
85 cat >> Makefile.am <<'END'
86 bin_PROGRAMS += prog2
87 prog2_SOURCES = source2.c
88 prog2_CPPFLAGS = $(AM_CPPFLAGS)
89 END
91 add_match 'prog2-source2.$(OBJEXT)'
93 cat >> Makefile.am <<'END'
94 bin_PROGRAMS += prog3
95 prog3_SOURCES = source3.cxx
96 prog3_CXXFLAGS = $(AM_CXXFLAGS)
97 END
99 add_match 'prog3-source3.$(OBJEXT)'
101 cat >> Makefile.am <<'END'
102 bin_PROGRAMS += prog4
103 prog4_SOURCES = source4.c++
104 prog4_CPPFLAGS = $(AM_CPPFLAGS)
107 add_match 'prog4-source4.$(OBJEXT)'
109 cat >> Makefile.am <<'END'
110 bin_PROGRAMS += prog5
111 prog5_SOURCES = source5.f
112 prog5_FFLAGS = $(AM_FFLAGS)
115 add_match 'prog5-source5.$(OBJEXT)'
117 cat >> Makefile.am <<'END'
118 bin_PROGRAMS += prog6
119 prog6_SOURCES = source6.f90
120 prog6_FCFLAGS = $(AM_FCFLAGS)
123 add_match 'prog6-source6.$(OBJEXT)'
125 cat >> Makefile.am <<'END'
126 bin_PROGRAMS += prog7
127 prog7_SOURCES = source7.r
128 prog7_RFLAGS = $(AM_RFLAGS)
131 add_match 'prog7-source7.$(OBJEXT)'
133 cat >> Makefile.am <<'END'
134 bin_PROGRAMS += prog8
135 prog8_SOURCES = source8.java
136 prog8_GCJFLAGS = $(AM_GCJFLAGS)
139 add_match 'prog8-source8.$(OBJEXT)'
141 cat >> Makefile.am <<'END'
142 bin_PROGRAMS += prog9
143 prog9_SOURCES = source9.upc
144 prog9_UPCFLAGS = $(AM_UPCFLAGS)
147 add_match 'prog9-source9.$(OBJEXT)'
149 cat >> Makefile.am <<'END'
150 bin_PROGRAMS += prog10
151 prog10_SOURCES = source10.m
152 prog10_OBJCFLAGS = $(AM_OBJCFLAGS)
155 add_match 'prog10-source10.$(OBJEXT)'
157 cat >> Makefile.am <<'END'
158 bin_PROGRAMS += linkprog
159 linkprog_SOURCES = linkprog.c
160 linkprog_LDFLAGS = $(AM_LDFLAGS)
163 add_match 'linkprog_LINK ='
165 cat >> Makefile.am <<'END'
166 lib_LIBRARIES += libstatic.a
167 libstatic_a_SOURCES = static123.c
168 libstatic_a_CFLAGS = $(AM_CFLAGS)
171 add_match 'libstatic_a-static123.$(OBJEXT)'
173 cat >> Makefile.am <<'END'
174 lib_LTLIBRARIES += libshared1.la
175 libshared1_la_SOURCES = shared1.c
176 libshared1_la_LIBTOOLFLAGS = $(AM_LIBTOOLFLAGS)
179 add_match 'libshared1_la-shared1.lo'
181 cat >> Makefile.am <<'END'
182 lib_LTLIBRARIES += libshared2.la
183 libshared2_la_SOURCES = shared2.cc
184 libshared2_la_CXXFLAGS = $(AM_CXXFLAGS)
187 add_match 'libshared2_la-shared2.lo'
189 cat >> Makefile.am <<'END'
190 bin_PROGRAMS += parse1
191 parse1_SOURCES = parse.y
192 parse1_YFLAGS = $(AM_YFLAGS)
195 add_match 'parse1-parse.c'
197 cat >> Makefile.am <<'END'
198 bin_PROGRAMS += parse2
199 parse2_SOURCES = parse.ypp
200 parse2_YFLAGS = $(AM_YFLAGS)
203 add_match 'parse2-parse.cpp'
205 cat >> Makefile.am <<'END'
206 bin_PROGRAMS += lexer1
207 lexer1_SOURCES = lex.l
208 lexer1_LFLAGS = $(AM_YFLAGS)
211 add_match 'lexer1-lex.c'
213 cat >> Makefile.am <<'END'
214 bin_PROGRAMS += lexer2
215 lexer2_SOURCES = lexer.ll
216 lexer2_LFLAGS = $(AM_YFLAGS)
219 add_match 'lexer2-lexer.cc'
221 # For debugging.
222 cat Makefile.am
224 $AUTOMAKE -a
225 do_check
227 sed '
228 s|^\(.*\)_SOURCES *= *|sub_\1_SOURCES = srcsub/|
229 s|^\(.*\)PROGRAMS *+= *|\1PROGRAMS += sub/|
230 s|^\(.*\)LIBRARIES *+= *|\1LIBRARIES += sub/|
231 s|^\(.*\)FLAGS *=|sub_\1FLAGS =|
232 ' Makefile.am > t
234 cat - t > Makefile.am <<'END'
235 AUTOMAKE_OPTIONS = subdir-objects
238 rm -f t
240 # For debugging.
241 cat Makefile.am
243 $AUTOMAKE
244 do_check