summaryrefslogtreecommitdiffstats
path: root/gl/m4/gnulib-comp.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/gnulib-comp.m4')
-rw-r--r--gl/m4/gnulib-comp.m4213
1 files changed, 153 insertions, 60 deletions
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index ed4da7d..a17e36a 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -27,78 +27,94 @@ AC_DEFUN([gl_EARLY],
27 AC_REQUIRE([AC_PROG_RANLIB]) 27 AC_REQUIRE([AC_PROG_RANLIB])
28 AC_REQUIRE([AC_GNU_SOURCE]) 28 AC_REQUIRE([AC_GNU_SOURCE])
29 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 29 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
30 AC_REQUIRE([gl_LOCK_EARLY])
31]) 30])
32 31
33# This macro should be invoked from ./configure.in, in the section 32# This macro should be invoked from ./configure.in, in the section
34# "Check for header files, types and library functions". 33# "Check for header files, types and library functions".
35AC_DEFUN([gl_INIT], 34AC_DEFUN([gl_INIT],
36[ 35[
37 m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
38 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
39 m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
40 AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) 36 AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
41 gl_cond_libtool=false 37 gl_cond_libtool=false
42 gl_libdeps= 38 gl_libdeps=
43 gl_ltlibdeps= 39 gl_ltlibdeps=
40 m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
41 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
42 m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
44 gl_source_base='gl' 43 gl_source_base='gl'
45 gl_FUNC_ALLOCA 44 gl_FUNC_ALLOCA
46 gl_HEADER_ARPA_INET 45 gl_HEADER_ARPA_INET
46 AC_PROG_MKDIR_P
47 gl_C_STRTOD 47 gl_C_STRTOD
48 gl_CLOEXEC 48 gl_CLOEXEC
49 gl_DIRNAME 49 gl_DIRNAME
50 gl_DOUBLE_SLASH_ROOT 50 gl_DOUBLE_SLASH_ROOT
51 gl_ERROR 51 gl_ERROR
52 m4_ifdef([AM_XGETTEXT_OPTION],
53 [AM_XGETTEXT_OPTION([--flag=error:3:c-format])
54 AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
52 gl_EXITFAIL 55 gl_EXITFAIL
53 dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac.
54 gl_FCNTL_SAFER 56 gl_FCNTL_SAFER
55 gl_MODULE_INDICATOR([fcntl-safer]) 57 gl_MODULE_INDICATOR([fcntl-safer])
58 gl_FLOAT_H
56 gl_FSUSAGE 59 gl_FSUSAGE
57 gl_GETADDRINFO 60 gl_GETADDRINFO
58 gl_FUNC_GETHOSTNAME 61 gl_FUNC_GETHOSTNAME
59 gl_GETLOADAVG([$gl_source_base]) 62 gl_GETLOADAVG([$gl_source_base])
60 gl_GETOPT 63 gl_GETOPT
61 dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. 64 dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
62 AM_GNU_GETTEXT_VERSION([0.15]) 65 AM_GNU_GETTEXT_VERSION([0.17])
66 AC_SUBST([LIBINTL])
67 AC_SUBST([LTLIBINTL])
63 gl_INET_NTOP 68 gl_INET_NTOP
64 gl_INLINE 69 gl_INLINE
70 gl_LOCALCHARSET
71 LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
72 AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
65 AC_FUNC_MALLOC 73 AC_FUNC_MALLOC
66 gl_MBCHAR 74 AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.])
67 gl_MBITER 75 gl_FUNC_MALLOC_POSIX
68 gl_FUNC_MEMCHR 76 gl_STDLIB_MODULE_INDICATOR([malloc-posix])
69 gl_MINMAX
70 gl_MOUNTLIST 77 gl_MOUNTLIST
71 gl_HEADER_NETINET_IN 78 gl_HEADER_NETINET_IN
79 AC_PROG_MKDIR_P
72 gl_REGEX 80 gl_REGEX
73 gl_SAFE_READ 81 gl_SAFE_READ
74 gl_SAFE_WRITE 82 gl_SAFE_WRITE
75 gl_SIZE_MAX 83 gl_SIZE_MAX
76 gl_FUNC_SNPRINTF 84 gl_FUNC_SNPRINTF
85 gl_STDIO_MODULE_INDICATOR([snprintf])
77 gl_TYPE_SOCKLEN_T 86 gl_TYPE_SOCKLEN_T
78 gt_TYPE_SSIZE_T 87 gt_TYPE_SSIZE_T
79 AM_STDBOOL_H 88 AM_STDBOOL_H
80 gl_STDINT_H 89 gl_STDINT_H
81 gl_STRCASE 90 gl_STDIO_H
91 gl_STDLIB_H
82 gl_FUNC_STRDUP 92 gl_FUNC_STRDUP
93 gl_STRING_MODULE_INDICATOR([strdup])
94 gl_FUNC_STRERROR
95 gl_STRING_MODULE_INDICATOR([strerror])
96 gl_HEADER_STRING_H
83 gl_FUNC_STRNDUP 97 gl_FUNC_STRNDUP
98 gl_STRING_MODULE_INDICATOR([strndup])
84 gl_FUNC_STRNLEN 99 gl_FUNC_STRNLEN
100 gl_STRING_MODULE_INDICATOR([strnlen])
85 gl_HEADER_SYS_SOCKET 101 gl_HEADER_SYS_SOCKET
86 AC_PROG_MKDIR_P 102 AC_PROG_MKDIR_P
87 gl_HEADER_UNISTD 103 gl_UNISTD_H
88 gl_UNISTD_SAFER 104 gl_UNISTD_SAFER
89 gl_FUNC_VASNPRINTF 105 gl_FUNC_VASNPRINTF
90 gl_FUNC_VASPRINTF 106 gl_FUNC_VASPRINTF
107 gl_STDIO_MODULE_INDICATOR([vasprintf])
108 m4_ifdef([AM_XGETTEXT_OPTION],
109 [AM_XGETTEXT_OPTION([--flag=asprintf:2:c-format])
110 AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
91 gl_FUNC_VSNPRINTF 111 gl_FUNC_VSNPRINTF
112 gl_STDIO_MODULE_INDICATOR([vsnprintf])
92 gl_WCHAR_H 113 gl_WCHAR_H
93 gl_WCTYPE_H 114 gl_WCTYPE_H
94 gl_FUNC_WCWIDTH
95 gl_XALLOC 115 gl_XALLOC
96 gl_XSIZE 116 gl_XSIZE
97 gl_XSTRNDUP 117 gl_XSTRNDUP
98 LIBGNU_LIBDEPS="$gl_libdeps"
99 AC_SUBST([LIBGNU_LIBDEPS])
100 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
101 AC_SUBST([LIBGNU_LTLIBDEPS])
102 m4_popdef([AC_LIBSOURCES]) 118 m4_popdef([AC_LIBSOURCES])
103 m4_popdef([AC_REPLACE_FUNCS]) 119 m4_popdef([AC_REPLACE_FUNCS])
104 m4_popdef([AC_LIBOBJ]) 120 m4_popdef([AC_LIBOBJ])
@@ -116,29 +132,112 @@ AC_DEFUN([gl_INIT],
116 AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) 132 AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
117 AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) 133 AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
118 ]) 134 ])
135 gltests_libdeps=
136 gltests_ltlibdeps=
137 m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
138 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
139 m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
140 gl_source_base='tests'
141 m4_popdef([AC_LIBSOURCES])
142 m4_popdef([AC_REPLACE_FUNCS])
143 m4_popdef([AC_LIBOBJ])
144 AC_CONFIG_COMMANDS_PRE([
145 gltests_libobjs=
146 gltests_ltlibobjs=
147 if test -n "$gltests_LIBOBJS"; then
148 # Remove the extension.
149 sed_drop_objext='s/\.o$//;s/\.obj$//'
150 for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
151 gltests_libobjs="$gltests_libobjs $i.$ac_objext"
152 gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
153 done
154 fi
155 AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
156 AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
157 ])
158 LIBGNU_LIBDEPS="$gl_libdeps"
159 AC_SUBST([LIBGNU_LIBDEPS])
160 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
161 AC_SUBST([LIBGNU_LTLIBDEPS])
119]) 162])
120 163
121# Like AC_LIBOBJ, except that the module name goes 164# Like AC_LIBOBJ, except that the module name goes
122# into gl_LIBOBJS instead of into LIBOBJS. 165# into gl_LIBOBJS instead of into LIBOBJS.
123AC_DEFUN([gl_LIBOBJ], 166AC_DEFUN([gl_LIBOBJ], [
124 [gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"]) 167 AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
168 gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
169])
170
171# m4_foreach_w is provided by autoconf-2.59c and later.
172# This definition is to accommodate developers using versions
173# of autoconf older than that.
174m4_ifndef([m4_foreach_w],
175 [m4_define([m4_foreach_w],
176 [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
125 177
126# Like AC_REPLACE_FUNCS, except that the module name goes 178# Like AC_REPLACE_FUNCS, except that the module name goes
127# into gl_LIBOBJS instead of into LIBOBJS. 179# into gl_LIBOBJS instead of into LIBOBJS.
128AC_DEFUN([gl_REPLACE_FUNCS], 180AC_DEFUN([gl_REPLACE_FUNCS], [
129 [AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])]) 181 m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
182 AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
183])
184
185# Like AC_LIBSOURCES, except the directory where the source file is
186# expected is derived from the gnulib-tool parametrization,
187# and alloca is special cased (for the alloca-opt module).
188# We could also entirely rely on EXTRA_lib..._SOURCES.
189AC_DEFUN([gl_LIBSOURCES], [
190 m4_foreach([_gl_NAME], [$1], [
191 m4_if(_gl_NAME, [alloca.c], [], [
192 m4_syscmd([test -r gl/]_gl_NAME[ || test ! -d gl])dnl
193 m4_if(m4_sysval, [0], [],
194 [AC_FATAL([missing gl/]_gl_NAME)])
195 ])
196 ])
197])
198
199# Like AC_LIBOBJ, except that the module name goes
200# into gltests_LIBOBJS instead of into LIBOBJS.
201AC_DEFUN([gltests_LIBOBJ], [
202 AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
203 gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
204])
205
206# m4_foreach_w is provided by autoconf-2.59c and later.
207# This definition is to accommodate developers using versions
208# of autoconf older than that.
209m4_ifndef([m4_foreach_w],
210 [m4_define([m4_foreach_w],
211 [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
130 212
131# Like AC_LIBSOURCES, except that it does nothing. 213# Like AC_REPLACE_FUNCS, except that the module name goes
132# We rely on EXTRA_lib..._SOURCES instead. 214# into gltests_LIBOBJS instead of into LIBOBJS.
133AC_DEFUN([gl_LIBSOURCES], 215AC_DEFUN([gltests_REPLACE_FUNCS], [
134 []) 216 m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
217 AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
218])
219
220# Like AC_LIBSOURCES, except the directory where the source file is
221# expected is derived from the gnulib-tool parametrization,
222# and alloca is special cased (for the alloca-opt module).
223# We could also entirely rely on EXTRA_lib..._SOURCES.
224AC_DEFUN([gltests_LIBSOURCES], [
225 m4_foreach([_gl_NAME], [$1], [
226 m4_if(_gl_NAME, [alloca.c], [], [
227 m4_syscmd([test -r tests/]_gl_NAME[ || test ! -d tests])dnl
228 m4_if(m4_sysval, [0], [],
229 [AC_FATAL([missing tests/]_gl_NAME)])
230 ])
231 ])
232])
135 233
136# This macro records the list of files which have been installed by 234# This macro records the list of files which have been installed by
137# gnulib-tool and may be removed by future gnulib-tool invocations. 235# gnulib-tool and may be removed by future gnulib-tool invocations.
138AC_DEFUN([gl_FILE_LIST], [ 236AC_DEFUN([gl_FILE_LIST], [
139 build-aux/config.rpath 237 build-aux/config.rpath
238 build-aux/link-warning.h
140 lib/alloca.c 239 lib/alloca.c
141 lib/alloca_.h 240 lib/alloca.in.h
142 lib/asnprintf.c 241 lib/asnprintf.c
143 lib/asprintf.c 242 lib/asprintf.c
144 lib/basename.c 243 lib/basename.c
@@ -146,18 +245,20 @@ AC_DEFUN([gl_FILE_LIST], [
146 lib/c-strtod.h 245 lib/c-strtod.h
147 lib/cloexec.c 246 lib/cloexec.c
148 lib/cloexec.h 247 lib/cloexec.h
248 lib/config.charset
149 lib/creat-safer.c 249 lib/creat-safer.c
150 lib/dirname.c 250 lib/dirname.c
151 lib/dirname.h 251 lib/dirname.h
152 lib/dup-safer.c 252 lib/dup-safer.c
153 lib/error.c 253 lib/error.c
154 lib/error.h 254 lib/error.h
155 lib/exit.h
156 lib/exitfail.c 255 lib/exitfail.c
157 lib/exitfail.h 256 lib/exitfail.h
158 lib/fcntl--.h 257 lib/fcntl--.h
159 lib/fcntl-safer.h 258 lib/fcntl-safer.h
160 lib/fd-safer.c 259 lib/fd-safer.c
260 lib/float+.h
261 lib/float.in.h
161 lib/fsusage.c 262 lib/fsusage.c
162 lib/fsusage.h 263 lib/fsusage.h
163 lib/full-read.c 264 lib/full-read.c
@@ -170,27 +271,27 @@ AC_DEFUN([gl_FILE_LIST], [
170 lib/gethostname.c 271 lib/gethostname.c
171 lib/getloadavg.c 272 lib/getloadavg.c
172 lib/getopt.c 273 lib/getopt.c
274 lib/getopt.in.h
173 lib/getopt1.c 275 lib/getopt1.c
174 lib/getopt_.h
175 lib/getopt_int.h 276 lib/getopt_int.h
176 lib/gettext.h 277 lib/gettext.h
177 lib/inet_ntop.c 278 lib/inet_ntop.c
178 lib/inet_ntop.h 279 lib/inet_ntop.h
179 lib/intprops.h 280 lib/intprops.h
281 lib/localcharset.c
282 lib/localcharset.h
180 lib/malloc.c 283 lib/malloc.c
181 lib/mbchar.c
182 lib/mbchar.h
183 lib/mbuiter.h
184 lib/memchr.c
185 lib/minmax.h
186 lib/mountlist.c 284 lib/mountlist.c
187 lib/mountlist.h 285 lib/mountlist.h
286 lib/netinet_in.in.h
188 lib/open-safer.c 287 lib/open-safer.c
189 lib/pipe-safer.c 288 lib/pipe-safer.c
190 lib/printf-args.c 289 lib/printf-args.c
191 lib/printf-args.h 290 lib/printf-args.h
192 lib/printf-parse.c 291 lib/printf-parse.c
193 lib/printf-parse.h 292 lib/printf-parse.h
293 lib/ref-add.sin
294 lib/ref-del.sin
194 lib/regcomp.c 295 lib/regcomp.c
195 lib/regex.c 296 lib/regex.c
196 lib/regex.h 297 lib/regex.h
@@ -203,34 +304,26 @@ AC_DEFUN([gl_FILE_LIST], [
203 lib/safe-write.h 304 lib/safe-write.h
204 lib/size_max.h 305 lib/size_max.h
205 lib/snprintf.c 306 lib/snprintf.c
206 lib/snprintf.h 307 lib/stdbool.in.h
207 lib/socket_.h 308 lib/stdint.in.h
208 lib/stdbool_.h 309 lib/stdio.in.h
209 lib/stdint_.h 310 lib/stdlib.in.h
210 lib/strcase.h
211 lib/strcasecmp.c
212 lib/strdup.c 311 lib/strdup.c
213 lib/strdup.h 312 lib/strerror.c
313 lib/string.in.h
214 lib/stripslash.c 314 lib/stripslash.c
215 lib/strncasecmp.c
216 lib/strndup.c 315 lib/strndup.c
217 lib/strndup.h
218 lib/strnlen.c 316 lib/strnlen.c
219 lib/strnlen.h 317 lib/sys_socket.in.h
220 lib/strnlen1.c
221 lib/strnlen1.h
222 lib/unistd--.h 318 lib/unistd--.h
223 lib/unistd-safer.h 319 lib/unistd-safer.h
224 lib/unistd_.h 320 lib/unistd.in.h
225 lib/vasnprintf.c 321 lib/vasnprintf.c
226 lib/vasnprintf.h 322 lib/vasnprintf.h
227 lib/vasprintf.c 323 lib/vasprintf.c
228 lib/vasprintf.h
229 lib/vsnprintf.c 324 lib/vsnprintf.c
230 lib/vsnprintf.h 325 lib/wchar.in.h
231 lib/wchar_.h 326 lib/wctype.in.h
232 lib/wctype_.h
233 lib/wcwidth.h
234 lib/xalloc-die.c 327 lib/xalloc-die.c
235 lib/xalloc.h 328 lib/xalloc.h
236 lib/xmalloc.c 329 lib/xmalloc.c
@@ -251,6 +344,7 @@ AC_DEFUN([gl_FILE_LIST], [
251 m4/exitfail.m4 344 m4/exitfail.m4
252 m4/extensions.m4 345 m4/extensions.m4
253 m4/fcntl-safer.m4 346 m4/fcntl-safer.m4
347 m4/float_h.m4
254 m4/fstypename.m4 348 m4/fstypename.m4
255 m4/fsusage.m4 349 m4/fsusage.m4
256 m4/getaddrinfo.m4 350 m4/getaddrinfo.m4
@@ -262,11 +356,13 @@ AC_DEFUN([gl_FILE_LIST], [
262 m4/glibc21.m4 356 m4/glibc21.m4
263 m4/gnulib-common.m4 357 m4/gnulib-common.m4
264 m4/iconv.m4 358 m4/iconv.m4
359 m4/include_next.m4
265 m4/inet_ntop.m4 360 m4/inet_ntop.m4
266 m4/inline.m4 361 m4/inline.m4
267 m4/intdiv0.m4 362 m4/intdiv0.m4
268 m4/intl.m4 363 m4/intl.m4
269 m4/intldir.m4 364 m4/intldir.m4
365 m4/intlmacosx.m4
270 m4/intmax.m4 366 m4/intmax.m4
271 m4/intmax_t.m4 367 m4/intmax_t.m4
272 m4/inttypes-pri.m4 368 m4/inttypes-pri.m4
@@ -275,15 +371,11 @@ AC_DEFUN([gl_FILE_LIST], [
275 m4/lib-ld.m4 371 m4/lib-ld.m4
276 m4/lib-link.m4 372 m4/lib-link.m4
277 m4/lib-prefix.m4 373 m4/lib-prefix.m4
374 m4/localcharset.m4
278 m4/lock.m4 375 m4/lock.m4
279 m4/longdouble.m4
280 m4/longlong.m4 376 m4/longlong.m4
281 m4/ls-mntd-fs.m4 377 m4/ls-mntd-fs.m4
282 m4/mbchar.m4 378 m4/malloc.m4
283 m4/mbiter.m4
284 m4/mbrtowc.m4
285 m4/memchr.m4
286 m4/minmax.m4
287 m4/mountlist.m4 379 m4/mountlist.m4
288 m4/netinet_in_h.m4 380 m4/netinet_in_h.m4
289 m4/nls.m4 381 m4/nls.m4
@@ -302,13 +394,15 @@ AC_DEFUN([gl_FILE_LIST], [
302 m4/stdbool.m4 394 m4/stdbool.m4
303 m4/stdint.m4 395 m4/stdint.m4
304 m4/stdint_h.m4 396 m4/stdint_h.m4
305 m4/strcase.m4 397 m4/stdio_h.m4
398 m4/stdlib_h.m4
306 m4/strdup.m4 399 m4/strdup.m4
400 m4/strerror.m4
401 m4/string_h.m4
307 m4/strndup.m4 402 m4/strndup.m4
308 m4/strnlen.m4 403 m4/strnlen.m4
309 m4/sys_socket_h.m4 404 m4/sys_socket_h.m4
310 m4/uintmax_t.m4 405 m4/uintmax_t.m4
311 m4/ulonglong.m4
312 m4/unistd-safer.m4 406 m4/unistd-safer.m4
313 m4/unistd_h.m4 407 m4/unistd_h.m4
314 m4/vasnprintf.m4 408 m4/vasnprintf.m4
@@ -318,7 +412,6 @@ AC_DEFUN([gl_FILE_LIST], [
318 m4/wchar.m4 412 m4/wchar.m4
319 m4/wchar_t.m4 413 m4/wchar_t.m4
320 m4/wctype.m4 414 m4/wctype.m4
321 m4/wcwidth.m4
322 m4/wint_t.m4 415 m4/wint_t.m4
323 m4/xalloc.m4 416 m4/xalloc.m4
324 m4/xsize.m4 417 m4/xsize.m4