Debian Codegraph @

etc/autoconf.cook

raw
1 /*
2 * fstrcmp - fuzzy string compare library
3 * Copyright (C) 2009, 2012, 2014 Peter Miller
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 if [not [defined autoconf]] then
20 autoconf = autoconf;
21 if [not [autoconf]] then
22 autoconf = autoconf;
23
24 if [not [defined autoheader]] then
25 autoheader = autoheader;
26 if [not [autoheader]] then
27 autoheader = autoheader;
28
29 bin/%: script/%.sh.in: config.status
30 set shallow
31 single-thread conftest.subs
32 {
33 if [not [exists script]] then
34 mkdir script
35 set clearstat;
36 /* these 2 env vars control what is generated */
37 CONFIG_FILES\=[target]\:[resolve script/%.sh.in] CONFIG_HEADERS\=
38 sh [resolve config.status];
39 chmod 755 [target];
40 }
41
42 /*
43 * The configured files are generated using the config.status script
44 * output by the configure script. Not all of them are essential to a
45 * build, or are already taken care of, and some are not meaningful.
46 */
47 configured_files1 =
48 [match_mask script/%.in [source_files]]
49 ;
50 configured_files2 =
51 [stringset
52 [match_mask %0%.in [source_files]]
53 -
54 [configured_files1]
55 ];
56 configured_files =
57 [fromto script/%.in bin/% [configured_files1]]
58 [fromto %0%.in %0% [configured_files2]]
59 ;
60 configured_files =
61 [stringset
62 [configured_files]
63 -
64 Makefile /* only for integration builds */
65 lib/config.h
66 etc/configure
67 ];
68 configured_files: [configured_files];
69
70 configure: configure.ac install-sh config.guess config.sub
71 {
72 /*
73 * unfortunately,
74 * install-sh must be in the current directory
75 */
76 if [not [exists install-sh]] then
77 ln -s [resolve install-sh] install-sh
78 set clearstat;
79 if [not [exists config.guess]] then
80 ln -s [resolve config.guess] config.guess
81 set clearstat;
82 if [not [exists config.sub]] then
83 ln -s [resolve config.sub] config.sub
84 set clearstat;
85 [autoconf] [resolve configure.ac] > [target];
86 chmod 755 [target];
87 }
88
89 /*
90 * The install-sh script can come from a huge range of places, depending
91 * on what distribution you have installed (or whether you built it from
92 * the tarball).
93 *
94 * Setting the install-sh variable make cook print the intended error
95 * message instead of a syntax error when the install-sh script does not
96 * exist.
97 */
98 install-sh = ;
99 loop install-sh-maybe =
100 /usr/share/autoconf/install-sh
101 [glob /usr/share/automake*/install-sh]
102 [glob /usr/local/share/autoconf*/install-sh]
103 [glob /usr/local/share/automake*/install-sh]
104 {
105 if [exists [install-sh-maybe]] then
106 {
107 install-sh = [install-sh-maybe];
108 loopstop;
109 }
110 }
111 if [not [install-sh]] then
112 fail "Can't locate the \"install-sh\" script from GNU automake";
113
114 install-sh: [install-sh]
115 {
116 cp [need] [target];
117 chmod 755 [target];
118 }
119
120 config.sub = ;
121 loop config.sub-maybe =
122 /usr/share/autoconf/config.sub
123 /usr/share/automake/config.sub
124 [glob /usr/share/automake*/config.sub]
125 [glob /usr/local/share/autoconf*/config.sub]
126 [glob /usr/local/share/automake*/config.sub]
127 {
128 if [exists [config.sub-maybe]] then
129 {
130 config.sub = [config.sub-maybe];
131 loopstop;
132 }
133 }
134 if [not [config.sub]] then
135 fail "Can't locate the \"config.sub\" script from GNU autoconf";
136
137 config.sub: [config.sub]
138 {
139 cp [need] [target];
140 chmod 755 [target];
141 }
142
143 config.guess = ;
144 loop config.guess-maybe =
145 /usr/share/autoconf/config.guess
146 /usr/share/automake/config.guess
147 [glob /usr/share/automake*/config.guess]
148 [glob /usr/local/share/autoconf*/config.guess]
149 [glob /usr/local/share/automake*/config.guess]
150 {
151 if [exists [config.guess-maybe]] then
152 {
153 config.guess = [config.guess-maybe];
154 loopstop;
155 }
156 }
157 if [not [config.guess]] then
158 fail "Can't locate the \"config.guess\" script from GNU autoconf";
159
160 config.guess: [config.guess]
161 {
162 cp [need] [target];
163 chmod 755 [target];
164 }
165
166 config.status: configure install-sh config.sub config.guess
167 {
168 if [not [exists install-sh]] then
169 ln -s [resolve install-sh] install-sh
170 set clearstat;
171
172 if [not [exists config.sub]] then
173 ln -s [resolve config.sub] config.sub
174 set clearstat;
175
176 if [not [exists config.guess]] then
177 ln -s [resolve config.guess] config.guess
178 set clearstat;
179
180 local flags =;
181 if [defined c++_flags] then
182 {
183 flags += CXXFLAGS\=[quote
184 [unsplit " " [filter_out "-Werror" [split "%" [c++_flags]]]]];
185 }
186
187 if [defined ld_flags] then
188 {
189 flags += LDFLAGS\=[quote [unsplit " " [split "%" [ld_flags]]]];
190 }
191
192 if [defined libs] then
193 {
194 flags += LIBS\=[quote [unsplit " " [split "%" [libs]]]];
195 }
196
197 CC\=[quote [unsplit " " [CC]]]
198 [flags]
199
200 [pathname [resolve configure]] --cache-file\=/dev/null --verbose
201 --no-create --srcdir\=. --sysconfdir\=/etc
202 ;
203 }
204
205 lib/config.h.in: configure.ac
206 {
207 [autoheader] [resolve configure.ac] > [target];
208 }
209
210
211 %0%.h: %0%.h.in config.status
212 single-thread conftest.subs
213 {
214 if [not [exists [dirname %0%.h]]] then
215 mkdir [dirname %0%.h]
216 set clearstat;
217 /* these 2 env vars control what is generated */
218 CONFIG_FILES\= CONFIG_HEADERS\=[target]\:[resolve %0%.h.in]
219 sh [resolve config.status];
220 }
221
222 %0%: %0%.in config.status
223 set ['if' [not [defined baseline]] 'then' shallow]
224 single-thread conftest.subs
225 {
226 if [not [exists [dirname %0%]]] then
227 mkdir [dirname %0%]
228 set clearstat;
229 /* these 2 env vars control what is generated */
230 CONFIG_FILES\=[target]\:[resolve %0%.in] CONFIG_HEADERS\=
231 sh [resolve config.status];
232
233 /*
234 * Make shell scripts and CGI scripts executable.
235 */
236 if [or [matches %%.cgi %] [matches %%.sh %]] then
237 chmod a+rx [target];
238 }