Debian Codegraph @

tools/gnulib/m4/gnulib-comp.m4

raw
1 # DO NOT EDIT! GENERATED AUTOMATICALLY!
2 # Copyright (C) 2002-2024 Free Software Foundation, Inc.
3 #
4 # This file 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 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This file 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.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this file. If not, see <https://www.gnu.org/licenses/>.
16 #
17 # As a special exception to the GNU General Public License,
18 # this file may be distributed as part of a program that
19 # contains a configuration script generated by Autoconf, under
20 # the same distribution terms as the rest of that program.
21 #
22 # Generated by gnulib-tool.
23 #
24 # This file represents the compiled summary of the specification in
25 # gnulib-cache.m4. It lists the computed macro invocations that need
26 # to be invoked from configure.ac.
27 # In projects that use version control, this file can be treated like
28 # other built files.
29
30
31 # This macro should be invoked from ./configure.ac, in the section
32 # "Checks for programs", right after AC_PROG_CC, and certainly before
33 # any checks for libraries, header files, types and library functions.
34 AC_DEFUN([gl_tools_EARLY],
35 [
36 m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
37 m4_pattern_allow([^gl_ES$])dnl a valid locale name
38 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
39 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
40
41 # Pre-early section.
42 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
43 AC_REQUIRE([gl_PROG_AR_RANLIB])
44
45 # Code from module absolute-header:
46 # Code from module alloca-opt:
47 # Code from module assert-h:
48 # Code from module attribute:
49 # Code from module basename-lgpl:
50 # Code from module c99:
51 # Code from module cloexec:
52 # Code from module close:
53 # Code from module double-slash-root:
54 # Code from module dup2:
55 # Code from module errno:
56 # Code from module error:
57 # Code from module error-h:
58 # Code from module extensions:
59 # Code from module extern-inline:
60 # Code from module fcntl:
61 # Code from module fcntl-h:
62 # Code from module fd-hook:
63 # Code from module filename:
64 # Code from module free-posix:
65 # Code from module fstat:
66 # Code from module gen-header:
67 # Code from module getdtablesize:
68 # Code from module getopt-gnu:
69 # Code from module getopt-posix:
70 # Code from module getprogname:
71 # Code from module gettext-h:
72 # Code from module idx:
73 # Code from module include_next:
74 # Code from module inline:
75 # Code from module intprops:
76 # Code from module inttypes-incomplete:
77 # Code from module largefile:
78 AC_REQUIRE([AC_SYS_LARGEFILE])
79 # Code from module limits-h:
80 # Code from module malloc-gnu:
81 # Code from module malloc-posix:
82 # Code from module malloca:
83 # Code from module msvc-inval:
84 # Code from module msvc-nothrow:
85 # Code from module multiarch:
86 # Code from module nocrash:
87 # Code from module open:
88 # Code from module pathmax:
89 # Code from module progname:
90 # Code from module realloc-posix:
91 # Code from module snippet/_Noreturn:
92 # Code from module snippet/arg-nonnull:
93 # Code from module snippet/c++defs:
94 # Code from module snippet/warn-on-use:
95 # Code from module ssize_t:
96 # Code from module stat:
97 # Code from module stat-time:
98 # Code from module std-gnu11:
99 # Code from module stdarg:
100 dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
101 dnl for the builtin va_copy to work. gl_PROG_CC_C99 arranges for this.
102 gl_PROG_CC_C99
103 # Code from module stdbool:
104 # Code from module stdckdint:
105 # Code from module stddef:
106 # Code from module stdint:
107 # Code from module stdio:
108 gl_STDIO_H_EARLY
109 # Code from module stdlib:
110 # Code from module strerror:
111 # Code from module strerror-override:
112 # Code from module string:
113 # Code from module strndup:
114 # Code from module strnlen:
115 # Code from module sys_stat:
116 # Code from module sys_types:
117 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
118 # Code from module time-h:
119 # Code from module unistd:
120 # Code from module unistr/base:
121 # Code from module unistr/u16-mbtoucr:
122 # Code from module unistr/u16-to-u8:
123 # Code from module unistr/u32-to-u8:
124 # Code from module unistr/u8-uctomb:
125 # Code from module unitypes:
126 # Code from module vararrays:
127 # Code from module version-etc:
128 # Code from module wchar:
129 # Code from module xalloc-oversized:
130 ])
131
132 # This macro should be invoked from ./configure.ac, in the section
133 # "Check for header files, types and library functions".
134 AC_DEFUN([gl_tools_INIT],
135 [
136 AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
137 gl_cond_libtool=true
138 gl_m4_base='tools/gnulib/m4'
139 m4_pushdef([AC_LIBOBJ], m4_defn([gl_tools_LIBOBJ]))
140 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_tools_REPLACE_FUNCS]))
141 m4_pushdef([AC_LIBSOURCES], m4_defn([gl_tools_LIBSOURCES]))
142 m4_pushdef([gl_tools_LIBSOURCES_LIST], [])
143 m4_pushdef([gl_tools_LIBSOURCES_DIR], [])
144 m4_pushdef([GL_MACRO_PREFIX], [gl_tools])
145 m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL_GL_TOOLS])
146 gl_COMMON
147 gl_source_base='tools/gnulib'
148 gl_source_base_prefix=
149 gl_FUNC_ALLOCA
150 gl_CONDITIONAL_HEADER([alloca.h])
151 AC_PROG_MKDIR_P
152 gl_ASSERT_H
153 gl_CONDITIONAL_HEADER([assert.h])
154 AC_PROG_MKDIR_P
155 gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
156 gl_FUNC_CLOSE
157 gl_CONDITIONAL([GL_COND_OBJ_CLOSE], [test $REPLACE_CLOSE = 1])
158 gl_UNISTD_MODULE_INDICATOR([close])
159 gl_MODULE_INDICATOR([close])
160 gl_DOUBLE_SLASH_ROOT
161 gl_FUNC_DUP2
162 gl_CONDITIONAL([GL_COND_OBJ_DUP2], [test $REPLACE_DUP2 = 1])
163 AM_COND_IF([GL_COND_OBJ_DUP2], [
164 gl_PREREQ_DUP2
165 ])
166 gl_UNISTD_MODULE_INDICATOR([dup2])
167 gl_HEADER_ERRNO_H
168 gl_CONDITIONAL_HEADER([errno.h])
169 AC_PROG_MKDIR_P
170 AC_REQUIRE([gl_ERROR_H])
171 gl_ERROR
172 gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test $COMPILE_ERROR_C = 1])
173 AM_COND_IF([GL_COND_OBJ_ERROR], [
174 gl_PREREQ_ERROR
175 ])
176 m4_ifdef([AM_XGETTEXT_OPTION],
177 [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
178 AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
179 gl_ERROR_H
180 AC_PROG_MKDIR_P
181 AC_REQUIRE([gl_EXTERN_INLINE])
182 gl_FUNC_FCNTL
183 gl_CONDITIONAL([GL_COND_OBJ_FCNTL],
184 [test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1])
185 gl_FCNTL_MODULE_INDICATOR([fcntl])
186 gl_FCNTL_H
187 gl_FCNTL_H_REQUIRE_DEFAULTS
188 AC_PROG_MKDIR_P
189 gl_FUNC_FREE
190 gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1])
191 AM_COND_IF([GL_COND_OBJ_FREE], [
192 gl_PREREQ_FREE
193 ])
194 gl_STDLIB_MODULE_INDICATOR([free-posix])
195 gl_FUNC_FSTAT
196 gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1])
197 AM_COND_IF([GL_COND_OBJ_FSTAT], [
198 case "$host_os" in
199 mingw* | windows*)
200 AC_LIBOBJ([stat-w32])
201 ;;
202 esac
203 gl_PREREQ_FSTAT
204 ])
205 gl_SYS_STAT_MODULE_INDICATOR([fstat])
206 gl_MODULE_INDICATOR([fstat])
207 gl_FUNC_GETDTABLESIZE
208 gl_CONDITIONAL([GL_COND_OBJ_GETDTABLESIZE],
209 [test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1])
210 AM_COND_IF([GL_COND_OBJ_GETDTABLESIZE], [
211 gl_PREREQ_GETDTABLESIZE
212 ])
213 gl_UNISTD_MODULE_INDICATOR([getdtablesize])
214 gl_FUNC_GETOPT_GNU
215 dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required
216 dnl mechanism), there is no need to do any AC_LIBOBJ or AC_SUBST here; they are
217 dnl done in the getopt-posix module.
218 gl_FUNC_GETOPT_POSIX
219 gl_CONDITIONAL_HEADER([getopt.h])
220 gl_CONDITIONAL_HEADER([getopt-cdefs.h])
221 AC_PROG_MKDIR_P
222 gl_CONDITIONAL([GL_COND_OBJ_GETOPT], [test $REPLACE_GETOPT = 1])
223 AM_COND_IF([GL_COND_OBJ_GETOPT], [
224 dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1.
225 gl_UNISTD_H_REQUIRE_DEFAULTS
226 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1])
227 ])
228 gl_UNISTD_MODULE_INDICATOR([getopt-posix])
229 gl_FUNC_GETPROGNAME
230 gl_CONDITIONAL([GL_COND_OBJ_GETPROGNAME],
231 [test $HAVE_GETPROGNAME = 0 || test $REPLACE_GETPROGNAME = 1])
232 AM_COND_IF([GL_COND_OBJ_GETPROGNAME], [
233 gl_PREREQ_GETPROGNAME
234 ])
235 gl_STDLIB_MODULE_INDICATOR([getprogname])
236 AC_SUBST([LIBINTL])
237 AC_SUBST([LTLIBINTL])
238 gl_INLINE
239 gl_INTTYPES_INCOMPLETE
240 gl_INTTYPES_H_REQUIRE_DEFAULTS
241 AC_PROG_MKDIR_P
242 AC_REQUIRE([gl_LARGEFILE])
243 gl_LIMITS_H
244 gl_CONDITIONAL_HEADER([limits.h])
245 AC_PROG_MKDIR_P
246 gl_FUNC_MALLOC_GNU
247 if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1; then
248 AC_LIBOBJ([malloc])
249 fi
250 gl_STDLIB_MODULE_INDICATOR([malloc-gnu])
251 AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
252 if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
253 AC_LIBOBJ([malloc])
254 fi
255 gl_STDLIB_MODULE_INDICATOR([malloc-posix])
256 gl_MALLOCA
257 AC_REQUIRE([gl_MSVC_INVAL])
258 gl_CONDITIONAL([GL_COND_OBJ_MSVC_INVAL],
259 [test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1])
260 AC_REQUIRE([gl_MSVC_NOTHROW])
261 gl_CONDITIONAL([GL_COND_OBJ_MSVC_NOTHROW],
262 [test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1])
263 gl_MODULE_INDICATOR([msvc-nothrow])
264 gl_MULTIARCH
265 gl_FUNC_OPEN
266 gl_CONDITIONAL([GL_COND_OBJ_OPEN], [test $REPLACE_OPEN = 1])
267 AM_COND_IF([GL_COND_OBJ_OPEN], [
268 gl_PREREQ_OPEN
269 ])
270 gl_FCNTL_MODULE_INDICATOR([open])
271 gl_PATHMAX
272 AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
273 AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
274 gl_FUNC_REALLOC_POSIX
275 if test $REPLACE_REALLOC_FOR_REALLOC_POSIX = 1; then
276 AC_LIBOBJ([realloc])
277 fi
278 gl_STDLIB_MODULE_INDICATOR([realloc-posix])
279 gt_TYPE_SSIZE_T
280 gl_FUNC_STAT
281 gl_CONDITIONAL([GL_COND_OBJ_STAT], [test $REPLACE_STAT = 1])
282 AM_COND_IF([GL_COND_OBJ_STAT], [
283 case "$host_os" in
284 mingw* | windows*)
285 AC_LIBOBJ([stat-w32])
286 ;;
287 esac
288 gl_PREREQ_STAT
289 ])
290 gl_SYS_STAT_MODULE_INDICATOR([stat])
291 gl_MODULE_INDICATOR([stat])
292 gl_STAT_TIME
293 gl_STAT_BIRTHTIME
294 gl_STDARG_H
295 gl_CONDITIONAL_HEADER([stdarg.h])
296 AC_PROG_MKDIR_P
297 gl_C_BOOL
298 AC_CHECK_HEADERS_ONCE([stdckdint.h])
299 if test $ac_cv_header_stdckdint_h = yes; then
300 GL_GENERATE_STDCKDINT_H=false
301 else
302 GL_GENERATE_STDCKDINT_H=true
303 fi
304 gl_CONDITIONAL_HEADER([stdckdint.h])
305 AC_PROG_MKDIR_P
306 gl_STDDEF_H
307 gl_STDDEF_H_REQUIRE_DEFAULTS
308 gl_CONDITIONAL_HEADER([stddef.h])
309 AC_PROG_MKDIR_P
310 gl_STDINT_H
311 gl_CONDITIONAL_HEADER([stdint.h])
312 dnl Because of gl_REPLACE_LIMITS_H:
313 gl_CONDITIONAL_HEADER([limits.h])
314 AC_PROG_MKDIR_P
315 gl_STDIO_H
316 gl_STDIO_H_REQUIRE_DEFAULTS
317 AC_PROG_MKDIR_P
318 gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1])
319 gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1])
320 dnl No need to create extra modules for these functions. Everyone who uses
321 dnl <stdio.h> likely needs them.
322 gl_STDIO_MODULE_INDICATOR([fscanf])
323 gl_MODULE_INDICATOR([fscanf])
324 gl_STDIO_MODULE_INDICATOR([scanf])
325 gl_MODULE_INDICATOR([scanf])
326 gl_STDIO_MODULE_INDICATOR([fgetc])
327 gl_STDIO_MODULE_INDICATOR([getc])
328 gl_STDIO_MODULE_INDICATOR([getchar])
329 gl_STDIO_MODULE_INDICATOR([fgets])
330 gl_STDIO_MODULE_INDICATOR([fread])
331 dnl No need to create extra modules for these functions. Everyone who uses
332 dnl <stdio.h> likely needs them.
333 gl_STDIO_MODULE_INDICATOR([fprintf])
334 gl_STDIO_MODULE_INDICATOR([printf])
335 gl_STDIO_MODULE_INDICATOR([vfprintf])
336 gl_STDIO_MODULE_INDICATOR([vprintf])
337 gl_STDIO_MODULE_INDICATOR([fputc])
338 gl_STDIO_MODULE_INDICATOR([putc])
339 gl_STDIO_MODULE_INDICATOR([putchar])
340 gl_STDIO_MODULE_INDICATOR([fputs])
341 gl_STDIO_MODULE_INDICATOR([puts])
342 gl_STDIO_MODULE_INDICATOR([fwrite])
343 gl_STDLIB_H
344 gl_STDLIB_H_REQUIRE_DEFAULTS
345 AC_PROG_MKDIR_P
346 gl_FUNC_STRERROR
347 gl_CONDITIONAL([GL_COND_OBJ_STRERROR], [test $REPLACE_STRERROR = 1])
348 gl_MODULE_INDICATOR([strerror])
349 gl_STRING_MODULE_INDICATOR([strerror])
350 AC_REQUIRE([gl_HEADER_ERRNO_H])
351 AC_REQUIRE([gl_FUNC_STRERROR_0])
352 gl_CONDITIONAL([GL_COND_OBJ_STRERROR_OVERRIDE],
353 [test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1])
354 AM_COND_IF([GL_COND_OBJ_STRERROR_OVERRIDE], [
355 gl_PREREQ_SYS_H_WINSOCK2
356 ])
357 gl_STRING_H
358 gl_STRING_H_REQUIRE_DEFAULTS
359 AC_PROG_MKDIR_P
360 gl_FUNC_STRNDUP
361 gl_CONDITIONAL([GL_COND_OBJ_STRNDUP],
362 [test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1])
363 gl_STRING_MODULE_INDICATOR([strndup])
364 gl_FUNC_STRNLEN
365 gl_CONDITIONAL([GL_COND_OBJ_STRNLEN],
366 [test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1])
367 AM_COND_IF([GL_COND_OBJ_STRNLEN], [
368 gl_PREREQ_STRNLEN
369 ])
370 gl_STRING_MODULE_INDICATOR([strnlen])
371 gl_SYS_STAT_H
372 gl_SYS_STAT_H_REQUIRE_DEFAULTS
373 AC_PROG_MKDIR_P
374 gl_SYS_TYPES_H
375 gl_SYS_TYPES_H_REQUIRE_DEFAULTS
376 AC_PROG_MKDIR_P
377 gl_TIME_H
378 gl_TIME_H_REQUIRE_DEFAULTS
379 AC_PROG_MKDIR_P
380 gl_UNISTD_H
381 gl_UNISTD_H_REQUIRE_DEFAULTS
382 AC_PROG_MKDIR_P
383 gl_LIBUNISTRING_LIBHEADER([1.2], [unistr.h])
384 AC_PROG_MKDIR_P
385 gl_MODULE_INDICATOR([unistr/u16-mbtoucr])
386 gl_LIBUNISTRING_MODULE([0.9], [unistr/u16-mbtoucr])
387 gl_LIBUNISTRING_MODULE([0.9.3], [unistr/u16-to-u8])
388 gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-to-u8])
389 gl_MODULE_INDICATOR([unistr/u8-uctomb])
390 gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb])
391 gl_LIBUNISTRING_LIBHEADER([0.9.11], [unitypes.h])
392 AC_PROG_MKDIR_P
393 AH_VERBATIM([unitypes_restrict], [
394 /* This definition is a duplicate of the one in unitypes.h.
395 It is here so that we can cope with an older version of unitypes.h
396 that does not contain this definition and that is pre-installed among
397 the public header files. */
398 # if defined __restrict \
399 || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
400 || __clang_major__ >= 3
401 # define _UC_RESTRICT __restrict
402 # elif 199901L <= __STDC_VERSION__ || defined restrict
403 # define _UC_RESTRICT restrict
404 # else
405 # define _UC_RESTRICT
406 # endif
407 ])
408 AC_C_VARARRAYS
409 gl_VERSION_ETC
410 gl_WCHAR_H
411 gl_WCHAR_H_REQUIRE_DEFAULTS
412 AC_PROG_MKDIR_P
413 # End of code from modules
414 m4_ifval(gl_tools_LIBSOURCES_LIST, [
415 m4_syscmd([test ! -d ]m4_defn([gl_tools_LIBSOURCES_DIR])[ ||
416 for gl_file in ]gl_tools_LIBSOURCES_LIST[ ; do
417 if test ! -r ]m4_defn([gl_tools_LIBSOURCES_DIR])[/$gl_file ; then
418 echo "missing file ]m4_defn([gl_tools_LIBSOURCES_DIR])[/$gl_file" >&2
419 exit 1
420 fi
421 done])dnl
422 m4_if(m4_sysval, [0], [],
423 [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
424 ])
425 m4_popdef([GL_MODULE_INDICATOR_PREFIX])
426 m4_popdef([GL_MACRO_PREFIX])
427 m4_popdef([gl_tools_LIBSOURCES_DIR])
428 m4_popdef([gl_tools_LIBSOURCES_LIST])
429 m4_popdef([AC_LIBSOURCES])
430 m4_popdef([AC_REPLACE_FUNCS])
431 m4_popdef([AC_LIBOBJ])
432 AC_CONFIG_COMMANDS_PRE([
433 gl_tools_libobjs=
434 gl_tools_ltlibobjs=
435 gl_tools_libobjdeps=
436 if test -n "$gl_tools_LIBOBJS"; then
437 # Remove the extension.
438 changequote(,)dnl
439 sed_drop_objext='s/\.o$//;s/\.obj$//'
440 sed_dirname1='s,//*,/,g'
441 sed_dirname2='s,\(.\)/$,\1,'
442 sed_dirname3='s,^[^/]*$,.,'
443 sed_dirname4='s,\(.\)/[^/]*$,\1,'
444 sed_basename1='s,.*/,,'
445 changequote([, ])dnl
446 for i in `for i in $gl_tools_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
447 gl_tools_libobjs="$gl_tools_libobjs $i.$ac_objext"
448 gl_tools_ltlibobjs="$gl_tools_ltlibobjs $i.lo"
449 i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
450 i_base=`echo "$i" | sed -e "$sed_basename1"`
451 gl_tools_libobjdeps="$gl_tools_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Plo"
452 done
453 fi
454 AC_SUBST([gl_tools_LIBOBJS], [$gl_tools_libobjs])
455 AC_SUBST([gl_tools_LTLIBOBJS], [$gl_tools_ltlibobjs])
456 AC_SUBST([gl_tools_LIBOBJDEPS], [$gl_tools_libobjdeps])
457 ])
458 gltests_libdeps=
459 gltests_ltlibdeps=
460 m4_pushdef([AC_LIBOBJ], m4_defn([gl_toolstests_LIBOBJ]))
461 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_toolstests_REPLACE_FUNCS]))
462 m4_pushdef([AC_LIBSOURCES], m4_defn([gl_toolstests_LIBSOURCES]))
463 m4_pushdef([gl_toolstests_LIBSOURCES_LIST], [])
464 m4_pushdef([gl_toolstests_LIBSOURCES_DIR], [])
465 m4_pushdef([GL_MACRO_PREFIX], [gl_toolstests])
466 m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL_GL_TOOLS])
467 gl_COMMON
468 gl_source_base='tests'
469 gl_source_base_prefix=
470 changequote(,)dnl
471 gl_toolstests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
472 changequote([, ])dnl
473 AC_SUBST([gl_toolstests_WITNESS])
474 gl_module_indicator_condition=$gl_toolstests_WITNESS
475 m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
476 m4_popdef([gl_MODULE_INDICATOR_CONDITION])
477 m4_ifval(gl_toolstests_LIBSOURCES_LIST, [
478 m4_syscmd([test ! -d ]m4_defn([gl_toolstests_LIBSOURCES_DIR])[ ||
479 for gl_file in ]gl_toolstests_LIBSOURCES_LIST[ ; do
480 if test ! -r ]m4_defn([gl_toolstests_LIBSOURCES_DIR])[/$gl_file ; then
481 echo "missing file ]m4_defn([gl_toolstests_LIBSOURCES_DIR])[/$gl_file" >&2
482 exit 1
483 fi
484 done])dnl
485 m4_if(m4_sysval, [0], [],
486 [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
487 ])
488 m4_popdef([GL_MODULE_INDICATOR_PREFIX])
489 m4_popdef([GL_MACRO_PREFIX])
490 m4_popdef([gl_toolstests_LIBSOURCES_DIR])
491 m4_popdef([gl_toolstests_LIBSOURCES_LIST])
492 m4_popdef([AC_LIBSOURCES])
493 m4_popdef([AC_REPLACE_FUNCS])
494 m4_popdef([AC_LIBOBJ])
495 AC_CONFIG_COMMANDS_PRE([
496 gl_toolstests_libobjs=
497 gl_toolstests_ltlibobjs=
498 gl_toolstests_libobjdeps=
499 if test -n "$gl_toolstests_LIBOBJS"; then
500 # Remove the extension.
501 changequote(,)dnl
502 sed_drop_objext='s/\.o$//;s/\.obj$//'
503 sed_dirname1='s,//*,/,g'
504 sed_dirname2='s,\(.\)/$,\1,'
505 sed_dirname3='s,^[^/]*$,.,'
506 sed_dirname4='s,\(.\)/[^/]*$,\1,'
507 sed_basename1='s,.*/,,'
508 changequote([, ])dnl
509 for i in `for i in $gl_toolstests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
510 gl_toolstests_libobjs="$gl_toolstests_libobjs $i.$ac_objext"
511 gl_toolstests_ltlibobjs="$gl_toolstests_ltlibobjs $i.lo"
512 i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
513 i_base=`echo "$i" | sed -e "$sed_basename1"`
514 gl_toolstests_libobjdeps="$gl_toolstests_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Plo"
515 done
516 fi
517 AC_SUBST([gl_toolstests_LIBOBJS], [$gl_toolstests_libobjs])
518 AC_SUBST([gl_toolstests_LTLIBOBJS], [$gl_toolstests_ltlibobjs])
519 AC_SUBST([gl_toolstests_LIBOBJDEPS], [$gl_toolstests_libobjdeps])
520 ])
521 AC_REQUIRE([gl_CC_GNULIB_WARNINGS])
522 ])
523
524 # Like AC_LIBOBJ, except that the module name goes
525 # into gl_tools_LIBOBJS instead of into LIBOBJS.
526 AC_DEFUN([gl_tools_LIBOBJ], [
527 AS_LITERAL_IF([$1], [gl_tools_LIBSOURCES([$1.c])])dnl
528 gl_tools_LIBOBJS="$gl_tools_LIBOBJS $1.$ac_objext"
529 ])
530
531 # Like AC_REPLACE_FUNCS, except that the module name goes
532 # into gl_tools_LIBOBJS instead of into LIBOBJS.
533 AC_DEFUN([gl_tools_REPLACE_FUNCS], [
534 m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
535 AC_CHECK_FUNCS([$1], , [gl_tools_LIBOBJ($ac_func)])
536 ])
537
538 # Like AC_LIBSOURCES, except the directory where the source file is
539 # expected is derived from the gnulib-tool parameterization,
540 # and alloca is special cased (for the alloca-opt module).
541 # We could also entirely rely on EXTRA_lib..._SOURCES.
542 AC_DEFUN([gl_tools_LIBSOURCES], [
543 m4_foreach([_gl_NAME], [$1], [
544 m4_if(_gl_NAME, [alloca.c], [], [
545 m4_define([gl_tools_LIBSOURCES_DIR], [tools/gnulib])
546 m4_append([gl_tools_LIBSOURCES_LIST], _gl_NAME, [ ])
547 ])
548 ])
549 ])
550
551 # Like AC_LIBOBJ, except that the module name goes
552 # into gl_toolstests_LIBOBJS instead of into LIBOBJS.
553 AC_DEFUN([gl_toolstests_LIBOBJ], [
554 AS_LITERAL_IF([$1], [gl_toolstests_LIBSOURCES([$1.c])])dnl
555 gl_toolstests_LIBOBJS="$gl_toolstests_LIBOBJS $1.$ac_objext"
556 ])
557
558 # Like AC_REPLACE_FUNCS, except that the module name goes
559 # into gl_toolstests_LIBOBJS instead of into LIBOBJS.
560 AC_DEFUN([gl_toolstests_REPLACE_FUNCS], [
561 m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
562 AC_CHECK_FUNCS([$1], , [gl_toolstests_LIBOBJ($ac_func)])
563 ])
564
565 # Like AC_LIBSOURCES, except the directory where the source file is
566 # expected is derived from the gnulib-tool parameterization,
567 # and alloca is special cased (for the alloca-opt module).
568 # We could also entirely rely on EXTRA_lib..._SOURCES.
569 AC_DEFUN([gl_toolstests_LIBSOURCES], [
570 m4_foreach([_gl_NAME], [$1], [
571 m4_if(_gl_NAME, [alloca.c], [], [
572 m4_define([gl_toolstests_LIBSOURCES_DIR], [tests])
573 m4_append([gl_toolstests_LIBSOURCES_LIST], _gl_NAME, [ ])
574 ])
575 ])
576 ])
577
578 # This macro records the list of files which have been installed by
579 # gnulib-tool and may be removed by future gnulib-tool invocations.
580 AC_DEFUN([gl_tools_FILE_LIST], [
581 lib/_Noreturn.h
582 lib/alloca.in.h
583 lib/arg-nonnull.h
584 lib/assert.in.h
585 lib/attribute.h
586 lib/basename-lgpl.c
587 lib/basename-lgpl.h
588 lib/c++defs.h
589 lib/cloexec.c
590 lib/cloexec.h
591 lib/close.c
592 lib/dup2.c
593 lib/errno.in.h
594 lib/error.c
595 lib/error.in.h
596 lib/fcntl.c
597 lib/fcntl.in.h
598 lib/fd-hook.c
599 lib/fd-hook.h
600 lib/filename.h
601 lib/free.c
602 lib/fstat.c
603 lib/getdtablesize.c
604 lib/getopt-cdefs.in.h
605 lib/getopt-core.h
606 lib/getopt-ext.h
607 lib/getopt-pfx-core.h
608 lib/getopt-pfx-ext.h
609 lib/getopt.c
610 lib/getopt.in.h
611 lib/getopt1.c
612 lib/getopt_int.h
613 lib/getprogname.c
614 lib/getprogname.h
615 lib/gettext.h
616 lib/idx.h
617 lib/intprops-internal.h
618 lib/intprops.h
619 lib/inttypes.in.h
620 lib/limits.in.h
621 lib/malloc.c
622 lib/malloca.c
623 lib/malloca.h
624 lib/msvc-inval.c
625 lib/msvc-inval.h
626 lib/msvc-nothrow.c
627 lib/msvc-nothrow.h
628 lib/open.c
629 lib/pathmax.h
630 lib/progname.c
631 lib/progname.h
632 lib/realloc.c
633 lib/stat-time.c
634 lib/stat-time.h
635 lib/stat-w32.c
636 lib/stat-w32.h
637 lib/stat.c
638 lib/stdarg.in.h
639 lib/stdckdint.in.h
640 lib/stddef.in.h
641 lib/stdint.in.h
642 lib/stdio-read.c
643 lib/stdio-write.c
644 lib/stdio.in.h
645 lib/stdlib.in.h
646 lib/strerror-override.c
647 lib/strerror-override.h
648 lib/strerror.c
649 lib/string.in.h
650 lib/strndup.c
651 lib/strnlen.c
652 lib/sys_stat.in.h
653 lib/sys_types.in.h
654 lib/time.in.h
655 lib/unistd.c
656 lib/unistd.in.h
657 lib/unistr.in.h
658 lib/unistr/u16-mbtoucr.c
659 lib/unistr/u16-to-u8.c
660 lib/unistr/u32-to-u8.c
661 lib/unistr/u8-uctomb-aux.c
662 lib/unistr/u8-uctomb.c
663 lib/unitypes.in.h
664 lib/verify.h
665 lib/version-etc.c
666 lib/version-etc.h
667 lib/warn-on-use.h
668 lib/wchar.in.h
669 lib/xalloc-oversized.h
670 m4/00gnulib.m4
671 m4/absolute-header.m4
672 m4/alloca.m4
673 m4/assert_h.m4
674 m4/c-bool.m4
675 m4/close.m4
676 m4/codeset.m4
677 m4/double-slash-root.m4
678 m4/dup2.m4
679 m4/eealloc.m4
680 m4/errno_h.m4
681 m4/error.m4
682 m4/error_h.m4
683 m4/extensions.m4
684 m4/extern-inline.m4
685 m4/fcntl-o.m4
686 m4/fcntl.m4
687 m4/fcntl_h.m4
688 m4/free.m4
689 m4/fstat.m4
690 m4/getdtablesize.m4
691 m4/getopt.m4
692 m4/getprogname.m4
693 m4/gnulib-common.m4
694 m4/include_next.m4
695 m4/inline.m4
696 m4/inttypes.m4
697 m4/largefile.m4
698 m4/libunistring-base.m4
699 m4/limits-h.m4
700 m4/locale-fr.m4
701 m4/malloc.m4
702 m4/malloca.m4
703 m4/mode_t.m4
704 m4/msvc-inval.m4
705 m4/msvc-nothrow.m4
706 m4/multiarch.m4
707 m4/musl.m4
708 m4/nocrash.m4
709 m4/off64_t.m4
710 m4/off_t.m4
711 m4/open-cloexec.m4
712 m4/open-slash.m4
713 m4/open.m4
714 m4/pathmax.m4
715 m4/pid_t.m4
716 m4/realloc.m4
717 m4/ssize_t.m4
718 m4/stat-time.m4
719 m4/stat.m4
720 m4/std-gnu11.m4
721 m4/stdarg.m4
722 m4/stddef_h.m4
723 m4/stdint.m4
724 m4/stdio_h.m4
725 m4/stdlib_h.m4
726 m4/strerror.m4
727 m4/string_h.m4
728 m4/strndup.m4
729 m4/strnlen.m4
730 m4/sys_cdefs_h.m4
731 m4/sys_socket_h.m4
732 m4/sys_stat_h.m4
733 m4/sys_types_h.m4
734 m4/time_h.m4
735 m4/unistd_h.m4
736 m4/vararrays.m4
737 m4/version-etc.m4
738 m4/warn-on-use.m4
739 m4/wchar_h.m4
740 m4/wint_t.m4
741 m4/zzgnulib.m4
742 ])