Debian Codegraph @

aclocal.m4

raw
1 # generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2
3 # Copyright (C) 1996-2021 Free Software Foundation, Inc.
4
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 m4_ifndef([AC_AUTOCONF_VERSION],
16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
18 [m4_warning([this file was generated for autoconf 2.71.
19 You have another version of autoconf. It may work, but is not guaranteed to.
20 If you have problems, you may need to regenerate the build system entirely.
21 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22
23 # ===========================================================================
24 # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
25 # ===========================================================================
26 #
27 # SYNOPSIS
28 #
29 # AX_REQUIRE_DEFINED(MACRO)
30 #
31 # DESCRIPTION
32 #
33 # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
34 # been defined and thus are available for use. This avoids random issues
35 # where a macro isn't expanded. Instead the configure script emits a
36 # non-fatal:
37 #
38 # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
39 #
40 # It's like AC_REQUIRE except it doesn't expand the required macro.
41 #
42 # Here's an example:
43 #
44 # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
45 #
46 # LICENSE
47 #
48 # Copyright (c) 2014 Mike Frysinger <[email protected]>
49 #
50 # Copying and distribution of this file, with or without modification, are
51 # permitted in any medium without royalty provided the copyright notice
52 # and this notice are preserved. This file is offered as-is, without any
53 # warranty.
54
55 #serial 2
56
57 AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
58 m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
59 ])dnl AX_REQUIRE_DEFINED
60
61 # gettext.m4 serial 75 (gettext-0.21.1)
62 dnl Copyright (C) 1995-2014, 2016, 2018-2021 Free Software Foundation, Inc.
63 dnl This file is free software; the Free Software Foundation
64 dnl gives unlimited permission to copy and/or distribute it,
65 dnl with or without modifications, as long as this notice is preserved.
66 dnl
67 dnl This file can be used in projects which are not available under
68 dnl the GNU General Public License or the GNU Lesser General Public
69 dnl License but which still want to provide support for the GNU gettext
70 dnl functionality.
71 dnl Please note that the actual code of the GNU gettext library is covered
72 dnl by the GNU Lesser General Public License, and the rest of the GNU
73 dnl gettext package is covered by the GNU General Public License.
74 dnl They are *not* in the public domain.
75
76 dnl Authors:
77 dnl Ulrich Drepper <[email protected]>, 1995-2000.
78 dnl Bruno Haible <[email protected]>, 2000-2006, 2008-2010.
79
80 dnl Macro to add for using GNU gettext.
81
82 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
83 dnl INTLSYMBOL must be one of 'external', 'use-libtool', 'here'.
84 dnl INTLSYMBOL should be 'external' for packages other than GNU gettext.
85 dnl It should be 'use-libtool' for the packages 'gettext-runtime' and
86 dnl 'gettext-tools'.
87 dnl It should be 'here' for the package 'gettext-runtime/intl'.
88 dnl If INTLSYMBOL is 'here', then a libtool library
89 dnl $(top_builddir)/libintl.la will be created (shared and/or static,
90 dnl depending on --{enable,disable}-{shared,static} and on the presence of
91 dnl AM-DISABLE-SHARED).
92 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
93 dnl implementations (in libc or libintl) without the ngettext() function
94 dnl will be ignored. If NEEDSYMBOL is specified and is
95 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
96 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
97 dnl INTLDIR is used to find the intl libraries. If empty,
98 dnl the value '$(top_builddir)/intl/' is used.
99 dnl
100 dnl The result of the configuration is one of three cases:
101 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
102 dnl and used.
103 dnl Catalog format: GNU --> install in $(datadir)
104 dnl Catalog extension: .mo after installation, .gmo in source tree
105 dnl 2) GNU gettext has been found in the system's C library.
106 dnl Catalog format: GNU --> install in $(datadir)
107 dnl Catalog extension: .mo after installation, .gmo in source tree
108 dnl 3) No internationalization, always use English msgid.
109 dnl Catalog format: none
110 dnl Catalog extension: none
111 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
112 dnl The use of .gmo is historical (it was needed to avoid overwriting the
113 dnl GNU format catalogs when building on a platform with an X/Open gettext),
114 dnl but we keep it in order not to force irrelevant filename changes on the
115 dnl maintainers.
116 dnl
117 AC_DEFUN([AM_GNU_GETTEXT],
118 [
119 dnl Argument checking.
120 m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], , [m4_if([$1], [here], ,
121 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
122 ])])])])])
123 m4_if(m4_if([$1], [], [old])[]m4_if([$1], [no-libtool], [old]), [old],
124 [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
125 ])])
126 m4_if([$2], [], , [m4_if([$2], [need-ngettext], , [m4_if([$2], [need-formatstring-macros], ,
127 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
128 ])])])])
129 define([gt_building_libintl_in_same_build_tree],
130 m4_if([$1], [use-libtool], [yes], [m4_if([$1], [here], [yes], [no])]))
131 gt_NEEDS_INIT
132 AM_GNU_GETTEXT_NEED([$2])
133
134 AC_REQUIRE([AM_PO_SUBDIRS])dnl
135
136 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
137 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
138 AC_REQUIRE([AC_LIB_RPATH])
139
140 dnl Sometimes libintl requires libiconv, so first search for libiconv.
141 dnl Ideally we would do this search only after the
142 dnl if test "$USE_NLS" = "yes"; then
143 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
144 dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT
145 dnl the configure script would need to contain the same shell code
146 dnl again, outside any 'if'. There are two solutions:
147 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
148 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
149 dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
150 m4_if(gt_building_libintl_in_same_build_tree, yes, , [
151 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
152 ])
153
154 dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
155 gt_INTL_MACOSX
156
157 dnl Set USE_NLS.
158 AC_REQUIRE([AM_NLS])
159
160 m4_if(gt_building_libintl_in_same_build_tree, yes, [
161 USE_INCLUDED_LIBINTL=no
162 ])
163 LIBINTL=
164 LTLIBINTL=
165 POSUB=
166
167 dnl Add a version number to the cache macros.
168 case " $gt_needs " in
169 *" need-formatstring-macros "*) gt_api_version=3 ;;
170 *" need-ngettext "*) gt_api_version=2 ;;
171 *) gt_api_version=1 ;;
172 esac
173 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
174 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
175
176 dnl If we use NLS figure out what method
177 if test "$USE_NLS" = "yes"; then
178 gt_use_preinstalled_gnugettext=no
179 m4_if(gt_building_libintl_in_same_build_tree, yes, [
180 AC_MSG_CHECKING([whether included gettext is requested])
181 AC_ARG_WITH([included-gettext],
182 [ --with-included-gettext use the GNU gettext library included here],
183 nls_cv_force_use_gnu_gettext=$withval,
184 nls_cv_force_use_gnu_gettext=no)
185 AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
186
187 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
188 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
189 ])
190 dnl User does not insist on using GNU NLS library. Figure out what
191 dnl to use. If GNU gettext is available we use this. Else we have
192 dnl to fall back to GNU NLS library.
193
194 if test $gt_api_version -ge 3; then
195 gt_revision_test_code='
196 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
197 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
198 #endif
199 changequote(,)dnl
200 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
201 changequote([,])dnl
202 '
203 else
204 gt_revision_test_code=
205 fi
206 if test $gt_api_version -ge 2; then
207 gt_expression_test_code=' + * ngettext ("", "", 0)'
208 else
209 gt_expression_test_code=
210 fi
211
212 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
213 [AC_LINK_IFELSE(
214 [AC_LANG_PROGRAM(
215 [[
216 #include <libintl.h>
217 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
218 extern int _nl_msg_cat_cntr;
219 extern int *_nl_domain_bindings;
220 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
221 #else
222 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
223 #endif
224 $gt_revision_test_code
225 ]],
226 [[
227 bindtextdomain ("", "");
228 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
229 ]])],
230 [eval "$gt_func_gnugettext_libc=yes"],
231 [eval "$gt_func_gnugettext_libc=no"])])
232
233 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
234 dnl Sometimes libintl requires libiconv, so first search for libiconv.
235 m4_if(gt_building_libintl_in_same_build_tree, yes, , [
236 AM_ICONV_LINK
237 ])
238 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
239 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
240 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
241 dnl even if libiconv doesn't exist.
242 AC_LIB_LINKFLAGS_BODY([intl])
243 AC_CACHE_CHECK([for GNU gettext in libintl],
244 [$gt_func_gnugettext_libintl],
245 [gt_save_CPPFLAGS="$CPPFLAGS"
246 CPPFLAGS="$CPPFLAGS $INCINTL"
247 gt_save_LIBS="$LIBS"
248 LIBS="$LIBS $LIBINTL"
249 dnl Now see whether libintl exists and does not depend on libiconv.
250 AC_LINK_IFELSE(
251 [AC_LANG_PROGRAM(
252 [[
253 #include <libintl.h>
254 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
255 extern int _nl_msg_cat_cntr;
256 extern
257 #ifdef __cplusplus
258 "C"
259 #endif
260 const char *_nl_expand_alias (const char *);
261 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
262 #else
263 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
264 #endif
265 $gt_revision_test_code
266 ]],
267 [[
268 bindtextdomain ("", "");
269 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
270 ]])],
271 [eval "$gt_func_gnugettext_libintl=yes"],
272 [eval "$gt_func_gnugettext_libintl=no"])
273 dnl Now see whether libintl exists and depends on libiconv.
274 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
275 LIBS="$LIBS $LIBICONV"
276 AC_LINK_IFELSE(
277 [AC_LANG_PROGRAM(
278 [[
279 #include <libintl.h>
280 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
281 extern int _nl_msg_cat_cntr;
282 extern
283 #ifdef __cplusplus
284 "C"
285 #endif
286 const char *_nl_expand_alias (const char *);
287 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
288 #else
289 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
290 #endif
291 $gt_revision_test_code
292 ]],
293 [[
294 bindtextdomain ("", "");
295 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
296 ]])],
297 [LIBINTL="$LIBINTL $LIBICONV"
298 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
299 eval "$gt_func_gnugettext_libintl=yes"
300 ])
301 fi
302 CPPFLAGS="$gt_save_CPPFLAGS"
303 LIBS="$gt_save_LIBS"])
304 fi
305
306 dnl If an already present or preinstalled GNU gettext() is found,
307 dnl use it. But if this macro is used in GNU gettext, and GNU
308 dnl gettext is already preinstalled in libintl, we update this
309 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
310 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
311 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
312 && test "$PACKAGE" != gettext-runtime \
313 && test "$PACKAGE" != gettext-tools \
314 && test "$PACKAGE" != libintl; }; then
315 gt_use_preinstalled_gnugettext=yes
316 else
317 dnl Reset the values set by searching for libintl.
318 LIBINTL=
319 LTLIBINTL=
320 INCINTL=
321 fi
322
323 m4_if(gt_building_libintl_in_same_build_tree, yes, [
324 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
325 dnl GNU gettext is not found in the C library.
326 dnl Fall back on included GNU gettext library.
327 nls_cv_use_gnu_gettext=yes
328 fi
329 fi
330
331 if test "$nls_cv_use_gnu_gettext" = "yes"; then
332 dnl Mark actions used to generate GNU NLS library.
333 USE_INCLUDED_LIBINTL=yes
334 LIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
335 LTLIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
336 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
337 fi
338
339 CATOBJEXT=
340 if test "$gt_use_preinstalled_gnugettext" = "yes" \
341 || test "$nls_cv_use_gnu_gettext" = "yes"; then
342 dnl Mark actions to use GNU gettext tools.
343 CATOBJEXT=.gmo
344 fi
345 ])
346
347 if test -n "$INTL_MACOSX_LIBS"; then
348 if test "$gt_use_preinstalled_gnugettext" = "yes" \
349 || test "$nls_cv_use_gnu_gettext" = "yes"; then
350 dnl Some extra flags are needed during linking.
351 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
352 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
353 fi
354 fi
355
356 if test "$gt_use_preinstalled_gnugettext" = "yes" \
357 || test "$nls_cv_use_gnu_gettext" = "yes"; then
358 AC_DEFINE([ENABLE_NLS], [1],
359 [Define to 1 if translation of program messages to the user's native language
360 is requested.])
361 else
362 USE_NLS=no
363 fi
364 fi
365
366 AC_MSG_CHECKING([whether to use NLS])
367 AC_MSG_RESULT([$USE_NLS])
368 if test "$USE_NLS" = "yes"; then
369 AC_MSG_CHECKING([where the gettext function comes from])
370 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
371 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
372 gt_source="external libintl"
373 else
374 gt_source="libc"
375 fi
376 else
377 gt_source="included intl directory"
378 fi
379 AC_MSG_RESULT([$gt_source])
380 fi
381
382 if test "$USE_NLS" = "yes"; then
383
384 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
385 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
386 AC_MSG_CHECKING([how to link with libintl])
387 AC_MSG_RESULT([$LIBINTL])
388 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
389 fi
390
391 dnl For backward compatibility. Some packages may be using this.
392 AC_DEFINE([HAVE_GETTEXT], [1],
393 [Define if the GNU gettext() function is already present or preinstalled.])
394 AC_DEFINE([HAVE_DCGETTEXT], [1],
395 [Define if the GNU dcgettext() function is already present or preinstalled.])
396 fi
397
398 dnl We need to process the po/ directory.
399 POSUB=po
400 fi
401
402 m4_if(gt_building_libintl_in_same_build_tree, yes, [
403 dnl Make all variables we use known to autoconf.
404 AC_SUBST([USE_INCLUDED_LIBINTL])
405 AC_SUBST([CATOBJEXT])
406 ])
407
408 m4_if(gt_building_libintl_in_same_build_tree, yes, [], [
409 dnl For backward compatibility. Some Makefiles may be using this.
410 INTLLIBS="$LIBINTL"
411 AC_SUBST([INTLLIBS])
412 ])
413
414 dnl Make all documented variables known to autoconf.
415 AC_SUBST([LIBINTL])
416 AC_SUBST([LTLIBINTL])
417 AC_SUBST([POSUB])
418 ])
419
420
421 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
422 m4_define([gt_NEEDS_INIT],
423 [
424 m4_divert_text([DEFAULTS], [gt_needs=])
425 m4_define([gt_NEEDS_INIT], [])
426 ])
427
428
429 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
430 AC_DEFUN([AM_GNU_GETTEXT_NEED],
431 [
432 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
433 ])
434
435
436 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
437 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
438
439
440 dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
441 AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
442
443 # host-cpu-c-abi.m4 serial 15
444 dnl Copyright (C) 2002-2022 Free Software Foundation, Inc.
445 dnl This file is free software; the Free Software Foundation
446 dnl gives unlimited permission to copy and/or distribute it,
447 dnl with or without modifications, as long as this notice is preserved.
448
449 dnl From Bruno Haible and Sam Steingold.
450
451 dnl Sets the HOST_CPU variable to the canonical name of the CPU.
452 dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
453 dnl C language ABI (application binary interface).
454 dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
455 dnl config.h.
456 dnl
457 dnl This canonical name can be used to select a particular assembly language
458 dnl source file that will interoperate with C code on the given host.
459 dnl
460 dnl For example:
461 dnl * 'i386' and 'sparc' are different canonical names, because code for i386
462 dnl will not run on SPARC CPUs and vice versa. They have different
463 dnl instruction sets.
464 dnl * 'sparc' and 'sparc64' are different canonical names, because code for
465 dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
466 dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
467 dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
468 dnl mode, but not both.
469 dnl * 'mips' and 'mipsn32' are different canonical names, because they use
470 dnl different argument passing and return conventions for C functions, and
471 dnl although the instruction set of 'mips' is a large subset of the
472 dnl instruction set of 'mipsn32'.
473 dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
474 dnl different sizes for the C types like 'int' and 'void *', and although
475 dnl the instruction sets of 'mipsn32' and 'mips64' are the same.
476 dnl * The same canonical name is used for different endiannesses. You can
477 dnl determine the endianness through preprocessor symbols:
478 dnl - 'arm': test __ARMEL__.
479 dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
480 dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
481 dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
482 dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
483 dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
484 dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
485 dnl assembly language source files use such instructions, you will
486 dnl need to make the distinction.
487 dnl - Speed of execution of the common instruction set is reasonable across
488 dnl the entire family of CPUs. If you have assembly language source files
489 dnl that are optimized for particular CPU types (like GNU gmp has), you
490 dnl will need to make the distinction.
491 dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
492 AC_DEFUN([gl_HOST_CPU_C_ABI],
493 [
494 AC_REQUIRE([AC_CANONICAL_HOST])
495 AC_REQUIRE([gl_C_ASM])
496 AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
497 [case "$host_cpu" in
498
499 changequote(,)dnl
500 i[34567]86 )
501 changequote([,])dnl
502 gl_cv_host_cpu_c_abi=i386
503 ;;
504
505 x86_64 )
506 # On x86_64 systems, the C compiler may be generating code in one of
507 # these ABIs:
508 # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
509 # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
510 # with native Windows (mingw, MSVC).
511 # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
512 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
513 AC_COMPILE_IFELSE(
514 [AC_LANG_SOURCE(
515 [[#if (defined __x86_64__ || defined __amd64__ \
516 || defined _M_X64 || defined _M_AMD64)
517 int ok;
518 #else
519 error fail
520 #endif
521 ]])],
522 [AC_COMPILE_IFELSE(
523 [AC_LANG_SOURCE(
524 [[#if defined __ILP32__ || defined _ILP32
525 int ok;
526 #else
527 error fail
528 #endif
529 ]])],
530 [gl_cv_host_cpu_c_abi=x86_64-x32],
531 [gl_cv_host_cpu_c_abi=x86_64])],
532 [gl_cv_host_cpu_c_abi=i386])
533 ;;
534
535 changequote(,)dnl
536 alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
537 changequote([,])dnl
538 gl_cv_host_cpu_c_abi=alpha
539 ;;
540
541 arm* | aarch64 )
542 # Assume arm with EABI.
543 # On arm64 systems, the C compiler may be generating code in one of
544 # these ABIs:
545 # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
546 # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
547 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
548 AC_COMPILE_IFELSE(
549 [AC_LANG_SOURCE(
550 [[#ifdef __aarch64__
551 int ok;
552 #else
553 error fail
554 #endif
555 ]])],
556 [AC_COMPILE_IFELSE(
557 [AC_LANG_SOURCE(
558 [[#if defined __ILP32__ || defined _ILP32
559 int ok;
560 #else
561 error fail
562 #endif
563 ]])],
564 [gl_cv_host_cpu_c_abi=arm64-ilp32],
565 [gl_cv_host_cpu_c_abi=arm64])],
566 [# Don't distinguish little-endian and big-endian arm, since they
567 # don't require different machine code for simple operations and
568 # since the user can distinguish them through the preprocessor
569 # defines __ARMEL__ vs. __ARMEB__.
570 # But distinguish arm which passes floating-point arguments and
571 # return values in integer registers (r0, r1, ...) - this is
572 # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
573 # passes them in float registers (s0, s1, ...) and double registers
574 # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
575 # sets the preprocessor defines __ARM_PCS (for the first case) and
576 # __ARM_PCS_VFP (for the second case), but older GCC does not.
577 echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
578 # Look for a reference to the register d0 in the .s file.
579 AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
580 if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
581 gl_cv_host_cpu_c_abi=armhf
582 else
583 gl_cv_host_cpu_c_abi=arm
584 fi
585 rm -f conftest*
586 ])
587 ;;
588
589 hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
590 # On hppa, the C compiler may be generating 32-bit code or 64-bit
591 # code. In the latter case, it defines _LP64 and __LP64__.
592 AC_COMPILE_IFELSE(
593 [AC_LANG_SOURCE(
594 [[#ifdef __LP64__
595 int ok;
596 #else
597 error fail
598 #endif
599 ]])],
600 [gl_cv_host_cpu_c_abi=hppa64],
601 [gl_cv_host_cpu_c_abi=hppa])
602 ;;
603
604 ia64* )
605 # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
606 # 32-bit code. In the latter case, it defines _ILP32.
607 AC_COMPILE_IFELSE(
608 [AC_LANG_SOURCE(
609 [[#ifdef _ILP32
610 int ok;
611 #else
612 error fail
613 #endif
614 ]])],
615 [gl_cv_host_cpu_c_abi=ia64-ilp32],
616 [gl_cv_host_cpu_c_abi=ia64])
617 ;;
618
619 mips* )
620 # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
621 # at 32.
622 AC_COMPILE_IFELSE(
623 [AC_LANG_SOURCE(
624 [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
625 int ok;
626 #else
627 error fail
628 #endif
629 ]])],
630 [gl_cv_host_cpu_c_abi=mips64],
631 [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
632 # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
633 # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
634 # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
635 AC_COMPILE_IFELSE(
636 [AC_LANG_SOURCE(
637 [[#if (_MIPS_SIM == _ABIN32)
638 int ok;
639 #else
640 error fail
641 #endif
642 ]])],
643 [gl_cv_host_cpu_c_abi=mipsn32],
644 [gl_cv_host_cpu_c_abi=mips])])
645 ;;
646
647 powerpc* )
648 # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
649 # No need to distinguish them here; the caller may distinguish
650 # them based on the OS.
651 # On powerpc64 systems, the C compiler may still be generating
652 # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
653 # be generating 64-bit code.
654 AC_COMPILE_IFELSE(
655 [AC_LANG_SOURCE(
656 [[#if defined __powerpc64__ || defined __LP64__
657 int ok;
658 #else
659 error fail
660 #endif
661 ]])],
662 [# On powerpc64, there are two ABIs on Linux: The AIX compatible
663 # one and the ELFv2 one. The latter defines _CALL_ELF=2.
664 AC_COMPILE_IFELSE(
665 [AC_LANG_SOURCE(
666 [[#if defined _CALL_ELF && _CALL_ELF == 2
667 int ok;
668 #else
669 error fail
670 #endif
671 ]])],
672 [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
673 [gl_cv_host_cpu_c_abi=powerpc64])
674 ],
675 [gl_cv_host_cpu_c_abi=powerpc])
676 ;;
677
678 rs6000 )
679 gl_cv_host_cpu_c_abi=powerpc
680 ;;
681
682 riscv32 | riscv64 )
683 # There are 2 architectures (with variants): rv32* and rv64*.
684 AC_COMPILE_IFELSE(
685 [AC_LANG_SOURCE(
686 [[#if __riscv_xlen == 64
687 int ok;
688 #else
689 error fail
690 #endif
691 ]])],
692 [cpu=riscv64],
693 [cpu=riscv32])
694 # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
695 # Size of 'long' and 'void *':
696 AC_COMPILE_IFELSE(
697 [AC_LANG_SOURCE(
698 [[#if defined __LP64__
699 int ok;
700 #else
701 error fail
702 #endif
703 ]])],
704 [main_abi=lp64],
705 [main_abi=ilp32])
706 # Float ABIs:
707 # __riscv_float_abi_double:
708 # 'float' and 'double' are passed in floating-point registers.
709 # __riscv_float_abi_single:
710 # 'float' are passed in floating-point registers.
711 # __riscv_float_abi_soft:
712 # No values are passed in floating-point registers.
713 AC_COMPILE_IFELSE(
714 [AC_LANG_SOURCE(
715 [[#if defined __riscv_float_abi_double
716 int ok;
717 #else
718 error fail
719 #endif
720 ]])],
721 [float_abi=d],
722 [AC_COMPILE_IFELSE(
723 [AC_LANG_SOURCE(
724 [[#if defined __riscv_float_abi_single
725 int ok;
726 #else
727 error fail
728 #endif
729 ]])],
730 [float_abi=f],
731 [float_abi=''])
732 ])
733 gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
734 ;;
735
736 s390* )
737 # On s390x, the C compiler may be generating 64-bit (= s390x) code
738 # or 31-bit (= s390) code.
739 AC_COMPILE_IFELSE(
740 [AC_LANG_SOURCE(
741 [[#if defined __LP64__ || defined __s390x__
742 int ok;
743 #else
744 error fail
745 #endif
746 ]])],
747 [gl_cv_host_cpu_c_abi=s390x],
748 [gl_cv_host_cpu_c_abi=s390])
749 ;;
750
751 sparc | sparc64 )
752 # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
753 # C compiler still generates 32-bit code.
754 AC_COMPILE_IFELSE(
755 [AC_LANG_SOURCE(
756 [[#if defined __sparcv9 || defined __arch64__
757 int ok;
758 #else
759 error fail
760 #endif
761 ]])],
762 [gl_cv_host_cpu_c_abi=sparc64],
763 [gl_cv_host_cpu_c_abi=sparc])
764 ;;
765
766 *)
767 gl_cv_host_cpu_c_abi="$host_cpu"
768 ;;
769 esac
770 ])
771
772 dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
773 HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
774 HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
775 AC_SUBST([HOST_CPU])
776 AC_SUBST([HOST_CPU_C_ABI])
777
778 # This was
779 # AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
780 # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
781 # earlier, but KAI C++ 3.2d doesn't like this.
782 sed -e 's/-/_/g' >> confdefs.h <<EOF
783 #ifndef __${HOST_CPU}__
784 #define __${HOST_CPU}__ 1
785 #endif
786 #ifndef __${HOST_CPU_C_ABI}__
787 #define __${HOST_CPU_C_ABI}__ 1
788 #endif
789 EOF
790 AH_TOP([/* CPU and C ABI indicator */
791 #ifndef __i386__
792 #undef __i386__
793 #endif
794 #ifndef __x86_64_x32__
795 #undef __x86_64_x32__
796 #endif
797 #ifndef __x86_64__
798 #undef __x86_64__
799 #endif
800 #ifndef __alpha__
801 #undef __alpha__
802 #endif
803 #ifndef __arm__
804 #undef __arm__
805 #endif
806 #ifndef __armhf__
807 #undef __armhf__
808 #endif
809 #ifndef __arm64_ilp32__
810 #undef __arm64_ilp32__
811 #endif
812 #ifndef __arm64__
813 #undef __arm64__
814 #endif
815 #ifndef __hppa__
816 #undef __hppa__
817 #endif
818 #ifndef __hppa64__
819 #undef __hppa64__
820 #endif
821 #ifndef __ia64_ilp32__
822 #undef __ia64_ilp32__
823 #endif
824 #ifndef __ia64__
825 #undef __ia64__
826 #endif
827 #ifndef __loongarch64__
828 #undef __loongarch64__
829 #endif
830 #ifndef __m68k__
831 #undef __m68k__
832 #endif
833 #ifndef __mips__
834 #undef __mips__
835 #endif
836 #ifndef __mipsn32__
837 #undef __mipsn32__
838 #endif
839 #ifndef __mips64__
840 #undef __mips64__
841 #endif
842 #ifndef __powerpc__
843 #undef __powerpc__
844 #endif
845 #ifndef __powerpc64__
846 #undef __powerpc64__
847 #endif
848 #ifndef __powerpc64_elfv2__
849 #undef __powerpc64_elfv2__
850 #endif
851 #ifndef __riscv32__
852 #undef __riscv32__
853 #endif
854 #ifndef __riscv64__
855 #undef __riscv64__
856 #endif
857 #ifndef __riscv32_ilp32__
858 #undef __riscv32_ilp32__
859 #endif
860 #ifndef __riscv32_ilp32f__
861 #undef __riscv32_ilp32f__
862 #endif
863 #ifndef __riscv32_ilp32d__
864 #undef __riscv32_ilp32d__
865 #endif
866 #ifndef __riscv64_ilp32__
867 #undef __riscv64_ilp32__
868 #endif
869 #ifndef __riscv64_ilp32f__
870 #undef __riscv64_ilp32f__
871 #endif
872 #ifndef __riscv64_ilp32d__
873 #undef __riscv64_ilp32d__
874 #endif
875 #ifndef __riscv64_lp64__
876 #undef __riscv64_lp64__
877 #endif
878 #ifndef __riscv64_lp64f__
879 #undef __riscv64_lp64f__
880 #endif
881 #ifndef __riscv64_lp64d__
882 #undef __riscv64_lp64d__
883 #endif
884 #ifndef __s390__
885 #undef __s390__
886 #endif
887 #ifndef __s390x__
888 #undef __s390x__
889 #endif
890 #ifndef __sh__
891 #undef __sh__
892 #endif
893 #ifndef __sparc__
894 #undef __sparc__
895 #endif
896 #ifndef __sparc64__
897 #undef __sparc64__
898 #endif
899 ])
900
901 ])
902
903
904 dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
905 dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
906 dnl one, or to 'unknown' if unknown.
907 dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
908 AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
909 [
910 AC_REQUIRE([AC_CANONICAL_HOST])
911 AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
912 [if test -n "$gl_cv_host_cpu_c_abi"; then
913 case "$gl_cv_host_cpu_c_abi" in
914 i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
915 gl_cv_host_cpu_c_abi_32bit=yes ;;
916 x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
917 gl_cv_host_cpu_c_abi_32bit=no ;;
918 *)
919 gl_cv_host_cpu_c_abi_32bit=unknown ;;
920 esac
921 else
922 case "$host_cpu" in
923
924 # CPUs that only support a 32-bit ABI.
925 arc \
926 | bfin \
927 | cris* \
928 | csky \
929 | epiphany \
930 | ft32 \
931 | h8300 \
932 | m68k \
933 | microblaze | microblazeel \
934 | nds32 | nds32le | nds32be \
935 | nios2 | nios2eb | nios2el \
936 | or1k* \
937 | or32 \
938 | sh | sh[1234] | sh[1234]e[lb] \
939 | tic6x \
940 | xtensa* )
941 gl_cv_host_cpu_c_abi_32bit=yes
942 ;;
943
944 # CPUs that only support a 64-bit ABI.
945 changequote(,)dnl
946 alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
947 | mmix )
948 changequote([,])dnl
949 gl_cv_host_cpu_c_abi_32bit=no
950 ;;
951
952 changequote(,)dnl
953 i[34567]86 )
954 changequote([,])dnl
955 gl_cv_host_cpu_c_abi_32bit=yes
956 ;;
957
958 x86_64 )
959 # On x86_64 systems, the C compiler may be generating code in one of
960 # these ABIs:
961 # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
962 # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
963 # with native Windows (mingw, MSVC).
964 # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
965 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
966 AC_COMPILE_IFELSE(
967 [AC_LANG_SOURCE(
968 [[#if (defined __x86_64__ || defined __amd64__ \
969 || defined _M_X64 || defined _M_AMD64) \
970 && !(defined __ILP32__ || defined _ILP32)
971 int ok;
972 #else
973 error fail
974 #endif
975 ]])],
976 [gl_cv_host_cpu_c_abi_32bit=no],
977 [gl_cv_host_cpu_c_abi_32bit=yes])
978 ;;
979
980 arm* | aarch64 )
981 # Assume arm with EABI.
982 # On arm64 systems, the C compiler may be generating code in one of
983 # these ABIs:
984 # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
985 # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
986 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
987 AC_COMPILE_IFELSE(
988 [AC_LANG_SOURCE(
989 [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
990 int ok;
991 #else
992 error fail
993 #endif
994 ]])],
995 [gl_cv_host_cpu_c_abi_32bit=no],
996 [gl_cv_host_cpu_c_abi_32bit=yes])
997 ;;
998
999 hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
1000 # On hppa, the C compiler may be generating 32-bit code or 64-bit
1001 # code. In the latter case, it defines _LP64 and __LP64__.
1002 AC_COMPILE_IFELSE(
1003 [AC_LANG_SOURCE(
1004 [[#ifdef __LP64__
1005 int ok;
1006 #else
1007 error fail
1008 #endif
1009 ]])],
1010 [gl_cv_host_cpu_c_abi_32bit=no],
1011 [gl_cv_host_cpu_c_abi_32bit=yes])
1012 ;;
1013
1014 ia64* )
1015 # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
1016 # 32-bit code. In the latter case, it defines _ILP32.
1017 AC_COMPILE_IFELSE(
1018 [AC_LANG_SOURCE(
1019 [[#ifdef _ILP32
1020 int ok;
1021 #else
1022 error fail
1023 #endif
1024 ]])],
1025 [gl_cv_host_cpu_c_abi_32bit=yes],
1026 [gl_cv_host_cpu_c_abi_32bit=no])
1027 ;;
1028
1029 mips* )
1030 # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
1031 # at 32.
1032 AC_COMPILE_IFELSE(
1033 [AC_LANG_SOURCE(
1034 [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
1035 int ok;
1036 #else
1037 error fail
1038 #endif
1039 ]])],
1040 [gl_cv_host_cpu_c_abi_32bit=no],
1041 [gl_cv_host_cpu_c_abi_32bit=yes])
1042 ;;
1043
1044 powerpc* )
1045 # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
1046 # No need to distinguish them here; the caller may distinguish
1047 # them based on the OS.
1048 # On powerpc64 systems, the C compiler may still be generating
1049 # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
1050 # be generating 64-bit code.
1051 AC_COMPILE_IFELSE(
1052 [AC_LANG_SOURCE(
1053 [[#if defined __powerpc64__ || defined __LP64__
1054 int ok;
1055 #else
1056 error fail
1057 #endif
1058 ]])],
1059 [gl_cv_host_cpu_c_abi_32bit=no],
1060 [gl_cv_host_cpu_c_abi_32bit=yes])
1061 ;;
1062
1063 rs6000 )
1064 gl_cv_host_cpu_c_abi_32bit=yes
1065 ;;
1066
1067 riscv32 | riscv64 )
1068 # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
1069 # Size of 'long' and 'void *':
1070 AC_COMPILE_IFELSE(
1071 [AC_LANG_SOURCE(
1072 [[#if defined __LP64__
1073 int ok;
1074 #else
1075 error fail
1076 #endif
1077 ]])],
1078 [gl_cv_host_cpu_c_abi_32bit=no],
1079 [gl_cv_host_cpu_c_abi_32bit=yes])
1080 ;;
1081
1082 s390* )
1083 # On s390x, the C compiler may be generating 64-bit (= s390x) code
1084 # or 31-bit (= s390) code.
1085 AC_COMPILE_IFELSE(
1086 [AC_LANG_SOURCE(
1087 [[#if defined __LP64__ || defined __s390x__
1088 int ok;
1089 #else
1090 error fail
1091 #endif
1092 ]])],
1093 [gl_cv_host_cpu_c_abi_32bit=no],
1094 [gl_cv_host_cpu_c_abi_32bit=yes])
1095 ;;
1096
1097 sparc | sparc64 )
1098 # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
1099 # C compiler still generates 32-bit code.
1100 AC_COMPILE_IFELSE(
1101 [AC_LANG_SOURCE(
1102 [[#if defined __sparcv9 || defined __arch64__
1103 int ok;
1104 #else
1105 error fail
1106 #endif
1107 ]])],
1108 [gl_cv_host_cpu_c_abi_32bit=no],
1109 [gl_cv_host_cpu_c_abi_32bit=yes])
1110 ;;
1111
1112 *)
1113 gl_cv_host_cpu_c_abi_32bit=unknown
1114 ;;
1115 esac
1116 fi
1117 ])
1118
1119 HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
1120 ])
1121
1122 # iconv.m4 serial 24
1123 dnl Copyright (C) 2000-2002, 2007-2014, 2016-2022 Free Software Foundation,
1124 dnl Inc.
1125 dnl This file is free software; the Free Software Foundation
1126 dnl gives unlimited permission to copy and/or distribute it,
1127 dnl with or without modifications, as long as this notice is preserved.
1128
1129 dnl From Bruno Haible.
1130
1131 AC_PREREQ([2.64])
1132
1133 dnl Note: AM_ICONV is documented in the GNU gettext manual
1134 dnl <https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html>.
1135 dnl Don't make changes that are incompatible with that documentation!
1136
1137 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
1138 [
1139 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1140 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1141 AC_REQUIRE([AC_LIB_RPATH])
1142
1143 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1144 dnl accordingly.
1145 AC_LIB_LINKFLAGS_BODY([iconv])
1146 ])
1147
1148 AC_DEFUN([AM_ICONV_LINK],
1149 [
1150 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1151 dnl those with the standalone portable GNU libiconv installed).
1152 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1153
1154 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1155 dnl accordingly.
1156 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1157
1158 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
1159 dnl because if the user has installed libiconv and not disabled its use
1160 dnl via --without-libiconv-prefix, he wants to use it. The first
1161 dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
1162 am_save_CPPFLAGS="$CPPFLAGS"
1163 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
1164
1165 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
1166 am_cv_func_iconv="no, consider installing GNU libiconv"
1167 am_cv_lib_iconv=no
1168 AC_LINK_IFELSE(
1169 [AC_LANG_PROGRAM(
1170 [[
1171 #include <stdlib.h>
1172 #include <iconv.h>
1173 ]],
1174 [[iconv_t cd = iconv_open("","");
1175 iconv(cd,NULL,NULL,NULL,NULL);
1176 iconv_close(cd);]])],
1177 [am_cv_func_iconv=yes])
1178 if test "$am_cv_func_iconv" != yes; then
1179 am_save_LIBS="$LIBS"
1180 LIBS="$LIBS $LIBICONV"
1181 AC_LINK_IFELSE(
1182 [AC_LANG_PROGRAM(
1183 [[
1184 #include <stdlib.h>
1185 #include <iconv.h>
1186 ]],
1187 [[iconv_t cd = iconv_open("","");
1188 iconv(cd,NULL,NULL,NULL,NULL);
1189 iconv_close(cd);]])],
1190 [am_cv_lib_iconv=yes]
1191 [am_cv_func_iconv=yes])
1192 LIBS="$am_save_LIBS"
1193 fi
1194 ])
1195 if test "$am_cv_func_iconv" = yes; then
1196 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
1197 dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
1198 dnl Solaris 10.
1199 am_save_LIBS="$LIBS"
1200 if test $am_cv_lib_iconv = yes; then
1201 LIBS="$LIBS $LIBICONV"
1202 fi
1203 am_cv_func_iconv_works=no
1204 for ac_iconv_const in '' 'const'; do
1205 AC_RUN_IFELSE(
1206 [AC_LANG_PROGRAM(
1207 [[
1208 #include <iconv.h>
1209 #include <string.h>
1210
1211 #ifndef ICONV_CONST
1212 # define ICONV_CONST $ac_iconv_const
1213 #endif
1214 ]],
1215 [[int result = 0;
1216 /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
1217 successful returns. This is even documented in
1218 <https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
1219 {
1220 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
1221 if (cd_utf8_to_88591 != (iconv_t)(-1))
1222 {
1223 static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
1224 char buf[10];
1225 ICONV_CONST char *inptr = input;
1226 size_t inbytesleft = strlen (input);
1227 char *outptr = buf;
1228 size_t outbytesleft = sizeof (buf);
1229 size_t res = iconv (cd_utf8_to_88591,
1230 &inptr, &inbytesleft,
1231 &outptr, &outbytesleft);
1232 if (res == 0)
1233 result |= 1;
1234 iconv_close (cd_utf8_to_88591);
1235 }
1236 }
1237 /* Test against Solaris 10 bug: Failures are not distinguishable from
1238 successful returns. */
1239 {
1240 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
1241 if (cd_ascii_to_88591 != (iconv_t)(-1))
1242 {
1243 static ICONV_CONST char input[] = "\263";
1244 char buf[10];
1245 ICONV_CONST char *inptr = input;
1246 size_t inbytesleft = strlen (input);
1247 char *outptr = buf;
1248 size_t outbytesleft = sizeof (buf);
1249 size_t res = iconv (cd_ascii_to_88591,
1250 &inptr, &inbytesleft,
1251 &outptr, &outbytesleft);
1252 if (res == 0)
1253 result |= 2;
1254 iconv_close (cd_ascii_to_88591);
1255 }
1256 }
1257 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
1258 {
1259 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
1260 if (cd_88591_to_utf8 != (iconv_t)(-1))
1261 {
1262 static ICONV_CONST char input[] = "\304";
1263 static char buf[2] = { (char)0xDE, (char)0xAD };
1264 ICONV_CONST char *inptr = input;
1265 size_t inbytesleft = 1;
1266 char *outptr = buf;
1267 size_t outbytesleft = 1;
1268 size_t res = iconv (cd_88591_to_utf8,
1269 &inptr, &inbytesleft,
1270 &outptr, &outbytesleft);
1271 if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
1272 result |= 4;
1273 iconv_close (cd_88591_to_utf8);
1274 }
1275 }
1276 #if 0 /* This bug could be worked around by the caller. */
1277 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
1278 {
1279 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
1280 if (cd_88591_to_utf8 != (iconv_t)(-1))
1281 {
1282 static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
1283 char buf[50];
1284 ICONV_CONST char *inptr = input;
1285 size_t inbytesleft = strlen (input);
1286 char *outptr = buf;
1287 size_t outbytesleft = sizeof (buf);
1288 size_t res = iconv (cd_88591_to_utf8,
1289 &inptr, &inbytesleft,
1290 &outptr, &outbytesleft);
1291 if ((int)res > 0)
1292 result |= 8;
1293 iconv_close (cd_88591_to_utf8);
1294 }
1295 }
1296 #endif
1297 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
1298 provided. */
1299 {
1300 /* Try standardized names. */
1301 iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
1302 /* Try IRIX, OSF/1 names. */
1303 iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
1304 /* Try AIX names. */
1305 iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
1306 /* Try HP-UX names. */
1307 iconv_t cd4 = iconv_open ("utf8", "eucJP");
1308 if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
1309 && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
1310 result |= 16;
1311 if (cd1 != (iconv_t)(-1))
1312 iconv_close (cd1);
1313 if (cd2 != (iconv_t)(-1))
1314 iconv_close (cd2);
1315 if (cd3 != (iconv_t)(-1))
1316 iconv_close (cd3);
1317 if (cd4 != (iconv_t)(-1))
1318 iconv_close (cd4);
1319 }
1320 return result;
1321 ]])],
1322 [am_cv_func_iconv_works=yes], ,
1323 [case "$host_os" in
1324 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
1325 *) am_cv_func_iconv_works="guessing yes" ;;
1326 esac])
1327 test "$am_cv_func_iconv_works" = no || break
1328 done
1329 LIBS="$am_save_LIBS"
1330 ])
1331 case "$am_cv_func_iconv_works" in
1332 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
1333 *) am_func_iconv=yes ;;
1334 esac
1335 else
1336 am_func_iconv=no am_cv_lib_iconv=no
1337 fi
1338 if test "$am_func_iconv" = yes; then
1339 AC_DEFINE([HAVE_ICONV], [1],
1340 [Define if you have the iconv() function and it works.])
1341 fi
1342 if test "$am_cv_lib_iconv" = yes; then
1343 AC_MSG_CHECKING([how to link with libiconv])
1344 AC_MSG_RESULT([$LIBICONV])
1345 else
1346 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1347 dnl either.
1348 CPPFLAGS="$am_save_CPPFLAGS"
1349 LIBICONV=
1350 LTLIBICONV=
1351 fi
1352 AC_SUBST([LIBICONV])
1353 AC_SUBST([LTLIBICONV])
1354 ])
1355
1356 dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like
1357 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
1358 dnl This is tricky because of the way 'aclocal' is implemented:
1359 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
1360 dnl Otherwise aclocal's initial scan pass would miss the macro definition.
1361 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
1362 dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
1363 dnl warnings.
1364 AC_DEFUN_ONCE([AM_ICONV],
1365 [
1366 AM_ICONV_LINK
1367 if test "$am_cv_func_iconv" = yes; then
1368 AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature],
1369 [gl_cv_iconv_nonconst],
1370 [AC_COMPILE_IFELSE(
1371 [AC_LANG_PROGRAM(
1372 [[
1373 #include <stdlib.h>
1374 #include <iconv.h>
1375 extern
1376 #ifdef __cplusplus
1377 "C"
1378 #endif
1379 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1380 ]],
1381 [[]])],
1382 [gl_cv_iconv_nonconst=yes],
1383 [gl_cv_iconv_nonconst=no])
1384 ])
1385 else
1386 dnl When compiling GNU libiconv on a system that does not have iconv yet,
1387 dnl pick the POSIX compliant declaration without 'const'.
1388 gl_cv_iconv_nonconst=yes
1389 fi
1390 if test $gl_cv_iconv_nonconst = yes; then
1391 iconv_arg1=""
1392 else
1393 iconv_arg1="const"
1394 fi
1395 AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1],
1396 [Define as const if the declaration of iconv() needs const.])
1397 dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
1398 m4_ifdef([gl_ICONV_H_DEFAULTS],
1399 [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
1400 if test $gl_cv_iconv_nonconst != yes; then
1401 ICONV_CONST="const"
1402 fi
1403 ])
1404 ])
1405
1406 # intlmacosx.m4 serial 8 (gettext-0.20.2)
1407 dnl Copyright (C) 2004-2014, 2016, 2019-2022 Free Software Foundation, Inc.
1408 dnl This file is free software; the Free Software Foundation
1409 dnl gives unlimited permission to copy and/or distribute it,
1410 dnl with or without modifications, as long as this notice is preserved.
1411 dnl
1412 dnl This file can be used in projects which are not available under
1413 dnl the GNU General Public License or the GNU Lesser General Public
1414 dnl License but which still want to provide support for the GNU gettext
1415 dnl functionality.
1416 dnl Please note that the actual code of the GNU gettext library is covered
1417 dnl by the GNU Lesser General Public License, and the rest of the GNU
1418 dnl gettext package is covered by the GNU General Public License.
1419 dnl They are *not* in the public domain.
1420
1421 dnl Checks for special options needed on Mac OS X.
1422 dnl Defines INTL_MACOSX_LIBS.
1423 AC_DEFUN([gt_INTL_MACOSX],
1424 [
1425 dnl Check for API introduced in Mac OS X 10.4.
1426 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1427 [gt_cv_func_CFPreferencesCopyAppValue],
1428 [gt_save_LIBS="$LIBS"
1429 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1430 AC_LINK_IFELSE(
1431 [AC_LANG_PROGRAM(
1432 [[#include <CoreFoundation/CFPreferences.h>]],
1433 [[CFPreferencesCopyAppValue(NULL, NULL)]])],
1434 [gt_cv_func_CFPreferencesCopyAppValue=yes],
1435 [gt_cv_func_CFPreferencesCopyAppValue=no])
1436 LIBS="$gt_save_LIBS"])
1437 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1438 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
1439 [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1440 fi
1441 dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
1442 dnl because in macOS 10.13.4 it has the following behaviour:
1443 dnl When two or more languages are specified in the
1444 dnl "System Preferences > Language & Region > Preferred Languages" panel,
1445 dnl it returns en_CC where CC is the territory (even when English is not among
1446 dnl the preferred languages!). What we want instead is what
1447 dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
1448 dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
1449 dnl first among the preferred languages and CC is the territory.
1450 AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
1451 [gt_save_LIBS="$LIBS"
1452 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1453 AC_LINK_IFELSE(
1454 [AC_LANG_PROGRAM(
1455 [[#include <CoreFoundation/CFLocale.h>]],
1456 [[CFLocaleCopyPreferredLanguages();]])],
1457 [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
1458 [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
1459 LIBS="$gt_save_LIBS"])
1460 if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
1461 AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
1462 [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
1463 fi
1464 INTL_MACOSX_LIBS=
1465 if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
1466 || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
1467 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1468 fi
1469 AC_SUBST([INTL_MACOSX_LIBS])
1470 ])
1471
1472 # lib-ld.m4 serial 10
1473 dnl Copyright (C) 1996-2003, 2009-2022 Free Software Foundation, Inc.
1474 dnl This file is free software; the Free Software Foundation
1475 dnl gives unlimited permission to copy and/or distribute it,
1476 dnl with or without modifications, as long as this notice is preserved.
1477
1478 dnl Subroutines of libtool.m4,
1479 dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
1480 dnl collision with libtool.m4.
1481
1482 dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
1483 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1484 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
1485 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
1486 case `$LD -v 2>&1 </dev/null` in
1487 *GNU* | *'with BFD'*)
1488 acl_cv_prog_gnu_ld=yes
1489 ;;
1490 *)
1491 acl_cv_prog_gnu_ld=no
1492 ;;
1493 esac])
1494 with_gnu_ld=$acl_cv_prog_gnu_ld
1495 ])
1496
1497 dnl From libtool-2.4. Sets the variable LD.
1498 AC_DEFUN([AC_LIB_PROG_LD],
1499 [AC_REQUIRE([AC_PROG_CC])dnl
1500 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1501
1502 AC_ARG_WITH([gnu-ld],
1503 [AS_HELP_STRING([--with-gnu-ld],
1504 [assume the C compiler uses GNU ld [default=no]])],
1505 [test "$withval" = no || with_gnu_ld=yes],
1506 [with_gnu_ld=no])dnl
1507
1508 # Prepare PATH_SEPARATOR.
1509 # The user is always right.
1510 if test "${PATH_SEPARATOR+set}" != set; then
1511 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
1512 # contains only /bin. Note that ksh looks also at the FPATH variable,
1513 # so we have to set that as well for the test.
1514 PATH_SEPARATOR=:
1515 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
1516 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
1517 || PATH_SEPARATOR=';'
1518 }
1519 fi
1520
1521 if test -n "$LD"; then
1522 AC_MSG_CHECKING([for ld])
1523 elif test "$GCC" = yes; then
1524 AC_MSG_CHECKING([for ld used by $CC])
1525 elif test "$with_gnu_ld" = yes; then
1526 AC_MSG_CHECKING([for GNU ld])
1527 else
1528 AC_MSG_CHECKING([for non-GNU ld])
1529 fi
1530 if test -n "$LD"; then
1531 # Let the user override the test with a path.
1532 :
1533 else
1534 AC_CACHE_VAL([acl_cv_path_LD],
1535 [
1536 acl_cv_path_LD= # Final result of this test
1537 ac_prog=ld # Program to search in $PATH
1538 if test "$GCC" = yes; then
1539 # Check if gcc -print-prog-name=ld gives a path.
1540 case $host in
1541 *-*-mingw*)
1542 # gcc leaves a trailing carriage return which upsets mingw
1543 acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1544 *)
1545 acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
1546 esac
1547 case $acl_output in
1548 # Accept absolute paths.
1549 [[\\/]]* | ?:[[\\/]]*)
1550 re_direlt='/[[^/]][[^/]]*/\.\./'
1551 # Canonicalize the pathname of ld
1552 acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
1553 while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
1554 acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
1555 done
1556 # Got the pathname. No search in PATH is needed.
1557 acl_cv_path_LD="$acl_output"
1558 ac_prog=
1559 ;;
1560 "")
1561 # If it fails, then pretend we aren't using GCC.
1562 ;;
1563 *)
1564 # If it is relative, then search for the first ld in PATH.
1565 with_gnu_ld=unknown
1566 ;;
1567 esac
1568 fi
1569 if test -n "$ac_prog"; then
1570 # Search for $ac_prog in $PATH.
1571 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1572 for ac_dir in $PATH; do
1573 IFS="$acl_save_ifs"
1574 test -z "$ac_dir" && ac_dir=.
1575 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1576 acl_cv_path_LD="$ac_dir/$ac_prog"
1577 # Check to see if the program is GNU ld. I'd rather use --version,
1578 # but apparently some variants of GNU ld only accept -v.
1579 # Break only if it was the GNU/non-GNU ld that we prefer.
1580 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
1581 *GNU* | *'with BFD'*)
1582 test "$with_gnu_ld" != no && break
1583 ;;
1584 *)
1585 test "$with_gnu_ld" != yes && break
1586 ;;
1587 esac
1588 fi
1589 done
1590 IFS="$acl_save_ifs"
1591 fi
1592 case $host in
1593 *-*-aix*)
1594 AC_COMPILE_IFELSE(
1595 [AC_LANG_SOURCE(
1596 [[#if defined __powerpc64__ || defined __LP64__
1597 int ok;
1598 #else
1599 error fail
1600 #endif
1601 ]])],
1602 [# The compiler produces 64-bit code. Add option '-b64' so that the
1603 # linker groks 64-bit object files.
1604 case "$acl_cv_path_LD " in
1605 *" -b64 "*) ;;
1606 *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
1607 esac
1608 ], [])
1609 ;;
1610 sparc64-*-netbsd*)
1611 AC_COMPILE_IFELSE(
1612 [AC_LANG_SOURCE(
1613 [[#if defined __sparcv9 || defined __arch64__
1614 int ok;
1615 #else
1616 error fail
1617 #endif
1618 ]])],
1619 [],
1620 [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
1621 # so that the linker groks 32-bit object files.
1622 case "$acl_cv_path_LD " in
1623 *" -m elf32_sparc "*) ;;
1624 *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
1625 esac
1626 ])
1627 ;;
1628 esac
1629 ])
1630 LD="$acl_cv_path_LD"
1631 fi
1632 if test -n "$LD"; then
1633 AC_MSG_RESULT([$LD])
1634 else
1635 AC_MSG_RESULT([no])
1636 AC_MSG_ERROR([no acceptable ld found in \$PATH])
1637 fi
1638 AC_LIB_PROG_LD_GNU
1639 ])
1640
1641 # lib-link.m4 serial 32
1642 dnl Copyright (C) 2001-2022 Free Software Foundation, Inc.
1643 dnl This file is free software; the Free Software Foundation
1644 dnl gives unlimited permission to copy and/or distribute it,
1645 dnl with or without modifications, as long as this notice is preserved.
1646
1647 dnl From Bruno Haible.
1648
1649 AC_PREREQ([2.61])
1650
1651 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1652 dnl the libraries corresponding to explicit and implicit dependencies.
1653 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1654 dnl augments the CPPFLAGS variable.
1655 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1656 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1657 AC_DEFUN([AC_LIB_LINKFLAGS],
1658 [
1659 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1660 AC_REQUIRE([AC_LIB_RPATH])
1661 pushdef([Name],[m4_translit([$1],[./+-], [____])])
1662 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1663 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1664 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1665 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1666 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1667 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1668 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1669 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
1670 ])
1671 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1672 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1673 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1674 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
1675 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1676 AC_SUBST([LIB]NAME)
1677 AC_SUBST([LTLIB]NAME)
1678 AC_SUBST([LIB]NAME[_PREFIX])
1679 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1680 dnl results of this search when this library appears as a dependency.
1681 HAVE_LIB[]NAME=yes
1682 popdef([NAME])
1683 popdef([Name])
1684 ])
1685
1686 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
1687 dnl searches for libname and the libraries corresponding to explicit and
1688 dnl implicit dependencies, together with the specified include files and
1689 dnl the ability to compile and link the specified testcode. The missing-message
1690 dnl defaults to 'no' and may contain additional hints for the user.
1691 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
1692 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1693 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1694 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1695 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1696 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1697 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1698 [
1699 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1700 AC_REQUIRE([AC_LIB_RPATH])
1701 pushdef([Name],[m4_translit([$1],[./+-], [____])])
1702 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1703 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1704
1705 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1706 dnl accordingly.
1707 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1708
1709 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1710 dnl because if the user has installed lib[]Name and not disabled its use
1711 dnl via --without-lib[]Name-prefix, he wants to use it.
1712 ac_save_CPPFLAGS="$CPPFLAGS"
1713 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1714
1715 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1716 ac_save_LIBS="$LIBS"
1717 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
1718 dnl because these -l options might require -L options that are present in
1719 dnl LIBS. -l options benefit only from the -L options listed before it.
1720 dnl Otherwise, add it to the front of LIBS, because it may be a static
1721 dnl library that depends on another static library that is present in LIBS.
1722 dnl Static libraries benefit only from the static libraries listed after
1723 dnl it.
1724 case " $LIB[]NAME" in
1725 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
1726 *) LIBS="$LIB[]NAME $LIBS" ;;
1727 esac
1728 AC_LINK_IFELSE(
1729 [AC_LANG_PROGRAM([[$3]], [[$4]])],
1730 [ac_cv_lib[]Name=yes],
1731 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
1732 LIBS="$ac_save_LIBS"
1733 ])
1734 if test "$ac_cv_lib[]Name" = yes; then
1735 HAVE_LIB[]NAME=yes
1736 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
1737 AC_MSG_CHECKING([how to link with lib[]$1])
1738 AC_MSG_RESULT([$LIB[]NAME])
1739 else
1740 HAVE_LIB[]NAME=no
1741 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1742 dnl $INC[]NAME either.
1743 CPPFLAGS="$ac_save_CPPFLAGS"
1744 LIB[]NAME=
1745 LTLIB[]NAME=
1746 LIB[]NAME[]_PREFIX=
1747 fi
1748 AC_SUBST([HAVE_LIB]NAME)
1749 AC_SUBST([LIB]NAME)
1750 AC_SUBST([LTLIB]NAME)
1751 AC_SUBST([LIB]NAME[_PREFIX])
1752 popdef([NAME])
1753 popdef([Name])
1754 ])
1755
1756 dnl Determine the platform dependent parameters needed to use rpath:
1757 dnl acl_libext,
1758 dnl acl_shlibext,
1759 dnl acl_libname_spec,
1760 dnl acl_library_names_spec,
1761 dnl acl_hardcode_libdir_flag_spec,
1762 dnl acl_hardcode_libdir_separator,
1763 dnl acl_hardcode_direct,
1764 dnl acl_hardcode_minus_L.
1765 AC_DEFUN([AC_LIB_RPATH],
1766 [
1767 dnl Complain if config.rpath is missing.
1768 AC_REQUIRE_AUX_FILE([config.rpath])
1769 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1770 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1771 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1772 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1773 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
1774 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1775 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1776 . ./conftest.sh
1777 rm -f ./conftest.sh
1778 acl_cv_rpath=done
1779 ])
1780 wl="$acl_cv_wl"
1781 acl_libext="$acl_cv_libext"
1782 acl_shlibext="$acl_cv_shlibext"
1783 acl_libname_spec="$acl_cv_libname_spec"
1784 acl_library_names_spec="$acl_cv_library_names_spec"
1785 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1786 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1787 acl_hardcode_direct="$acl_cv_hardcode_direct"
1788 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
1789 dnl Determine whether the user wants rpath handling at all.
1790 AC_ARG_ENABLE([rpath],
1791 [ --disable-rpath do not hardcode runtime library paths],
1792 :, enable_rpath=yes)
1793 ])
1794
1795 dnl AC_LIB_FROMPACKAGE(name, package)
1796 dnl declares that libname comes from the given package. The configure file
1797 dnl will then not have a --with-libname-prefix option but a
1798 dnl --with-package-prefix option. Several libraries can come from the same
1799 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
1800 dnl macro call that searches for libname.
1801 AC_DEFUN([AC_LIB_FROMPACKAGE],
1802 [
1803 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1804 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1805 define([acl_frompackage_]NAME, [$2])
1806 popdef([NAME])
1807 pushdef([PACK],[$2])
1808 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
1809 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1810 define([acl_libsinpackage_]PACKUP,
1811 m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
1812 popdef([PACKUP])
1813 popdef([PACK])
1814 ])
1815
1816 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1817 dnl the libraries corresponding to explicit and implicit dependencies.
1818 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1819 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
1820 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1821 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1822 [
1823 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1824 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1825 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1826 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
1827 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
1828 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1829 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
1830 dnl By default, look in $includedir and $libdir.
1831 use_additional=yes
1832 AC_LIB_WITH_FINAL_PREFIX([
1833 eval additional_includedir=\"$includedir\"
1834 eval additional_libdir=\"$libdir\"
1835 eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
1836 eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
1837 ])
1838 AC_ARG_WITH(PACK[-prefix],
1839 [[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
1840 --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
1841 [
1842 if test "X$withval" = "Xno"; then
1843 use_additional=no
1844 else
1845 if test "X$withval" = "X"; then
1846 AC_LIB_WITH_FINAL_PREFIX([
1847 eval additional_includedir=\"$includedir\"
1848 eval additional_libdir=\"$libdir\"
1849 eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
1850 eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
1851 ])
1852 else
1853 additional_includedir="$withval/include"
1854 additional_libdir="$withval/$acl_libdirstem"
1855 additional_libdir2="$withval/$acl_libdirstem2"
1856 additional_libdir3="$withval/$acl_libdirstem3"
1857 fi
1858 fi
1859 ])
1860 if test "X$additional_libdir2" = "X$additional_libdir"; then
1861 additional_libdir2=
1862 fi
1863 if test "X$additional_libdir3" = "X$additional_libdir"; then
1864 additional_libdir3=
1865 fi
1866 dnl Search the library and its dependencies in $additional_libdir and
1867 dnl $LDFLAGS. Using breadth-first-seach.
1868 LIB[]NAME=
1869 LTLIB[]NAME=
1870 INC[]NAME=
1871 LIB[]NAME[]_PREFIX=
1872 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
1873 dnl computed. So it has to be reset here.
1874 HAVE_LIB[]NAME=
1875 rpathdirs=
1876 ltrpathdirs=
1877 names_already_handled=
1878 names_next_round='$1 $2'
1879 while test -n "$names_next_round"; do
1880 names_this_round="$names_next_round"
1881 names_next_round=
1882 for name in $names_this_round; do
1883 already_handled=
1884 for n in $names_already_handled; do
1885 if test "$n" = "$name"; then
1886 already_handled=yes
1887 break
1888 fi
1889 done
1890 if test -z "$already_handled"; then
1891 names_already_handled="$names_already_handled $name"
1892 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1893 dnl or AC_LIB_HAVE_LINKFLAGS call.
1894 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
1895 eval value=\"\$HAVE_LIB$uppername\"
1896 if test -n "$value"; then
1897 if test "$value" = yes; then
1898 eval value=\"\$LIB$uppername\"
1899 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1900 eval value=\"\$LTLIB$uppername\"
1901 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1902 else
1903 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1904 dnl that this library doesn't exist. So just drop it.
1905 :
1906 fi
1907 else
1908 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1909 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1910 found_dir=
1911 found_la=
1912 found_so=
1913 found_a=
1914 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
1915 if test -n "$acl_shlibext"; then
1916 shrext=".$acl_shlibext" # typically: shrext=.so
1917 else
1918 shrext=
1919 fi
1920 if test $use_additional = yes; then
1921 for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
1922 if test "X$found_dir" = "X"; then
1923 eval dir=\$$additional_libdir_variable
1924 if test -n "$dir"; then
1925 dnl The same code as in the loop below:
1926 dnl First look for a shared library.
1927 if test -n "$acl_shlibext"; then
1928 if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
1929 found_dir="$dir"
1930 found_so="$dir/$libname$shrext"
1931 else
1932 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1933 ver=`(cd "$dir" && \
1934 for f in "$libname$shrext".*; do echo "$f"; done \
1935 | sed -e "s,^$libname$shrext\\\\.,," \
1936 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1937 | sed 1q ) 2>/dev/null`
1938 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
1939 found_dir="$dir"
1940 found_so="$dir/$libname$shrext.$ver"
1941 fi
1942 else
1943 eval library_names=\"$acl_library_names_spec\"
1944 for f in $library_names; do
1945 if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
1946 found_dir="$dir"
1947 found_so="$dir/$f"
1948 break
1949 fi
1950 done
1951 fi
1952 fi
1953 fi
1954 dnl Then look for a static library.
1955 if test "X$found_dir" = "X"; then
1956 if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
1957 found_dir="$dir"
1958 found_a="$dir/$libname.$acl_libext"
1959 fi
1960 fi
1961 if test "X$found_dir" != "X"; then
1962 if test -f "$dir/$libname.la"; then
1963 found_la="$dir/$libname.la"
1964 fi
1965 fi
1966 fi
1967 fi
1968 done
1969 fi
1970 if test "X$found_dir" = "X"; then
1971 for x in $LDFLAGS $LTLIB[]NAME; do
1972 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1973 case "$x" in
1974 -L*)
1975 dir=`echo "X$x" | sed -e 's/^X-L//'`
1976 dnl First look for a shared library.
1977 if test -n "$acl_shlibext"; then
1978 if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
1979 found_dir="$dir"
1980 found_so="$dir/$libname$shrext"
1981 else
1982 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1983 ver=`(cd "$dir" && \
1984 for f in "$libname$shrext".*; do echo "$f"; done \
1985 | sed -e "s,^$libname$shrext\\\\.,," \
1986 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1987 | sed 1q ) 2>/dev/null`
1988 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
1989 found_dir="$dir"
1990 found_so="$dir/$libname$shrext.$ver"
1991 fi
1992 else
1993 eval library_names=\"$acl_library_names_spec\"
1994 for f in $library_names; do
1995 if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
1996 found_dir="$dir"
1997 found_so="$dir/$f"
1998 break
1999 fi
2000 done
2001 fi
2002 fi
2003 fi
2004 dnl Then look for a static library.
2005 if test "X$found_dir" = "X"; then
2006 if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
2007 found_dir="$dir"
2008 found_a="$dir/$libname.$acl_libext"
2009 fi
2010 fi
2011 if test "X$found_dir" != "X"; then
2012 if test -f "$dir/$libname.la"; then
2013 found_la="$dir/$libname.la"
2014 fi
2015 fi
2016 ;;
2017 esac
2018 if test "X$found_dir" != "X"; then
2019 break
2020 fi
2021 done
2022 fi
2023 if test "X$found_dir" != "X"; then
2024 dnl Found the library.
2025 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2026 if test "X$found_so" != "X"; then
2027 dnl Linking with a shared library. We attempt to hardcode its
2028 dnl directory into the executable's runpath, unless it's the
2029 dnl standard /usr/lib.
2030 if test "$enable_rpath" = no \
2031 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
2032 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
2033 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
2034 dnl No hardcoding is needed.
2035 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2036 else
2037 dnl Use an explicit option to hardcode DIR into the resulting
2038 dnl binary.
2039 dnl Potentially add DIR to ltrpathdirs.
2040 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2041 haveit=
2042 for x in $ltrpathdirs; do
2043 if test "X$x" = "X$found_dir"; then
2044 haveit=yes
2045 break
2046 fi
2047 done
2048 if test -z "$haveit"; then
2049 ltrpathdirs="$ltrpathdirs $found_dir"
2050 fi
2051 dnl The hardcoding into $LIBNAME is system dependent.
2052 if test "$acl_hardcode_direct" = yes; then
2053 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2054 dnl resulting binary.
2055 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2056 else
2057 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
2058 dnl Use an explicit option to hardcode DIR into the resulting
2059 dnl binary.
2060 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2061 dnl Potentially add DIR to rpathdirs.
2062 dnl The rpathdirs will be appended to $LIBNAME at the end.
2063 haveit=
2064 for x in $rpathdirs; do
2065 if test "X$x" = "X$found_dir"; then
2066 haveit=yes
2067 break
2068 fi
2069 done
2070 if test -z "$haveit"; then
2071 rpathdirs="$rpathdirs $found_dir"
2072 fi
2073 else
2074 dnl Rely on "-L$found_dir".
2075 dnl But don't add it if it's already contained in the LDFLAGS
2076 dnl or the already constructed $LIBNAME
2077 haveit=
2078 for x in $LDFLAGS $LIB[]NAME; do
2079 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2080 if test "X$x" = "X-L$found_dir"; then
2081 haveit=yes
2082 break
2083 fi
2084 done
2085 if test -z "$haveit"; then
2086 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2087 fi
2088 if test "$acl_hardcode_minus_L" != no; then
2089 dnl FIXME: Not sure whether we should use
2090 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2091 dnl here.
2092 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2093 else
2094 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
2095 dnl here, because this doesn't fit in flags passed to the
2096 dnl compiler. So give up. No hardcoding. This affects only
2097 dnl very old systems.
2098 dnl FIXME: Not sure whether we should use
2099 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2100 dnl here.
2101 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2102 fi
2103 fi
2104 fi
2105 fi
2106 else
2107 if test "X$found_a" != "X"; then
2108 dnl Linking with a static library.
2109 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2110 else
2111 dnl We shouldn't come here, but anyway it's good to have a
2112 dnl fallback.
2113 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2114 fi
2115 fi
2116 dnl Assume the include files are nearby.
2117 additional_includedir=
2118 case "$found_dir" in
2119 */$acl_libdirstem | */$acl_libdirstem/)
2120 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
2121 if test "$name" = '$1'; then
2122 LIB[]NAME[]_PREFIX="$basedir"
2123 fi
2124 additional_includedir="$basedir/include"
2125 ;;
2126 */$acl_libdirstem2 | */$acl_libdirstem2/)
2127 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
2128 if test "$name" = '$1'; then
2129 LIB[]NAME[]_PREFIX="$basedir"
2130 fi
2131 additional_includedir="$basedir/include"
2132 ;;
2133 */$acl_libdirstem3 | */$acl_libdirstem3/)
2134 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
2135 if test "$name" = '$1'; then
2136 LIB[]NAME[]_PREFIX="$basedir"
2137 fi
2138 additional_includedir="$basedir/include"
2139 ;;
2140 esac
2141 if test "X$additional_includedir" != "X"; then
2142 dnl Potentially add $additional_includedir to $INCNAME.
2143 dnl But don't add it
2144 dnl 1. if it's the standard /usr/include,
2145 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2146 dnl 3. if it's already present in $CPPFLAGS or the already
2147 dnl constructed $INCNAME,
2148 dnl 4. if it doesn't exist as a directory.
2149 if test "X$additional_includedir" != "X/usr/include"; then
2150 haveit=
2151 if test "X$additional_includedir" = "X/usr/local/include"; then
2152 if test -n "$GCC"; then
2153 case $host_os in
2154 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2155 esac
2156 fi
2157 fi
2158 if test -z "$haveit"; then
2159 for x in $CPPFLAGS $INC[]NAME; do
2160 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2161 if test "X$x" = "X-I$additional_includedir"; then
2162 haveit=yes
2163 break
2164 fi
2165 done
2166 if test -z "$haveit"; then
2167 if test -d "$additional_includedir"; then
2168 dnl Really add $additional_includedir to $INCNAME.
2169 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2170 fi
2171 fi
2172 fi
2173 fi
2174 fi
2175 dnl Look for dependencies.
2176 if test -n "$found_la"; then
2177 dnl Read the .la file. It defines the variables
2178 dnl dlname, library_names, old_library, dependency_libs, current,
2179 dnl age, revision, installed, dlopen, dlpreopen, libdir.
2180 save_libdir="$libdir"
2181 case "$found_la" in
2182 */* | *\\*) . "$found_la" ;;
2183 *) . "./$found_la" ;;
2184 esac
2185 libdir="$save_libdir"
2186 dnl We use only dependency_libs.
2187 for dep in $dependency_libs; do
2188 case "$dep" in
2189 -L*)
2190 dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2191 dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
2192 dnl But don't add it
2193 dnl 1. if it's the standard /usr/lib,
2194 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2195 dnl 3. if it's already present in $LDFLAGS or the already
2196 dnl constructed $LIBNAME,
2197 dnl 4. if it doesn't exist as a directory.
2198 if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
2199 && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
2200 && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
2201 haveit=
2202 if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
2203 || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
2204 || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
2205 if test -n "$GCC"; then
2206 case $host_os in
2207 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2208 esac
2209 fi
2210 fi
2211 if test -z "$haveit"; then
2212 haveit=
2213 for x in $LDFLAGS $LIB[]NAME; do
2214 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2215 if test "X$x" = "X-L$dependency_libdir"; then
2216 haveit=yes
2217 break
2218 fi
2219 done
2220 if test -z "$haveit"; then
2221 if test -d "$dependency_libdir"; then
2222 dnl Really add $dependency_libdir to $LIBNAME.
2223 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
2224 fi
2225 fi
2226 haveit=
2227 for x in $LDFLAGS $LTLIB[]NAME; do
2228 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2229 if test "X$x" = "X-L$dependency_libdir"; then
2230 haveit=yes
2231 break
2232 fi
2233 done
2234 if test -z "$haveit"; then
2235 if test -d "$dependency_libdir"; then
2236 dnl Really add $dependency_libdir to $LTLIBNAME.
2237 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
2238 fi
2239 fi
2240 fi
2241 fi
2242 ;;
2243 -R*)
2244 dir=`echo "X$dep" | sed -e 's/^X-R//'`
2245 if test "$enable_rpath" != no; then
2246 dnl Potentially add DIR to rpathdirs.
2247 dnl The rpathdirs will be appended to $LIBNAME at the end.
2248 haveit=
2249 for x in $rpathdirs; do
2250 if test "X$x" = "X$dir"; then
2251 haveit=yes
2252 break
2253 fi
2254 done
2255 if test -z "$haveit"; then
2256 rpathdirs="$rpathdirs $dir"
2257 fi
2258 dnl Potentially add DIR to ltrpathdirs.
2259 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2260 haveit=
2261 for x in $ltrpathdirs; do
2262 if test "X$x" = "X$dir"; then
2263 haveit=yes
2264 break
2265 fi
2266 done
2267 if test -z "$haveit"; then
2268 ltrpathdirs="$ltrpathdirs $dir"
2269 fi
2270 fi
2271 ;;
2272 -l*)
2273 dnl Handle this in the next round.
2274 dnl But on GNU systems, ignore -lc options, because
2275 dnl - linking with libc is the default anyway,
2276 dnl - linking with libc.a may produce an error
2277 dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie"
2278 dnl or may produce an executable that always crashes, see
2279 dnl <https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00052.html>.
2280 dep=`echo "X$dep" | sed -e 's/^X-l//'`
2281 if test "X$dep" != Xc \
2282 || case $host_os in
2283 linux* | gnu* | k*bsd*-gnu) false ;;
2284 *) true ;;
2285 esac; then
2286 names_next_round="$names_next_round $dep"
2287 fi
2288 ;;
2289 *.la)
2290 dnl Handle this in the next round. Throw away the .la's
2291 dnl directory; it is already contained in a preceding -L
2292 dnl option.
2293 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2294 ;;
2295 *)
2296 dnl Most likely an immediate library name.
2297 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2298 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2299 ;;
2300 esac
2301 done
2302 fi
2303 else
2304 dnl Didn't find the library; assume it is in the system directories
2305 dnl known to the linker and runtime loader. (All the system
2306 dnl directories known to the linker should also be known to the
2307 dnl runtime loader, otherwise the system is severely misconfigured.)
2308 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2309 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2310 fi
2311 fi
2312 fi
2313 done
2314 done
2315 if test "X$rpathdirs" != "X"; then
2316 if test -n "$acl_hardcode_libdir_separator"; then
2317 dnl Weird platform: only the last -rpath option counts, the user must
2318 dnl pass all path elements in one option. We can arrange that for a
2319 dnl single library, but not when more than one $LIBNAMEs are used.
2320 alldirs=
2321 for found_dir in $rpathdirs; do
2322 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
2323 done
2324 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
2325 acl_save_libdir="$libdir"
2326 libdir="$alldirs"
2327 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2328 libdir="$acl_save_libdir"
2329 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2330 else
2331 dnl The -rpath options are cumulative.
2332 for found_dir in $rpathdirs; do
2333 acl_save_libdir="$libdir"
2334 libdir="$found_dir"
2335 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2336 libdir="$acl_save_libdir"
2337 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2338 done
2339 fi
2340 fi
2341 if test "X$ltrpathdirs" != "X"; then
2342 dnl When using libtool, the option that works for both libraries and
2343 dnl executables is -R. The -R options are cumulative.
2344 for found_dir in $ltrpathdirs; do
2345 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2346 done
2347 fi
2348 popdef([PACKLIBS])
2349 popdef([PACKUP])
2350 popdef([PACK])
2351 popdef([NAME])
2352 ])
2353
2354 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2355 dnl unless already present in VAR.
2356 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2357 dnl contains two or three consecutive elements that belong together.
2358 AC_DEFUN([AC_LIB_APPENDTOVAR],
2359 [
2360 for element in [$2]; do
2361 haveit=
2362 for x in $[$1]; do
2363 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2364 if test "X$x" = "X$element"; then
2365 haveit=yes
2366 break
2367 fi
2368 done
2369 if test -z "$haveit"; then
2370 [$1]="${[$1]}${[$1]:+ }$element"
2371 fi
2372 done
2373 ])
2374
2375 dnl For those cases where a variable contains several -L and -l options
2376 dnl referring to unknown libraries and directories, this macro determines the
2377 dnl necessary additional linker options for the runtime path.
2378 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
2379 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
2380 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
2381 dnl otherwise linking without libtool is assumed.
2382 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
2383 [
2384 AC_REQUIRE([AC_LIB_RPATH])
2385 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2386 $1=
2387 if test "$enable_rpath" != no; then
2388 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
2389 dnl Use an explicit option to hardcode directories into the resulting
2390 dnl binary.
2391 rpathdirs=
2392 next=
2393 for opt in $2; do
2394 if test -n "$next"; then
2395 dir="$next"
2396 dnl No need to hardcode the standard /usr/lib.
2397 if test "X$dir" != "X/usr/$acl_libdirstem" \
2398 && test "X$dir" != "X/usr/$acl_libdirstem2" \
2399 && test "X$dir" != "X/usr/$acl_libdirstem3"; then
2400 rpathdirs="$rpathdirs $dir"
2401 fi
2402 next=
2403 else
2404 case $opt in
2405 -L) next=yes ;;
2406 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
2407 dnl No need to hardcode the standard /usr/lib.
2408 if test "X$dir" != "X/usr/$acl_libdirstem" \
2409 && test "X$dir" != "X/usr/$acl_libdirstem2" \
2410 && test "X$dir" != "X/usr/$acl_libdirstem3"; then
2411 rpathdirs="$rpathdirs $dir"
2412 fi
2413 next= ;;
2414 *) next= ;;
2415 esac
2416 fi
2417 done
2418 if test "X$rpathdirs" != "X"; then
2419 if test -n ""$3""; then
2420 dnl libtool is used for linking. Use -R options.
2421 for dir in $rpathdirs; do
2422 $1="${$1}${$1:+ }-R$dir"
2423 done
2424 else
2425 dnl The linker is used for linking directly.
2426 if test -n "$acl_hardcode_libdir_separator"; then
2427 dnl Weird platform: only the last -rpath option counts, the user
2428 dnl must pass all path elements in one option.
2429 alldirs=
2430 for dir in $rpathdirs; do
2431 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
2432 done
2433 acl_save_libdir="$libdir"
2434 libdir="$alldirs"
2435 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2436 libdir="$acl_save_libdir"
2437 $1="$flag"
2438 else
2439 dnl The -rpath options are cumulative.
2440 for dir in $rpathdirs; do
2441 acl_save_libdir="$libdir"
2442 libdir="$dir"
2443 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2444 libdir="$acl_save_libdir"
2445 $1="${$1}${$1:+ }$flag"
2446 done
2447 fi
2448 fi
2449 fi
2450 fi
2451 fi
2452 AC_SUBST([$1])
2453 ])
2454
2455 # lib-prefix.m4 serial 20
2456 dnl Copyright (C) 2001-2005, 2008-2022 Free Software Foundation, Inc.
2457 dnl This file is free software; the Free Software Foundation
2458 dnl gives unlimited permission to copy and/or distribute it,
2459 dnl with or without modifications, as long as this notice is preserved.
2460
2461 dnl From Bruno Haible.
2462
2463 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2464 dnl to access previously installed libraries. The basic assumption is that
2465 dnl a user will want packages to use other packages he previously installed
2466 dnl with the same --prefix option.
2467 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2468 dnl libraries, but is otherwise very convenient.
2469 AC_DEFUN([AC_LIB_PREFIX],
2470 [
2471 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2472 AC_REQUIRE([AC_PROG_CC])
2473 AC_REQUIRE([AC_CANONICAL_HOST])
2474 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2475 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2476 dnl By default, look in $includedir and $libdir.
2477 use_additional=yes
2478 AC_LIB_WITH_FINAL_PREFIX([
2479 eval additional_includedir=\"$includedir\"
2480 eval additional_libdir=\"$libdir\"
2481 ])
2482 AC_ARG_WITH([lib-prefix],
2483 [[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2484 --without-lib-prefix don't search for libraries in includedir and libdir]],
2485 [
2486 if test "X$withval" = "Xno"; then
2487 use_additional=no
2488 else
2489 if test "X$withval" = "X"; then
2490 AC_LIB_WITH_FINAL_PREFIX([
2491 eval additional_includedir=\"$includedir\"
2492 eval additional_libdir=\"$libdir\"
2493 ])
2494 else
2495 additional_includedir="$withval/include"
2496 additional_libdir="$withval/$acl_libdirstem"
2497 fi
2498 fi
2499 ])
2500 if test $use_additional = yes; then
2501 dnl Potentially add $additional_includedir to $CPPFLAGS.
2502 dnl But don't add it
2503 dnl 1. if it's the standard /usr/include,
2504 dnl 2. if it's already present in $CPPFLAGS,
2505 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
2506 dnl 4. if it doesn't exist as a directory.
2507 if test "X$additional_includedir" != "X/usr/include"; then
2508 haveit=
2509 for x in $CPPFLAGS; do
2510 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2511 if test "X$x" = "X-I$additional_includedir"; then
2512 haveit=yes
2513 break
2514 fi
2515 done
2516 if test -z "$haveit"; then
2517 if test "X$additional_includedir" = "X/usr/local/include"; then
2518 if test -n "$GCC"; then
2519 case $host_os in
2520 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2521 esac
2522 fi
2523 fi
2524 if test -z "$haveit"; then
2525 if test -d "$additional_includedir"; then
2526 dnl Really add $additional_includedir to $CPPFLAGS.
2527 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2528 fi
2529 fi
2530 fi
2531 fi
2532 dnl Potentially add $additional_libdir to $LDFLAGS.
2533 dnl But don't add it
2534 dnl 1. if it's the standard /usr/lib,
2535 dnl 2. if it's already present in $LDFLAGS,
2536 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
2537 dnl 4. if it doesn't exist as a directory.
2538 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2539 haveit=
2540 for x in $LDFLAGS; do
2541 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2542 if test "X$x" = "X-L$additional_libdir"; then
2543 haveit=yes
2544 break
2545 fi
2546 done
2547 if test -z "$haveit"; then
2548 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2549 if test -n "$GCC"; then
2550 case $host_os in
2551 linux*) haveit=yes;;
2552 esac
2553 fi
2554 fi
2555 if test -z "$haveit"; then
2556 if test -d "$additional_libdir"; then
2557 dnl Really add $additional_libdir to $LDFLAGS.
2558 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2559 fi
2560 fi
2561 fi
2562 fi
2563 fi
2564 ])
2565
2566 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2567 dnl acl_final_exec_prefix, containing the values to which $prefix and
2568 dnl $exec_prefix will expand at the end of the configure script.
2569 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2570 [
2571 dnl Unfortunately, prefix and exec_prefix get only finally determined
2572 dnl at the end of configure.
2573 if test "X$prefix" = "XNONE"; then
2574 acl_final_prefix="$ac_default_prefix"
2575 else
2576 acl_final_prefix="$prefix"
2577 fi
2578 if test "X$exec_prefix" = "XNONE"; then
2579 acl_final_exec_prefix='${prefix}'
2580 else
2581 acl_final_exec_prefix="$exec_prefix"
2582 fi
2583 acl_save_prefix="$prefix"
2584 prefix="$acl_final_prefix"
2585 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2586 prefix="$acl_save_prefix"
2587 ])
2588
2589 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2590 dnl variables prefix and exec_prefix bound to the values they will have
2591 dnl at the end of the configure script.
2592 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2593 [
2594 acl_save_prefix="$prefix"
2595 prefix="$acl_final_prefix"
2596 acl_save_exec_prefix="$exec_prefix"
2597 exec_prefix="$acl_final_exec_prefix"
2598 $1
2599 exec_prefix="$acl_save_exec_prefix"
2600 prefix="$acl_save_prefix"
2601 ])
2602
2603 dnl AC_LIB_PREPARE_MULTILIB creates
2604 dnl - a function acl_is_expected_elfclass, that tests whether standard input
2605 dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
2606 dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
2607 dnl the basename of the libdir to try in turn, either "lib" or "lib64" or
2608 dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
2609 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
2610 [
2611 dnl There is no formal standard regarding lib, lib32, and lib64.
2612 dnl On most glibc systems, the current practice is that on a system supporting
2613 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2614 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
2615 dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
2616 dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
2617 dnl We determine the compiler's default mode by looking at the compiler's
2618 dnl library search path. If at least one of its elements ends in /lib64 or
2619 dnl points to a directory whose absolute pathname ends in /lib64, we use that
2620 dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
2621 dnl namely "lib".
2622 dnl On Solaris systems, the current practice is that on a system supporting
2623 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2624 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
2625 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
2626 AC_REQUIRE([AC_CANONICAL_HOST])
2627 AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
2628
2629 AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
2630 [AC_EGREP_CPP([Extensible Linking Format],
2631 [#if defined __ELF__ || (defined __linux__ && defined __EDG__)
2632 Extensible Linking Format
2633 #endif
2634 ],
2635 [gl_cv_elf=yes],
2636 [gl_cv_elf=no])
2637 ])
2638 if test $gl_cv_elf = yes; then
2639 # Extract the ELF class of a file (5th byte) in decimal.
2640 # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
2641 if od -A x < /dev/null >/dev/null 2>/dev/null; then
2642 # Use POSIX od.
2643 func_elfclass ()
2644 {
2645 od -A n -t d1 -j 4 -N 1
2646 }
2647 else
2648 # Use BSD hexdump.
2649 func_elfclass ()
2650 {
2651 dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
2652 echo
2653 }
2654 fi
2655 # Use 'expr', not 'test', to compare the values of func_elfclass, because on
2656 # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
2657 # not 1 or 2.
2658 changequote(,)dnl
2659 case $HOST_CPU_C_ABI_32BIT in
2660 yes)
2661 # 32-bit ABI.
2662 acl_is_expected_elfclass ()
2663 {
2664 expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null
2665 }
2666 ;;
2667 no)
2668 # 64-bit ABI.
2669 acl_is_expected_elfclass ()
2670 {
2671 expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null
2672 }
2673 ;;
2674 *)
2675 # Unknown.
2676 acl_is_expected_elfclass ()
2677 {
2678 :
2679 }
2680 ;;
2681 esac
2682 changequote([,])dnl
2683 else
2684 acl_is_expected_elfclass ()
2685 {
2686 :
2687 }
2688 fi
2689
2690 dnl Allow the user to override the result by setting acl_cv_libdirstems.
2691 AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
2692 [acl_cv_libdirstems],
2693 [dnl Try 'lib' first, because that's the default for libdir in GNU, see
2694 dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
2695 acl_libdirstem=lib
2696 acl_libdirstem2=
2697 acl_libdirstem3=
2698 case "$host_os" in
2699 solaris*)
2700 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
2701 dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
2702 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
2703 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
2704 dnl symlink is missing, so we set acl_libdirstem2 too.
2705 if test $HOST_CPU_C_ABI_32BIT = no; then
2706 acl_libdirstem2=lib/64
2707 case "$host_cpu" in
2708 sparc*) acl_libdirstem3=lib/sparcv9 ;;
2709 i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
2710 esac
2711 fi
2712 ;;
2713 *)
2714 dnl If $CC generates code for a 32-bit ABI, the libraries are
2715 dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
2716 dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
2717 dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
2718 dnl Find the compiler's search path. However, non-system compilers
2719 dnl sometimes have odd library search paths. But we can't simply invoke
2720 dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
2721 dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
2722 searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
2723 | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
2724 if test $HOST_CPU_C_ABI_32BIT != no; then
2725 # 32-bit or unknown ABI.
2726 if test -d /usr/lib32; then
2727 acl_libdirstem2=lib32
2728 fi
2729 fi
2730 if test $HOST_CPU_C_ABI_32BIT != yes; then
2731 # 64-bit or unknown ABI.
2732 if test -d /usr/lib64; then
2733 acl_libdirstem3=lib64
2734 fi
2735 fi
2736 if test -n "$searchpath"; then
2737 acl_save_IFS="${IFS= }"; IFS=":"
2738 for searchdir in $searchpath; do
2739 if test -d "$searchdir"; then
2740 case "$searchdir" in
2741 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
2742 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
2743 */../ | */.. )
2744 # Better ignore directories of this form. They are misleading.
2745 ;;
2746 *) searchdir=`cd "$searchdir" && pwd`
2747 case "$searchdir" in
2748 */lib32 ) acl_libdirstem2=lib32 ;;
2749 */lib64 ) acl_libdirstem3=lib64 ;;
2750 esac ;;
2751 esac
2752 fi
2753 done
2754 IFS="$acl_save_IFS"
2755 if test $HOST_CPU_C_ABI_32BIT = yes; then
2756 # 32-bit ABI.
2757 acl_libdirstem3=
2758 fi
2759 if test $HOST_CPU_C_ABI_32BIT = no; then
2760 # 64-bit ABI.
2761 acl_libdirstem2=
2762 fi
2763 fi
2764 ;;
2765 esac
2766 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
2767 test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
2768 acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
2769 ])
2770 dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
2771 dnl acl_libdirstem3.
2772 changequote(,)dnl
2773 acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
2774 acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
2775 acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
2776 changequote([,])dnl
2777 ])
2778
2779 # nls.m4 serial 6 (gettext-0.20.2)
2780 dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2022 Free
2781 dnl Software Foundation, Inc.
2782 dnl This file is free software; the Free Software Foundation
2783 dnl gives unlimited permission to copy and/or distribute it,
2784 dnl with or without modifications, as long as this notice is preserved.
2785 dnl
2786 dnl This file can be used in projects which are not available under
2787 dnl the GNU General Public License or the GNU Lesser General Public
2788 dnl License but which still want to provide support for the GNU gettext
2789 dnl functionality.
2790 dnl Please note that the actual code of the GNU gettext library is covered
2791 dnl by the GNU Lesser General Public License, and the rest of the GNU
2792 dnl gettext package is covered by the GNU General Public License.
2793 dnl They are *not* in the public domain.
2794
2795 dnl Authors:
2796 dnl Ulrich Drepper <[email protected]>, 1995-2000.
2797 dnl Bruno Haible <[email protected]>, 2000-2003.
2798
2799 AC_PREREQ([2.50])
2800
2801 AC_DEFUN([AM_NLS],
2802 [
2803 AC_MSG_CHECKING([whether NLS is requested])
2804 dnl Default is enabled NLS
2805 AC_ARG_ENABLE([nls],
2806 [ --disable-nls do not use Native Language Support],
2807 USE_NLS=$enableval, USE_NLS=yes)
2808 AC_MSG_RESULT([$USE_NLS])
2809 AC_SUBST([USE_NLS])
2810 ])
2811
2812 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2813 # serial 11 (pkg-config-0.29.1)
2814
2815 dnl Copyright © 2004 Scott James Remnant <[email protected]>.
2816 dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
2817 dnl
2818 dnl This program is free software; you can redistribute it and/or modify
2819 dnl it under the terms of the GNU General Public License as published by
2820 dnl the Free Software Foundation; either version 2 of the License, or
2821 dnl (at your option) any later version.
2822 dnl
2823 dnl This program is distributed in the hope that it will be useful, but
2824 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
2825 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2826 dnl General Public License for more details.
2827 dnl
2828 dnl You should have received a copy of the GNU General Public License
2829 dnl along with this program; if not, write to the Free Software
2830 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2831 dnl 02111-1307, USA.
2832 dnl
2833 dnl As a special exception to the GNU General Public License, if you
2834 dnl distribute this file as part of a program that contains a
2835 dnl configuration script generated by Autoconf, you may include it under
2836 dnl the same distribution terms that you use for the rest of that
2837 dnl program.
2838
2839 dnl PKG_PREREQ(MIN-VERSION)
2840 dnl -----------------------
2841 dnl Since: 0.29
2842 dnl
2843 dnl Verify that the version of the pkg-config macros are at least
2844 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
2845 dnl installed version of pkg-config, this checks the developer's version
2846 dnl of pkg.m4 when generating configure.
2847 dnl
2848 dnl To ensure that this macro is defined, also add:
2849 dnl m4_ifndef([PKG_PREREQ],
2850 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
2851 dnl
2852 dnl See the "Since" comment for each macro you use to see what version
2853 dnl of the macros you require.
2854 m4_defun([PKG_PREREQ],
2855 [m4_define([PKG_MACROS_VERSION], [0.29.1])
2856 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
2857 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
2858 ])dnl PKG_PREREQ
2859
2860 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
2861 dnl ----------------------------------
2862 dnl Since: 0.16
2863 dnl
2864 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
2865 dnl first found in the path. Checks that the version of pkg-config found
2866 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
2867 dnl used since that's the first version where most current features of
2868 dnl pkg-config existed.
2869 AC_DEFUN([PKG_PROG_PKG_CONFIG],
2870 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2871 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
2872 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
2873 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
2874 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
2875 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
2876
2877 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2878 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2879 fi
2880 if test -n "$PKG_CONFIG"; then
2881 _pkg_min_version=m4_default([$1], [0.9.0])
2882 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2883 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2884 AC_MSG_RESULT([yes])
2885 else
2886 AC_MSG_RESULT([no])
2887 PKG_CONFIG=""
2888 fi
2889 fi[]dnl
2890 ])dnl PKG_PROG_PKG_CONFIG
2891
2892 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2893 dnl -------------------------------------------------------------------
2894 dnl Since: 0.18
2895 dnl
2896 dnl Check to see whether a particular set of modules exists. Similar to
2897 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
2898 dnl
2899 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2900 dnl only at the first occurence in configure.ac, so if the first place
2901 dnl it's called might be skipped (such as if it is within an "if", you
2902 dnl have to call PKG_CHECK_EXISTS manually
2903 AC_DEFUN([PKG_CHECK_EXISTS],
2904 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2905 if test -n "$PKG_CONFIG" && \
2906 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2907 m4_default([$2], [:])
2908 m4_ifvaln([$3], [else
2909 $3])dnl
2910 fi])
2911
2912 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2913 dnl ---------------------------------------------
2914 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
2915 dnl pkg_failed based on the result.
2916 m4_define([_PKG_CONFIG],
2917 [if test -n "$$1"; then
2918 pkg_cv_[]$1="$$1"
2919 elif test -n "$PKG_CONFIG"; then
2920 PKG_CHECK_EXISTS([$3],
2921 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
2922 test "x$?" != "x0" && pkg_failed=yes ],
2923 [pkg_failed=yes])
2924 else
2925 pkg_failed=untried
2926 fi[]dnl
2927 ])dnl _PKG_CONFIG
2928
2929 dnl _PKG_SHORT_ERRORS_SUPPORTED
2930 dnl ---------------------------
2931 dnl Internal check to see if pkg-config supports short errors.
2932 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2933 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2934 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2935 _pkg_short_errors_supported=yes
2936 else
2937 _pkg_short_errors_supported=no
2938 fi[]dnl
2939 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
2940
2941
2942 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2943 dnl [ACTION-IF-NOT-FOUND])
2944 dnl --------------------------------------------------------------
2945 dnl Since: 0.4.0
2946 dnl
2947 dnl Note that if there is a possibility the first call to
2948 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
2949 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2950 AC_DEFUN([PKG_CHECK_MODULES],
2951 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2952 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2953 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2954
2955 pkg_failed=no
2956 AC_MSG_CHECKING([for $1])
2957
2958 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2959 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
2960
2961 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2962 and $1[]_LIBS to avoid the need to call pkg-config.
2963 See the pkg-config man page for more details.])
2964
2965 if test $pkg_failed = yes; then
2966 AC_MSG_RESULT([no])
2967 _PKG_SHORT_ERRORS_SUPPORTED
2968 if test $_pkg_short_errors_supported = yes; then
2969 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
2970 else
2971 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
2972 fi
2973 # Put the nasty error message in config.log where it belongs
2974 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2975
2976 m4_default([$4], [AC_MSG_ERROR(
2977 [Package requirements ($2) were not met:
2978
2979 $$1_PKG_ERRORS
2980
2981 Consider adjusting the PKG_CONFIG_PATH environment variable if you
2982 installed software in a non-standard prefix.
2983
2984 _PKG_TEXT])[]dnl
2985 ])
2986 elif test $pkg_failed = untried; then
2987 AC_MSG_RESULT([no])
2988 m4_default([$4], [AC_MSG_FAILURE(
2989 [The pkg-config script could not be found or is too old. Make sure it
2990 is in your PATH or set the PKG_CONFIG environment variable to the full
2991 path to pkg-config.
2992
2993 _PKG_TEXT
2994
2995 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
2996 ])
2997 else
2998 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2999 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
3000 AC_MSG_RESULT([yes])
3001 $3
3002 fi[]dnl
3003 ])dnl PKG_CHECK_MODULES
3004
3005
3006 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
3007 dnl [ACTION-IF-NOT-FOUND])
3008 dnl ---------------------------------------------------------------------
3009 dnl Since: 0.29
3010 dnl
3011 dnl Checks for existence of MODULES and gathers its build flags with
3012 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
3013 dnl and VARIABLE-PREFIX_LIBS from --libs.
3014 dnl
3015 dnl Note that if there is a possibility the first call to
3016 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
3017 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
3018 dnl configure.ac.
3019 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
3020 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3021 _save_PKG_CONFIG=$PKG_CONFIG
3022 PKG_CONFIG="$PKG_CONFIG --static"
3023 PKG_CHECK_MODULES($@)
3024 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
3025 ])dnl PKG_CHECK_MODULES_STATIC
3026
3027
3028 dnl PKG_INSTALLDIR([DIRECTORY])
3029 dnl -------------------------
3030 dnl Since: 0.27
3031 dnl
3032 dnl Substitutes the variable pkgconfigdir as the location where a module
3033 dnl should install pkg-config .pc files. By default the directory is
3034 dnl $libdir/pkgconfig, but the default can be changed by passing
3035 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
3036 dnl parameter.
3037 AC_DEFUN([PKG_INSTALLDIR],
3038 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
3039 m4_pushdef([pkg_description],
3040 [pkg-config installation directory @<:@]pkg_default[@:>@])
3041 AC_ARG_WITH([pkgconfigdir],
3042 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
3043 [with_pkgconfigdir=]pkg_default)
3044 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
3045 m4_popdef([pkg_default])
3046 m4_popdef([pkg_description])
3047 ])dnl PKG_INSTALLDIR
3048
3049
3050 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
3051 dnl --------------------------------
3052 dnl Since: 0.27
3053 dnl
3054 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
3055 dnl module should install arch-independent pkg-config .pc files. By
3056 dnl default the directory is $datadir/pkgconfig, but the default can be
3057 dnl changed by passing DIRECTORY. The user can override through the
3058 dnl --with-noarch-pkgconfigdir parameter.
3059 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
3060 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
3061 m4_pushdef([pkg_description],
3062 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
3063 AC_ARG_WITH([noarch-pkgconfigdir],
3064 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
3065 [with_noarch_pkgconfigdir=]pkg_default)
3066 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
3067 m4_popdef([pkg_default])
3068 m4_popdef([pkg_description])
3069 ])dnl PKG_NOARCH_INSTALLDIR
3070
3071
3072 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
3073 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3074 dnl -------------------------------------------
3075 dnl Since: 0.28
3076 dnl
3077 dnl Retrieves the value of the pkg-config variable for the given module.
3078 AC_DEFUN([PKG_CHECK_VAR],
3079 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3080 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
3081
3082 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
3083 AS_VAR_COPY([$1], [pkg_cv_][$1])
3084
3085 AS_VAR_IF([$1], [""], [$5], [$4])dnl
3086 ])dnl PKG_CHECK_VAR
3087
3088 dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
3089 dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
3090 dnl [DESCRIPTION], [DEFAULT])
3091 dnl ------------------------------------------
3092 dnl
3093 dnl Prepare a "--with-" configure option using the lowercase
3094 dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
3095 dnl PKG_CHECK_MODULES in a single macro.
3096 AC_DEFUN([PKG_WITH_MODULES],
3097 [
3098 m4_pushdef([with_arg], m4_tolower([$1]))
3099
3100 m4_pushdef([description],
3101 [m4_default([$5], [build with ]with_arg[ support])])
3102
3103 m4_pushdef([def_arg], [m4_default([$6], [auto])])
3104 m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
3105 m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
3106
3107 m4_case(def_arg,
3108 [yes],[m4_pushdef([with_without], [--without-]with_arg)],
3109 [m4_pushdef([with_without],[--with-]with_arg)])
3110
3111 AC_ARG_WITH(with_arg,
3112 AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
3113 [AS_TR_SH([with_]with_arg)=def_arg])
3114
3115 AS_CASE([$AS_TR_SH([with_]with_arg)],
3116 [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
3117 [auto],[PKG_CHECK_MODULES([$1],[$2],
3118 [m4_n([def_action_if_found]) $3],
3119 [m4_n([def_action_if_not_found]) $4])])
3120
3121 m4_popdef([with_arg])
3122 m4_popdef([description])
3123 m4_popdef([def_arg])
3124
3125 ])dnl PKG_WITH_MODULES
3126
3127 dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
3128 dnl [DESCRIPTION], [DEFAULT])
3129 dnl -----------------------------------------------
3130 dnl
3131 dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
3132 dnl check._[VARIABLE-PREFIX] is exported as make variable.
3133 AC_DEFUN([PKG_HAVE_WITH_MODULES],
3134 [
3135 PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
3136
3137 AM_CONDITIONAL([HAVE_][$1],
3138 [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
3139 ])dnl PKG_HAVE_WITH_MODULES
3140
3141 dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
3142 dnl [DESCRIPTION], [DEFAULT])
3143 dnl ------------------------------------------------------
3144 dnl
3145 dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
3146 dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
3147 dnl and preprocessor variable.
3148 AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
3149 [
3150 PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
3151
3152 AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
3153 [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
3154 ])dnl PKG_HAVE_DEFINE_WITH_MODULES
3155
3156 # po.m4 serial 32 (gettext-0.21.1)
3157 dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
3158 dnl This file is free software; the Free Software Foundation
3159 dnl gives unlimited permission to copy and/or distribute it,
3160 dnl with or without modifications, as long as this notice is preserved.
3161 dnl
3162 dnl This file can be used in projects which are not available under
3163 dnl the GNU General Public License or the GNU Lesser General Public
3164 dnl License but which still want to provide support for the GNU gettext
3165 dnl functionality.
3166 dnl Please note that the actual code of the GNU gettext library is covered
3167 dnl by the GNU Lesser General Public License, and the rest of the GNU
3168 dnl gettext package is covered by the GNU General Public License.
3169 dnl They are *not* in the public domain.
3170
3171 dnl Authors:
3172 dnl Ulrich Drepper <[email protected]>, 1995-2000.
3173 dnl Bruno Haible <[email protected]>, 2000-2003.
3174
3175 AC_PREREQ([2.60])
3176
3177 dnl Checks for all prerequisites of the po subdirectory.
3178 AC_DEFUN([AM_PO_SUBDIRS],
3179 [
3180 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3181 AC_REQUIRE([AC_PROG_INSTALL])dnl
3182 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3183 AC_REQUIRE([AC_PROG_SED])dnl
3184 AC_REQUIRE([AM_NLS])dnl
3185
3186 dnl Release version of the gettext macros. This is used to ensure that
3187 dnl the gettext macros and po/Makefile.in.in are in sync.
3188 AC_SUBST([GETTEXT_MACRO_VERSION], [0.20])
3189
3190 dnl Perform the following tests also if --disable-nls has been given,
3191 dnl because they are needed for "make dist" to work.
3192
3193 dnl Search for GNU msgfmt in the PATH.
3194 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
3195 dnl The second test excludes FreeBSD msgfmt.
3196 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
3197 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3198 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3199 :)
3200 AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
3201
3202 dnl Test whether it is GNU msgfmt >= 0.15.
3203 changequote(,)dnl
3204 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3205 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
3206 *) GMSGFMT_015=$GMSGFMT ;;
3207 esac
3208 changequote([,])dnl
3209 AC_SUBST([GMSGFMT_015])
3210
3211 dnl Search for GNU xgettext 0.12 or newer in the PATH.
3212 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
3213 dnl The second test excludes FreeBSD xgettext.
3214 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
3215 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3216 (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3217 :)
3218 dnl Remove leftover from FreeBSD xgettext call.
3219 rm -f messages.po
3220
3221 dnl Test whether it is GNU xgettext >= 0.15.
3222 changequote(,)dnl
3223 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3224 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
3225 *) XGETTEXT_015=$XGETTEXT ;;
3226 esac
3227 changequote([,])dnl
3228 AC_SUBST([XGETTEXT_015])
3229
3230 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
3231 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
3232 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
3233
3234 dnl Test whether it is GNU msgmerge >= 0.20.
3235 if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
3236 MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
3237 else
3238 dnl Test whether it is GNU msgmerge >= 0.12.
3239 if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
3240 MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
3241 else
3242 dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is
3243 dnl slow. But this is not a big problem, as such old gettext versions are
3244 dnl hardly in use any more.
3245 MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
3246 fi
3247 fi
3248 AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION])
3249
3250 dnl Support for AM_XGETTEXT_OPTION.
3251 test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
3252 AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
3253
3254 AC_CONFIG_COMMANDS([po-directories], [[
3255 for ac_file in $CONFIG_FILES; do
3256 # Support "outfile[:infile[:infile...]]"
3257 case "$ac_file" in
3258 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3259 esac
3260 # PO directories have a Makefile.in generated from Makefile.in.in.
3261 case "$ac_file" in */Makefile.in)
3262 # Adjust a relative srcdir.
3263 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3264 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
3265 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3266 # In autoconf-2.13 it is called $ac_given_srcdir.
3267 # In autoconf-2.50 it is called $srcdir.
3268 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3269 case "$ac_given_srcdir" in
3270 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3271 /*) top_srcdir="$ac_given_srcdir" ;;
3272 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3273 esac
3274 # Treat a directory as a PO directory if and only if it has a
3275 # POTFILES.in file. This allows packages to have multiple PO
3276 # directories under different names or in different locations.
3277 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
3278 rm -f "$ac_dir/POTFILES"
3279 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
3280 gt_tab=`printf '\t'`
3281 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
3282 POMAKEFILEDEPS="POTFILES.in"
3283 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
3284 # on $ac_dir but don't depend on user-specified configuration
3285 # parameters.
3286 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3287 # The LINGUAS file contains the set of available languages.
3288 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3289 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3290 fi
3291 ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3292 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3293 else
3294 # The set of available languages was given in configure.in.
3295 ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
3296 fi
3297 # Compute POFILES
3298 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3299 # Compute UPDATEPOFILES
3300 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3301 # Compute DUMMYPOFILES
3302 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3303 # Compute GMOFILES
3304 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3305 case "$ac_given_srcdir" in
3306 .) srcdirpre= ;;
3307 *) srcdirpre='$(srcdir)/' ;;
3308 esac
3309 POFILES=
3310 UPDATEPOFILES=
3311 DUMMYPOFILES=
3312 GMOFILES=
3313 for lang in $ALL_LINGUAS; do
3314 POFILES="$POFILES $srcdirpre$lang.po"
3315 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3316 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3317 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3318 done
3319 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3320 # environment variable.
3321 INST_LINGUAS=
3322 if test -n "$ALL_LINGUAS"; then
3323 for presentlang in $ALL_LINGUAS; do
3324 useit=no
3325 if test "%UNSET%" != "$LINGUAS"; then
3326 desiredlanguages="$LINGUAS"
3327 else
3328 desiredlanguages="$ALL_LINGUAS"
3329 fi
3330 for desiredlang in $desiredlanguages; do
3331 # Use the presentlang catalog if desiredlang is
3332 # a. equal to presentlang, or
3333 # b. a variant of presentlang (because in this case,
3334 # presentlang can be used as a fallback for messages
3335 # which are not translated in the desiredlang catalog).
3336 case "$desiredlang" in
3337 "$presentlang" | "$presentlang"_* | "$presentlang".* | "$presentlang"@*)
3338 useit=yes
3339 ;;
3340 esac
3341 done
3342 if test $useit = yes; then
3343 INST_LINGUAS="$INST_LINGUAS $presentlang"
3344 fi
3345 done
3346 fi
3347 CATALOGS=
3348 if test -n "$INST_LINGUAS"; then
3349 for lang in $INST_LINGUAS; do
3350 CATALOGS="$CATALOGS $lang.gmo"
3351 done
3352 fi
3353 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
3354 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
3355 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
3356 if test -f "$f"; then
3357 case "$f" in
3358 *.orig | *.bak | *~) ;;
3359 *) cat "$f" >> "$ac_dir/Makefile" ;;
3360 esac
3361 fi
3362 done
3363 fi
3364 ;;
3365 esac
3366 done]],
3367 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
3368 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
3369 OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
3370 # Capture the value of LINGUAS because we need it to compute CATALOGS.
3371 LINGUAS="${LINGUAS-%UNSET%}"
3372 ])
3373 ])
3374
3375 dnl Postprocesses a Makefile in a directory containing PO files.
3376 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
3377 [
3378 # When this code is run, in config.status, two variables have already been
3379 # set:
3380 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
3381 # - LINGUAS is the value of the environment variable LINGUAS at configure
3382 # time.
3383
3384 changequote(,)dnl
3385 # Adjust a relative srcdir.
3386 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3387 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
3388 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3389 # In autoconf-2.13 it is called $ac_given_srcdir.
3390 # In autoconf-2.50 it is called $srcdir.
3391 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3392 case "$ac_given_srcdir" in
3393 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3394 /*) top_srcdir="$ac_given_srcdir" ;;
3395 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3396 esac
3397
3398 # Find a way to echo strings without interpreting backslash.
3399 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
3400 gt_echo='echo'
3401 else
3402 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
3403 gt_echo='printf %s\n'
3404 else
3405 echo_func () {
3406 cat <<EOT
3407 $*
3408 EOT
3409 }
3410 gt_echo='echo_func'
3411 fi
3412 fi
3413
3414 # A sed script that extracts the value of VARIABLE from a Makefile.
3415 tab=`printf '\t'`
3416 sed_x_variable='
3417 # Test if the hold space is empty.
3418 x
3419 s/P/P/
3420 x
3421 ta
3422 # Yes it was empty. Look if we have the expected variable definition.
3423 /^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
3424 # Seen the first line of the variable definition.
3425 s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
3426 ba
3427 }
3428 bd
3429 :a
3430 # Here we are processing a line from the variable definition.
3431 # Remove comment, more precisely replace it with a space.
3432 s/#.*$/ /
3433 # See if the line ends in a backslash.
3434 tb
3435 :b
3436 s/\\$//
3437 # Print the line, without the trailing backslash.
3438 p
3439 tc
3440 # There was no trailing backslash. The end of the variable definition is
3441 # reached. Clear the hold space.
3442 s/^.*$//
3443 x
3444 bd
3445 :c
3446 # A trailing backslash means that the variable definition continues in the
3447 # next line. Put a nonempty string into the hold space to indicate this.
3448 s/^.*$/P/
3449 x
3450 :d
3451 '
3452 changequote([,])dnl
3453
3454 # Set POTFILES to the value of the Makefile variable POTFILES.
3455 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
3456 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
3457 # Compute POTFILES_DEPS as
3458 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
3459 POTFILES_DEPS=
3460 for file in $POTFILES; do
3461 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
3462 done
3463 POMAKEFILEDEPS=""
3464
3465 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3466 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3467 fi
3468 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3469 # The LINGUAS file contains the set of available languages.
3470 ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3471 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3472 else
3473 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
3474 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
3475 ALL_LINGUAS=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
3476 fi
3477 # Compute POFILES
3478 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3479 # Compute UPDATEPOFILES
3480 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3481 # Compute DUMMYPOFILES
3482 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3483 # Compute GMOFILES
3484 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3485 # Compute PROPERTIESFILES
3486 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties)
3487 # Compute CLASSFILES
3488 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class)
3489 # Compute QMFILES
3490 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
3491 # Compute MSGFILES
3492 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
3493 # Compute RESOURCESDLLFILES
3494 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
3495 case "$ac_given_srcdir" in
3496 .) srcdirpre= ;;
3497 *) srcdirpre='$(srcdir)/' ;;
3498 esac
3499 POFILES=
3500 UPDATEPOFILES=
3501 DUMMYPOFILES=
3502 GMOFILES=
3503 PROPERTIESFILES=
3504 CLASSFILES=
3505 QMFILES=
3506 MSGFILES=
3507 RESOURCESDLLFILES=
3508 for lang in $ALL_LINGUAS; do
3509 POFILES="$POFILES $srcdirpre$lang.po"
3510 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3511 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3512 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3513 PROPERTIESFILES="$PROPERTIESFILES \$(srcdir)/\$(DOMAIN)_$lang.properties"
3514 CLASSFILES="$CLASSFILES \$(srcdir)/\$(DOMAIN)_$lang.class"
3515 QMFILES="$QMFILES $srcdirpre$lang.qm"
3516 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3517 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
3518 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3519 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
3520 done
3521 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3522 # environment variable.
3523 INST_LINGUAS=
3524 if test -n "$ALL_LINGUAS"; then
3525 for presentlang in $ALL_LINGUAS; do
3526 useit=no
3527 if test "%UNSET%" != "$LINGUAS"; then
3528 desiredlanguages="$LINGUAS"
3529 else
3530 desiredlanguages="$ALL_LINGUAS"
3531 fi
3532 for desiredlang in $desiredlanguages; do
3533 # Use the presentlang catalog if desiredlang is
3534 # a. equal to presentlang, or
3535 # b. a variant of presentlang (because in this case,
3536 # presentlang can be used as a fallback for messages
3537 # which are not translated in the desiredlang catalog).
3538 case "$desiredlang" in
3539 "$presentlang" | "$presentlang"_* | "$presentlang".* | "$presentlang"@*)
3540 useit=yes
3541 ;;
3542 esac
3543 done
3544 if test $useit = yes; then
3545 INST_LINGUAS="$INST_LINGUAS $presentlang"
3546 fi
3547 done
3548 fi
3549 CATALOGS=
3550 JAVACATALOGS=
3551 QTCATALOGS=
3552 TCLCATALOGS=
3553 CSHARPCATALOGS=
3554 if test -n "$INST_LINGUAS"; then
3555 for lang in $INST_LINGUAS; do
3556 CATALOGS="$CATALOGS $lang.gmo"
3557 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
3558 QTCATALOGS="$QTCATALOGS $lang.qm"
3559 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3560 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
3561 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3562 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
3563 done
3564 fi
3565
3566 sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
3567 tab=`printf '\t'`
3568 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
3569 # Add dependencies that cannot be formulated as a simple suffix rule.
3570 for lang in $ALL_LINGUAS; do
3571 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3572 cat >> "$ac_file.tmp" <<EOF
3573 $frobbedlang.msg: $lang.po
3574 ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
3575 ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3576 EOF
3577 done
3578 fi
3579 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
3580 # Add dependencies that cannot be formulated as a simple suffix rule.
3581 for lang in $ALL_LINGUAS; do
3582 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3583 cat >> "$ac_file.tmp" <<EOF
3584 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
3585 ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
3586 ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3587 EOF
3588 done
3589 fi
3590 if test -n "$POMAKEFILEDEPS"; then
3591 cat >> "$ac_file.tmp" <<EOF
3592 Makefile: $POMAKEFILEDEPS
3593 EOF
3594 fi
3595 mv "$ac_file.tmp" "$ac_file"
3596 ])
3597
3598 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
3599 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
3600 [
3601 XGETTEXT_EXTRA_OPTIONS=
3602 ])
3603
3604 dnl Registers an option to be passed to xgettext in the po subdirectory.
3605 AC_DEFUN([AM_XGETTEXT_OPTION],
3606 [
3607 AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
3608 XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
3609 ])
3610
3611 # progtest.m4 serial 9 (gettext-0.21.1)
3612 dnl Copyright (C) 1996-2003, 2005, 2008-2022 Free Software Foundation, Inc.
3613 dnl This file is free software; the Free Software Foundation
3614 dnl gives unlimited permission to copy and/or distribute it,
3615 dnl with or without modifications, as long as this notice is preserved.
3616 dnl
3617 dnl This file can be used in projects which are not available under
3618 dnl the GNU General Public License or the GNU Lesser General Public
3619 dnl License but which still want to provide support for the GNU gettext
3620 dnl functionality.
3621 dnl Please note that the actual code of the GNU gettext library is covered
3622 dnl by the GNU Lesser General Public License, and the rest of the GNU
3623 dnl gettext package is covered by the GNU General Public License.
3624 dnl They are *not* in the public domain.
3625
3626 dnl Authors:
3627 dnl Ulrich Drepper <[email protected]>, 1996.
3628
3629 AC_PREREQ([2.53])
3630
3631 # Search path for a program which passes the given test.
3632
3633 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3634 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3635 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3636 [
3637 # Prepare PATH_SEPARATOR.
3638 # The user is always right.
3639 if test "${PATH_SEPARATOR+set}" != set; then
3640 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
3641 # contains only /bin. Note that ksh looks also at the FPATH variable,
3642 # so we have to set that as well for the test.
3643 PATH_SEPARATOR=:
3644 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
3645 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
3646 || PATH_SEPARATOR=';'
3647 }
3648 fi
3649
3650 # Find out how to test for executable files. Don't use a zero-byte file,
3651 # as systems may use methods other than mode bits to determine executability.
3652 cat >conf$$.file <<_ASEOF
3653 #! /bin/sh
3654 exit 0
3655 _ASEOF
3656 chmod +x conf$$.file
3657 if test -x conf$$.file >/dev/null 2>&1; then
3658 ac_executable_p="test -x"
3659 else
3660 ac_executable_p="test -f"
3661 fi
3662 rm -f conf$$.file
3663
3664 # Extract the first word of "$2", so it can be a program name with args.
3665 set dummy $2; ac_word=[$]2
3666 AC_MSG_CHECKING([for $ac_word])
3667 AC_CACHE_VAL([ac_cv_path_$1],
3668 [case "[$]$1" in
3669 [[\\/]]* | ?:[[\\/]]*)
3670 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3671 ;;
3672 *)
3673 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
3674 for ac_dir in m4_if([$5], , $PATH, [$5]); do
3675 IFS="$ac_save_IFS"
3676 test -z "$ac_dir" && ac_dir=.
3677 for ac_exec_ext in '' $ac_executable_extensions; do
3678 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
3679 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
3680 if [$3]; then
3681 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
3682 break 2
3683 fi
3684 fi
3685 done
3686 done
3687 IFS="$ac_save_IFS"
3688 dnl If no 4th arg is given, leave the cache variable unset,
3689 dnl so AC_PATH_PROGS will keep looking.
3690 m4_if([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3691 ])dnl
3692 ;;
3693 esac])dnl
3694 $1="$ac_cv_path_$1"
3695 if test m4_if([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
3696 AC_MSG_RESULT([$][$1])
3697 else
3698 AC_MSG_RESULT([no])
3699 fi
3700 AC_SUBST([$1])dnl
3701 ])
3702
3703 # Copyright (C) 2002-2021 Free Software Foundation, Inc.
3704 #
3705 # This file is free software; the Free Software Foundation
3706 # gives unlimited permission to copy and/or distribute it,
3707 # with or without modifications, as long as this notice is preserved.
3708
3709 # AM_AUTOMAKE_VERSION(VERSION)
3710 # ----------------------------
3711 # Automake X.Y traces this macro to ensure aclocal.m4 has been
3712 # generated from the m4 files accompanying Automake X.Y.
3713 # (This private macro should not be called outside this file.)
3714 AC_DEFUN([AM_AUTOMAKE_VERSION],
3715 [am__api_version='1.16'
3716 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3717 dnl require some minimum version. Point them to the right macro.
3718 m4_if([$1], [1.16.5], [],
3719 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3720 ])
3721
3722 # _AM_AUTOCONF_VERSION(VERSION)
3723 # -----------------------------
3724 # aclocal traces this macro to find the Autoconf version.
3725 # This is a private macro too. Using m4_define simplifies
3726 # the logic in aclocal, which can simply ignore this definition.
3727 m4_define([_AM_AUTOCONF_VERSION], [])
3728
3729 # AM_SET_CURRENT_AUTOMAKE_VERSION
3730 # -------------------------------
3731 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
3732 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
3733 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
3734 [AM_AUTOMAKE_VERSION([1.16.5])dnl
3735 m4_ifndef([AC_AUTOCONF_VERSION],
3736 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
3737 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
3738
3739 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
3740
3741 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
3742 #
3743 # This file is free software; the Free Software Foundation
3744 # gives unlimited permission to copy and/or distribute it,
3745 # with or without modifications, as long as this notice is preserved.
3746
3747 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
3748 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
3749 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
3750 #
3751 # Of course, Automake must honor this variable whenever it calls a
3752 # tool from the auxiliary directory. The problem is that $srcdir (and
3753 # therefore $ac_aux_dir as well) can be either absolute or relative,
3754 # depending on how configure is run. This is pretty annoying, since
3755 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
3756 # source directory, any form will work fine, but in subdirectories a
3757 # relative path needs to be adjusted first.
3758 #
3759 # $ac_aux_dir/missing
3760 # fails when called from a subdirectory if $ac_aux_dir is relative
3761 # $top_srcdir/$ac_aux_dir/missing
3762 # fails if $ac_aux_dir is absolute,
3763 # fails when called from a subdirectory in a VPATH build with
3764 # a relative $ac_aux_dir
3765 #
3766 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
3767 # are both prefixed by $srcdir. In an in-source build this is usually
3768 # harmless because $srcdir is '.', but things will broke when you
3769 # start a VPATH build or use an absolute $srcdir.
3770 #
3771 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
3772 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
3773 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
3774 # and then we would define $MISSING as
3775 # MISSING="\${SHELL} $am_aux_dir/missing"
3776 # This will work as long as MISSING is not called from configure, because
3777 # unfortunately $(top_srcdir) has no meaning in configure.
3778 # However there are other variables, like CC, which are often used in
3779 # configure, and could therefore not use this "fixed" $ac_aux_dir.
3780 #
3781 # Another solution, used here, is to always expand $ac_aux_dir to an
3782 # absolute PATH. The drawback is that using absolute paths prevent a
3783 # configured tree to be moved without reconfiguration.
3784
3785 AC_DEFUN([AM_AUX_DIR_EXPAND],
3786 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3787 # Expand $ac_aux_dir to an absolute path.
3788 am_aux_dir=`cd "$ac_aux_dir" && pwd`
3789 ])
3790
3791 # AM_CONDITIONAL -*- Autoconf -*-
3792
3793 # Copyright (C) 1997-2021 Free Software Foundation, Inc.
3794 #
3795 # This file is free software; the Free Software Foundation
3796 # gives unlimited permission to copy and/or distribute it,
3797 # with or without modifications, as long as this notice is preserved.
3798
3799 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
3800 # -------------------------------------
3801 # Define a conditional.
3802 AC_DEFUN([AM_CONDITIONAL],
3803 [AC_PREREQ([2.52])dnl
3804 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
3805 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
3806 AC_SUBST([$1_TRUE])dnl
3807 AC_SUBST([$1_FALSE])dnl
3808 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
3809 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
3810 m4_define([_AM_COND_VALUE_$1], [$2])dnl
3811 if $2; then
3812 $1_TRUE=
3813 $1_FALSE='#'
3814 else
3815 $1_TRUE='#'
3816 $1_FALSE=
3817 fi
3818 AC_CONFIG_COMMANDS_PRE(
3819 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
3820 AC_MSG_ERROR([[conditional "$1" was never defined.
3821 Usually this means the macro was only invoked conditionally.]])
3822 fi])])
3823
3824 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
3825 #
3826 # This file is free software; the Free Software Foundation
3827 # gives unlimited permission to copy and/or distribute it,
3828 # with or without modifications, as long as this notice is preserved.
3829
3830
3831 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
3832 # written in clear, in which case automake, when reading aclocal.m4,
3833 # will think it sees a *use*, and therefore will trigger all it's
3834 # C support machinery. Also note that it means that autoscan, seeing
3835 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
3836
3837
3838 # _AM_DEPENDENCIES(NAME)
3839 # ----------------------
3840 # See how the compiler implements dependency checking.
3841 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
3842 # We try a few techniques and use that to set a single cache variable.
3843 #
3844 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
3845 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
3846 # dependency, and given that the user is not expected to run this macro,
3847 # just rely on AC_PROG_CC.
3848 AC_DEFUN([_AM_DEPENDENCIES],
3849 [AC_REQUIRE([AM_SET_DEPDIR])dnl
3850 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
3851 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
3852 AC_REQUIRE([AM_DEP_TRACK])dnl
3853
3854 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
3855 [$1], [CXX], [depcc="$CXX" am_compiler_list=],
3856 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
3857 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
3858 [$1], [UPC], [depcc="$UPC" am_compiler_list=],
3859 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
3860 [depcc="$$1" am_compiler_list=])
3861
3862 AC_CACHE_CHECK([dependency style of $depcc],
3863 [am_cv_$1_dependencies_compiler_type],
3864 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3865 # We make a subdir and do the tests there. Otherwise we can end up
3866 # making bogus files that we don't know about and never remove. For
3867 # instance it was reported that on HP-UX the gcc test will end up
3868 # making a dummy file named 'D' -- because '-MD' means "put the output
3869 # in D".
3870 rm -rf conftest.dir
3871 mkdir conftest.dir
3872 # Copy depcomp to subdir because otherwise we won't find it if we're
3873 # using a relative directory.
3874 cp "$am_depcomp" conftest.dir
3875 cd conftest.dir
3876 # We will build objects and dependencies in a subdirectory because
3877 # it helps to detect inapplicable dependency modes. For instance
3878 # both Tru64's cc and ICC support -MD to output dependencies as a
3879 # side effect of compilation, but ICC will put the dependencies in
3880 # the current directory while Tru64 will put them in the object
3881 # directory.
3882 mkdir sub
3883
3884 am_cv_$1_dependencies_compiler_type=none
3885 if test "$am_compiler_list" = ""; then
3886 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
3887 fi
3888 am__universal=false
3889 m4_case([$1], [CC],
3890 [case " $depcc " in #(
3891 *\ -arch\ *\ -arch\ *) am__universal=true ;;
3892 esac],
3893 [CXX],
3894 [case " $depcc " in #(
3895 *\ -arch\ *\ -arch\ *) am__universal=true ;;
3896 esac])
3897
3898 for depmode in $am_compiler_list; do
3899 # Setup a source with many dependencies, because some compilers
3900 # like to wrap large dependency lists on column 80 (with \), and
3901 # we should not choose a depcomp mode which is confused by this.
3902 #
3903 # We need to recreate these files for each test, as the compiler may
3904 # overwrite some of them when testing with obscure command lines.
3905 # This happens at least with the AIX C compiler.
3906 : > sub/conftest.c
3907 for i in 1 2 3 4 5 6; do
3908 echo '#include "conftst'$i'.h"' >> sub/conftest.c
3909 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
3910 # Solaris 10 /bin/sh.
3911 echo '/* dummy */' > sub/conftst$i.h
3912 done
3913 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3914
3915 # We check with '-c' and '-o' for the sake of the "dashmstdout"
3916 # mode. It turns out that the SunPro C++ compiler does not properly
3917 # handle '-M -o', and we need to detect this. Also, some Intel
3918 # versions had trouble with output in subdirs.
3919 am__obj=sub/conftest.${OBJEXT-o}
3920 am__minus_obj="-o $am__obj"
3921 case $depmode in
3922 gcc)
3923 # This depmode causes a compiler race in universal mode.
3924 test "$am__universal" = false || continue
3925 ;;
3926 nosideeffect)
3927 # After this tag, mechanisms are not by side-effect, so they'll
3928 # only be used when explicitly requested.
3929 if test "x$enable_dependency_tracking" = xyes; then
3930 continue
3931 else
3932 break
3933 fi
3934 ;;
3935 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
3936 # This compiler won't grok '-c -o', but also, the minuso test has
3937 # not run yet. These depmodes are late enough in the game, and
3938 # so weak that their functioning should not be impacted.
3939 am__obj=conftest.${OBJEXT-o}
3940 am__minus_obj=
3941 ;;
3942 none) break ;;
3943 esac
3944 if depmode=$depmode \
3945 source=sub/conftest.c object=$am__obj \
3946 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3947 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
3948 >/dev/null 2>conftest.err &&
3949 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3950 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3951 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
3952 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3953 # icc doesn't choke on unknown options, it will just issue warnings
3954 # or remarks (even with -Werror). So we grep stderr for any message
3955 # that says an option was ignored or not supported.
3956 # When given -MP, icc 7.0 and 7.1 complain thusly:
3957 # icc: Command line warning: ignoring option '-M'; no argument required
3958 # The diagnosis changed in icc 8.0:
3959 # icc: Command line remark: option '-MP' not supported
3960 if (grep 'ignoring option' conftest.err ||
3961 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3962 am_cv_$1_dependencies_compiler_type=$depmode
3963 break
3964 fi
3965 fi
3966 done
3967
3968 cd ..
3969 rm -rf conftest.dir
3970 else
3971 am_cv_$1_dependencies_compiler_type=none
3972 fi
3973 ])
3974 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
3975 AM_CONDITIONAL([am__fastdep$1], [
3976 test "x$enable_dependency_tracking" != xno \
3977 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3978 ])
3979
3980
3981 # AM_SET_DEPDIR
3982 # -------------
3983 # Choose a directory name for dependency files.
3984 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
3985 AC_DEFUN([AM_SET_DEPDIR],
3986 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3987 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3988 ])
3989
3990
3991 # AM_DEP_TRACK
3992 # ------------
3993 AC_DEFUN([AM_DEP_TRACK],
3994 [AC_ARG_ENABLE([dependency-tracking], [dnl
3995 AS_HELP_STRING(
3996 [--enable-dependency-tracking],
3997 [do not reject slow dependency extractors])
3998 AS_HELP_STRING(
3999 [--disable-dependency-tracking],
4000 [speeds up one-time build])])
4001 if test "x$enable_dependency_tracking" != xno; then
4002 am_depcomp="$ac_aux_dir/depcomp"
4003 AMDEPBACKSLASH='\'
4004 am__nodep='_no'
4005 fi
4006 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
4007 AC_SUBST([AMDEPBACKSLASH])dnl
4008 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
4009 AC_SUBST([am__nodep])dnl
4010 _AM_SUBST_NOTMAKE([am__nodep])dnl
4011 ])
4012
4013 # Generate code to set up dependency tracking. -*- Autoconf -*-
4014
4015 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
4016 #
4017 # This file is free software; the Free Software Foundation
4018 # gives unlimited permission to copy and/or distribute it,
4019 # with or without modifications, as long as this notice is preserved.
4020
4021 # _AM_OUTPUT_DEPENDENCY_COMMANDS
4022 # ------------------------------
4023 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
4024 [{
4025 # Older Autoconf quotes --file arguments for eval, but not when files
4026 # are listed without --file. Let's play safe and only enable the eval
4027 # if we detect the quoting.
4028 # TODO: see whether this extra hack can be removed once we start
4029 # requiring Autoconf 2.70 or later.
4030 AS_CASE([$CONFIG_FILES],
4031 [*\'*], [eval set x "$CONFIG_FILES"],
4032 [*], [set x $CONFIG_FILES])
4033 shift
4034 # Used to flag and report bootstrapping failures.
4035 am_rc=0
4036 for am_mf
4037 do
4038 # Strip MF so we end up with the name of the file.
4039 am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
4040 # Check whether this is an Automake generated Makefile which includes
4041 # dependency-tracking related rules and includes.
4042 # Grep'ing the whole file directly is not great: AIX grep has a line
4043 # limit of 2048, but all sed's we know have understand at least 4000.
4044 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
4045 || continue
4046 am_dirpart=`AS_DIRNAME(["$am_mf"])`
4047 am_filepart=`AS_BASENAME(["$am_mf"])`
4048 AM_RUN_LOG([cd "$am_dirpart" \
4049 && sed -e '/# am--include-marker/d' "$am_filepart" \
4050 | $MAKE -f - am--depfiles]) || am_rc=$?
4051 done
4052 if test $am_rc -ne 0; then
4053 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
4054 for automatic dependency tracking. If GNU make was not used, consider
4055 re-running the configure script with MAKE="gmake" (or whatever is
4056 necessary). You can also try re-running configure with the
4057 '--disable-dependency-tracking' option to at least be able to build
4058 the package (albeit without support for automatic dependency tracking).])
4059 fi
4060 AS_UNSET([am_dirpart])
4061 AS_UNSET([am_filepart])
4062 AS_UNSET([am_mf])
4063 AS_UNSET([am_rc])
4064 rm -f conftest-deps.mk
4065 }
4066 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
4067
4068
4069 # AM_OUTPUT_DEPENDENCY_COMMANDS
4070 # -----------------------------
4071 # This macro should only be invoked once -- use via AC_REQUIRE.
4072 #
4073 # This code is only required when automatic dependency tracking is enabled.
4074 # This creates each '.Po' and '.Plo' makefile fragment that we'll need in
4075 # order to bootstrap the dependency handling code.
4076 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4077 [AC_CONFIG_COMMANDS([depfiles],
4078 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4079 [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
4080
4081 # Do all the work for Automake. -*- Autoconf -*-
4082
4083 # Copyright (C) 1996-2021 Free Software Foundation, Inc.
4084 #
4085 # This file is free software; the Free Software Foundation
4086 # gives unlimited permission to copy and/or distribute it,
4087 # with or without modifications, as long as this notice is preserved.
4088
4089 # This macro actually does too much. Some checks are only needed if
4090 # your package does certain things. But this isn't really a big deal.
4091
4092 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
4093 m4_define([AC_PROG_CC],
4094 m4_defn([AC_PROG_CC])
4095 [_AM_PROG_CC_C_O
4096 ])
4097
4098 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4099 # AM_INIT_AUTOMAKE([OPTIONS])
4100 # -----------------------------------------------
4101 # The call with PACKAGE and VERSION arguments is the old style
4102 # call (pre autoconf-2.50), which is being phased out. PACKAGE
4103 # and VERSION should now be passed to AC_INIT and removed from
4104 # the call to AM_INIT_AUTOMAKE.
4105 # We support both call styles for the transition. After
4106 # the next Automake release, Autoconf can make the AC_INIT
4107 # arguments mandatory, and then we can depend on a new Autoconf
4108 # release and drop the old call support.
4109 AC_DEFUN([AM_INIT_AUTOMAKE],
4110 [AC_PREREQ([2.65])dnl
4111 m4_ifdef([_$0_ALREADY_INIT],
4112 [m4_fatal([$0 expanded multiple times
4113 ]m4_defn([_$0_ALREADY_INIT]))],
4114 [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
4115 dnl Autoconf wants to disallow AM_ names. We explicitly allow
4116 dnl the ones we care about.
4117 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4118 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4119 AC_REQUIRE([AC_PROG_INSTALL])dnl
4120 if test "`cd $srcdir && pwd`" != "`pwd`"; then
4121 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4122 # is not polluted with repeated "-I."
4123 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4124 # test to see if srcdir already configured
4125 if test -f $srcdir/config.status; then
4126 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4127 fi
4128 fi
4129
4130 # test whether we have cygpath
4131 if test -z "$CYGPATH_W"; then
4132 if (cygpath --version) >/dev/null 2>/dev/null; then
4133 CYGPATH_W='cygpath -w'
4134 else
4135 CYGPATH_W=echo
4136 fi
4137 fi
4138 AC_SUBST([CYGPATH_W])
4139
4140 # Define the identity of the package.
4141 dnl Distinguish between old-style and new-style calls.
4142 m4_ifval([$2],
4143 [AC_DIAGNOSE([obsolete],
4144 [$0: two- and three-arguments forms are deprecated.])
4145 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4146 AC_SUBST([PACKAGE], [$1])dnl
4147 AC_SUBST([VERSION], [$2])],
4148 [_AM_SET_OPTIONS([$1])dnl
4149 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4150 m4_if(
4151 m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
4152 [ok:ok],,
4153 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4154 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4155 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4156
4157 _AM_IF_OPTION([no-define],,
4158 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4159 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4160
4161 # Some tools Automake needs.
4162 AC_REQUIRE([AM_SANITY_CHECK])dnl
4163 AC_REQUIRE([AC_ARG_PROGRAM])dnl
4164 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4165 AM_MISSING_PROG([AUTOCONF], [autoconf])
4166 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4167 AM_MISSING_PROG([AUTOHEADER], [autoheader])
4168 AM_MISSING_PROG([MAKEINFO], [makeinfo])
4169 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4170 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4171 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
4172 # For better backward compatibility. To be removed once Automake 1.9.x
4173 # dies out for good. For more background, see:
4174 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
4175 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
4176 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
4177 # We need awk for the "check" target (and possibly the TAP driver). The
4178 # system "awk" is bad on some platforms.
4179 AC_REQUIRE([AC_PROG_AWK])dnl
4180 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
4181 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
4182 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4183 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4184 [_AM_PROG_TAR([v7])])])
4185 _AM_IF_OPTION([no-dependencies],,
4186 [AC_PROVIDE_IFELSE([AC_PROG_CC],
4187 [_AM_DEPENDENCIES([CC])],
4188 [m4_define([AC_PROG_CC],
4189 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
4190 AC_PROVIDE_IFELSE([AC_PROG_CXX],
4191 [_AM_DEPENDENCIES([CXX])],
4192 [m4_define([AC_PROG_CXX],
4193 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
4194 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
4195 [_AM_DEPENDENCIES([OBJC])],
4196 [m4_define([AC_PROG_OBJC],
4197 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
4198 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
4199 [_AM_DEPENDENCIES([OBJCXX])],
4200 [m4_define([AC_PROG_OBJCXX],
4201 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
4202 ])
4203 # Variables for tags utilities; see am/tags.am
4204 if test -z "$CTAGS"; then
4205 CTAGS=ctags
4206 fi
4207 AC_SUBST([CTAGS])
4208 if test -z "$ETAGS"; then
4209 ETAGS=etags
4210 fi
4211 AC_SUBST([ETAGS])
4212 if test -z "$CSCOPE"; then
4213 CSCOPE=cscope
4214 fi
4215 AC_SUBST([CSCOPE])
4216
4217 AC_REQUIRE([AM_SILENT_RULES])dnl
4218 dnl The testsuite driver may need to know about EXEEXT, so add the
4219 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
4220 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
4221 AC_CONFIG_COMMANDS_PRE(dnl
4222 [m4_provide_if([_AM_COMPILER_EXEEXT],
4223 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
4224
4225 # POSIX will say in a future version that running "rm -f" with no argument
4226 # is OK; and we want to be able to make that assumption in our Makefile
4227 # recipes. So use an aggressive probe to check that the usage we want is
4228 # actually supported "in the wild" to an acceptable degree.
4229 # See automake bug#10828.
4230 # To make any issue more visible, cause the running configure to be aborted
4231 # by default if the 'rm' program in use doesn't match our expectations; the
4232 # user can still override this though.
4233 if rm -f && rm -fr && rm -rf; then : OK; else
4234 cat >&2 <<'END'
4235 Oops!
4236
4237 Your 'rm' program seems unable to run without file operands specified
4238 on the command line, even when the '-f' option is present. This is contrary
4239 to the behaviour of most rm programs out there, and not conforming with
4240 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
4241
4242 Please tell [email protected] about your system, including the value
4243 of your $PATH and any error possibly output before this message. This
4244 can help us improve future automake versions.
4245
4246 END
4247 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
4248 echo 'Configuration will proceed anyway, since you have set the' >&2
4249 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
4250 echo >&2
4251 else
4252 cat >&2 <<'END'
4253 Aborting the configuration process, to ensure you take notice of the issue.
4254
4255 You can download and install GNU coreutils to get an 'rm' implementation
4256 that behaves properly: <https://www.gnu.org/software/coreutils/>.
4257
4258 If you want to complete the configuration process using your problematic
4259 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
4260 to "yes", and re-run configure.
4261
4262 END
4263 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
4264 fi
4265 fi
4266 dnl The trailing newline in this macro's definition is deliberate, for
4267 dnl backward compatibility and to allow trailing 'dnl'-style comments
4268 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
4269 ])
4270
4271 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
4272 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
4273 dnl mangled by Autoconf and run in a shell conditional statement.
4274 m4_define([_AC_COMPILER_EXEEXT],
4275 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
4276
4277 # When config.status generates a header, we must update the stamp-h file.
4278 # This file resides in the same directory as the config header
4279 # that is generated. The stamp files are numbered to have different names.
4280
4281 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
4282 # loop where config.status creates the headers, so we can generate
4283 # our stamp files there.
4284 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
4285 [# Compute $1's index in $config_headers.
4286 _am_arg=$1
4287 _am_stamp_count=1
4288 for _am_header in $config_headers :; do
4289 case $_am_header in
4290 $_am_arg | $_am_arg:* )
4291 break ;;
4292 * )
4293 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
4294 esac
4295 done
4296 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
4297
4298 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
4299 #
4300 # This file is free software; the Free Software Foundation
4301 # gives unlimited permission to copy and/or distribute it,
4302 # with or without modifications, as long as this notice is preserved.
4303
4304 # AM_PROG_INSTALL_SH
4305 # ------------------
4306 # Define $install_sh.
4307 AC_DEFUN([AM_PROG_INSTALL_SH],
4308 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
4309 if test x"${install_sh+set}" != xset; then
4310 case $am_aux_dir in
4311 *\ * | *\ *)
4312 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
4313 *)
4314 install_sh="\${SHELL} $am_aux_dir/install-sh"
4315 esac
4316 fi
4317 AC_SUBST([install_sh])])
4318
4319 # Copyright (C) 2003-2021 Free Software Foundation, Inc.
4320 #
4321 # This file is free software; the Free Software Foundation
4322 # gives unlimited permission to copy and/or distribute it,
4323 # with or without modifications, as long as this notice is preserved.
4324
4325 # Check whether the underlying file-system supports filenames
4326 # with a leading dot. For instance MS-DOS doesn't.
4327 AC_DEFUN([AM_SET_LEADING_DOT],
4328 [rm -rf .tst 2>/dev/null
4329 mkdir .tst 2>/dev/null
4330 if test -d .tst; then
4331 am__leading_dot=.
4332 else
4333 am__leading_dot=_
4334 fi
4335 rmdir .tst 2>/dev/null
4336 AC_SUBST([am__leading_dot])])
4337
4338 # Check to see how 'make' treats includes. -*- Autoconf -*-
4339
4340 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
4341 #
4342 # This file is free software; the Free Software Foundation
4343 # gives unlimited permission to copy and/or distribute it,
4344 # with or without modifications, as long as this notice is preserved.
4345
4346 # AM_MAKE_INCLUDE()
4347 # -----------------
4348 # Check whether make has an 'include' directive that can support all
4349 # the idioms we need for our automatic dependency tracking code.
4350 AC_DEFUN([AM_MAKE_INCLUDE],
4351 [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
4352 cat > confinc.mk << 'END'
4353 am__doit:
4354 @echo this is the am__doit target >confinc.out
4355 .PHONY: am__doit
4356 END
4357 am__include="#"
4358 am__quote=
4359 # BSD make does it like this.
4360 echo '.include "confinc.mk" # ignored' > confmf.BSD
4361 # Other make implementations (GNU, Solaris 10, AIX) do it like this.
4362 echo 'include confinc.mk # ignored' > confmf.GNU
4363 _am_result=no
4364 for s in GNU BSD; do
4365 AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
4366 AS_CASE([$?:`cat confinc.out 2>/dev/null`],
4367 ['0:this is the am__doit target'],
4368 [AS_CASE([$s],
4369 [BSD], [am__include='.include' am__quote='"'],
4370 [am__include='include' am__quote=''])])
4371 if test "$am__include" != "#"; then
4372 _am_result="yes ($s style)"
4373 break
4374 fi
4375 done
4376 rm -f confinc.* confmf.*
4377 AC_MSG_RESULT([${_am_result}])
4378 AC_SUBST([am__include])])
4379 AC_SUBST([am__quote])])
4380
4381 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
4382
4383 # Copyright (C) 1997-2021 Free Software Foundation, Inc.
4384 #
4385 # This file is free software; the Free Software Foundation
4386 # gives unlimited permission to copy and/or distribute it,
4387 # with or without modifications, as long as this notice is preserved.
4388
4389 # AM_MISSING_PROG(NAME, PROGRAM)
4390 # ------------------------------
4391 AC_DEFUN([AM_MISSING_PROG],
4392 [AC_REQUIRE([AM_MISSING_HAS_RUN])
4393 $1=${$1-"${am_missing_run}$2"}
4394 AC_SUBST($1)])
4395
4396 # AM_MISSING_HAS_RUN
4397 # ------------------
4398 # Define MISSING if not defined so far and test if it is modern enough.
4399 # If it is, set am_missing_run to use it, otherwise, to nothing.
4400 AC_DEFUN([AM_MISSING_HAS_RUN],
4401 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
4402 AC_REQUIRE_AUX_FILE([missing])dnl
4403 if test x"${MISSING+set}" != xset; then
4404 MISSING="\${SHELL} '$am_aux_dir/missing'"
4405 fi
4406 # Use eval to expand $SHELL
4407 if eval "$MISSING --is-lightweight"; then
4408 am_missing_run="$MISSING "
4409 else
4410 am_missing_run=
4411 AC_MSG_WARN(['missing' script is too old or missing])
4412 fi
4413 ])
4414
4415 # Helper functions for option handling. -*- Autoconf -*-
4416
4417 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
4418 #
4419 # This file is free software; the Free Software Foundation
4420 # gives unlimited permission to copy and/or distribute it,
4421 # with or without modifications, as long as this notice is preserved.
4422
4423 # _AM_MANGLE_OPTION(NAME)
4424 # -----------------------
4425 AC_DEFUN([_AM_MANGLE_OPTION],
4426 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
4427
4428 # _AM_SET_OPTION(NAME)
4429 # --------------------
4430 # Set option NAME. Presently that only means defining a flag for this option.
4431 AC_DEFUN([_AM_SET_OPTION],
4432 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
4433
4434 # _AM_SET_OPTIONS(OPTIONS)
4435 # ------------------------
4436 # OPTIONS is a space-separated list of Automake options.
4437 AC_DEFUN([_AM_SET_OPTIONS],
4438 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
4439
4440 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
4441 # -------------------------------------------
4442 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
4443 AC_DEFUN([_AM_IF_OPTION],
4444 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
4445
4446 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
4447 #
4448 # This file is free software; the Free Software Foundation
4449 # gives unlimited permission to copy and/or distribute it,
4450 # with or without modifications, as long as this notice is preserved.
4451
4452 # _AM_PROG_CC_C_O
4453 # ---------------
4454 # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
4455 # to automatically call this.
4456 AC_DEFUN([_AM_PROG_CC_C_O],
4457 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
4458 AC_REQUIRE_AUX_FILE([compile])dnl
4459 AC_LANG_PUSH([C])dnl
4460 AC_CACHE_CHECK(
4461 [whether $CC understands -c and -o together],
4462 [am_cv_prog_cc_c_o],
4463 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
4464 # Make sure it works both with $CC and with simple cc.
4465 # Following AC_PROG_CC_C_O, we do the test twice because some
4466 # compilers refuse to overwrite an existing .o file with -o,
4467 # though they will create one.
4468 am_cv_prog_cc_c_o=yes
4469 for am_i in 1 2; do
4470 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
4471 && test -f conftest2.$ac_objext; then
4472 : OK
4473 else
4474 am_cv_prog_cc_c_o=no
4475 break
4476 fi
4477 done
4478 rm -f core conftest*
4479 unset am_i])
4480 if test "$am_cv_prog_cc_c_o" != yes; then
4481 # Losing compiler, so override with the script.
4482 # FIXME: It is wrong to rewrite CC.
4483 # But if we don't then we get into trouble of one sort or another.
4484 # A longer-term fix would be to have automake use am__CC in this case,
4485 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
4486 CC="$am_aux_dir/compile $CC"
4487 fi
4488 AC_LANG_POP([C])])
4489
4490 # For backward compatibility.
4491 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
4492
4493 # Copyright (C) 1999-2021 Free Software Foundation, Inc.
4494 #
4495 # This file is free software; the Free Software Foundation
4496 # gives unlimited permission to copy and/or distribute it,
4497 # with or without modifications, as long as this notice is preserved.
4498
4499
4500 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
4501 # ---------------------------------------------------------------------------
4502 # Adds support for distributing Python modules and packages. To
4503 # install modules, copy them to $(pythondir), using the python_PYTHON
4504 # automake variable. To install a package with the same name as the
4505 # automake package, install to $(pkgpythondir), or use the
4506 # pkgpython_PYTHON automake variable.
4507 #
4508 # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
4509 # locations to install python extension modules (shared libraries).
4510 # Another macro is required to find the appropriate flags to compile
4511 # extension modules.
4512 #
4513 # If your package is configured with a different prefix to python,
4514 # users will have to add the install directory to the PYTHONPATH
4515 # environment variable, or create a .pth file (see the python
4516 # documentation for details).
4517 #
4518 # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
4519 # cause an error if the version of python installed on the system
4520 # doesn't meet the requirement. MINIMUM-VERSION should consist of
4521 # numbers and dots only.
4522 AC_DEFUN([AM_PATH_PYTHON],
4523 [
4524 dnl Find a Python interpreter. Python versions prior to 2.0 are not
4525 dnl supported. (2.0 was released on October 16, 2000).
4526 m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
4527 [python python2 python3 dnl
4528 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl
4529 python3.2 python3.1 python3.0 dnl
4530 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl
4531 python2.0])
4532
4533 AC_ARG_VAR([PYTHON], [the Python interpreter])
4534
4535 m4_if([$1],[],[
4536 dnl No version check is needed.
4537 # Find any Python interpreter.
4538 if test -z "$PYTHON"; then
4539 AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
4540 fi
4541 am_display_PYTHON=python
4542 ], [
4543 dnl A version check is needed.
4544 if test -n "$PYTHON"; then
4545 # If the user set $PYTHON, use it and don't search something else.
4546 AC_MSG_CHECKING([whether $PYTHON version is >= $1])
4547 AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
4548 [AC_MSG_RESULT([yes])],
4549 [AC_MSG_RESULT([no])
4550 AC_MSG_ERROR([Python interpreter is too old])])
4551 am_display_PYTHON=$PYTHON
4552 else
4553 # Otherwise, try each interpreter until we find one that satisfies
4554 # VERSION.
4555 AC_CACHE_CHECK([for a Python interpreter with version >= $1],
4556 [am_cv_pathless_PYTHON],[
4557 for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
4558 test "$am_cv_pathless_PYTHON" = none && break
4559 AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
4560 done])
4561 # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
4562 if test "$am_cv_pathless_PYTHON" = none; then
4563 PYTHON=:
4564 else
4565 AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
4566 fi
4567 am_display_PYTHON=$am_cv_pathless_PYTHON
4568 fi
4569 ])
4570
4571 if test "$PYTHON" = :; then
4572 dnl Run any user-specified action, or abort.
4573 m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
4574 else
4575
4576 dnl Query Python for its version number. Although site.py simply uses
4577 dnl sys.version[:3], printing that failed with Python 3.10, since the
4578 dnl trailing zero was eliminated. So now we output just the major
4579 dnl and minor version numbers, as numbers. Apparently the tertiary
4580 dnl version is not of interest.
4581 dnl
4582 AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
4583 [am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info[[:2]])"`])
4584 AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
4585
4586 dnl At times, e.g., when building shared libraries, you may want
4587 dnl to know which OS platform Python thinks this is.
4588 dnl
4589 AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
4590 [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
4591 AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
4592
4593 dnl emacs-page
4594 dnl If --with-python-sys-prefix is given, use the values of sys.prefix
4595 dnl and sys.exec_prefix for the corresponding values of PYTHON_PREFIX
4596 dnl and PYTHON_EXEC_PREFIX. Otherwise, use the GNU ${prefix} and
4597 dnl ${exec_prefix} variables.
4598 dnl
4599 dnl The two are made distinct variables so they can be overridden if
4600 dnl need be, although general consensus is that you shouldn't need
4601 dnl this separation.
4602 dnl
4603 dnl Also allow directly setting the prefixes via configure options,
4604 dnl overriding any default.
4605 dnl
4606 if test "x$prefix" = xNONE; then
4607 am__usable_prefix=$ac_default_prefix
4608 else
4609 am__usable_prefix=$prefix
4610 fi
4611
4612 # Allow user to request using sys.* values from Python,
4613 # instead of the GNU $prefix values.
4614 AC_ARG_WITH([python-sys-prefix],
4615 [AS_HELP_STRING([--with-python-sys-prefix],
4616 [use Python's sys.prefix and sys.exec_prefix values])],
4617 [am_use_python_sys=:],
4618 [am_use_python_sys=false])
4619
4620 # Allow user to override whatever the default Python prefix is.
4621 AC_ARG_WITH([python_prefix],
4622 [AS_HELP_STRING([--with-python_prefix],
4623 [override the default PYTHON_PREFIX])],
4624 [am_python_prefix_subst=$withval
4625 am_cv_python_prefix=$withval
4626 AC_MSG_CHECKING([for explicit $am_display_PYTHON prefix])
4627 AC_MSG_RESULT([$am_cv_python_prefix])],
4628 [
4629 if $am_use_python_sys; then
4630 # using python sys.prefix value, not GNU
4631 AC_CACHE_CHECK([for python default $am_display_PYTHON prefix],
4632 [am_cv_python_prefix],
4633 [am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`])
4634
4635 dnl If sys.prefix is a subdir of $prefix, replace the literal value of
4636 dnl $prefix with a variable reference so it can be overridden.
4637 case $am_cv_python_prefix in
4638 $am__usable_prefix*)
4639 am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'`
4640 am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"`
4641 ;;
4642 *)
4643 am_python_prefix_subst=$am_cv_python_prefix
4644 ;;
4645 esac
4646 else # using GNU prefix value, not python sys.prefix
4647 am_python_prefix_subst='${prefix}'
4648 am_python_prefix=$am_python_prefix_subst
4649 AC_MSG_CHECKING([for GNU default $am_display_PYTHON prefix])
4650 AC_MSG_RESULT([$am_python_prefix])
4651 fi])
4652 # Substituting python_prefix_subst value.
4653 AC_SUBST([PYTHON_PREFIX], [$am_python_prefix_subst])
4654
4655 # emacs-page Now do it all over again for Python exec_prefix, but with yet
4656 # another conditional: fall back to regular prefix if that was specified.
4657 AC_ARG_WITH([python_exec_prefix],
4658 [AS_HELP_STRING([--with-python_exec_prefix],
4659 [override the default PYTHON_EXEC_PREFIX])],
4660 [am_python_exec_prefix_subst=$withval
4661 am_cv_python_exec_prefix=$withval
4662 AC_MSG_CHECKING([for explicit $am_display_PYTHON exec_prefix])
4663 AC_MSG_RESULT([$am_cv_python_exec_prefix])],
4664 [
4665 # no explicit --with-python_exec_prefix, but if
4666 # --with-python_prefix was given, use its value for python_exec_prefix too.
4667 AS_IF([test -n "$with_python_prefix"],
4668 [am_python_exec_prefix_subst=$with_python_prefix
4669 am_cv_python_exec_prefix=$with_python_prefix
4670 AC_MSG_CHECKING([for python_prefix-given $am_display_PYTHON exec_prefix])
4671 AC_MSG_RESULT([$am_cv_python_exec_prefix])],
4672 [
4673 # Set am__usable_exec_prefix whether using GNU or Python values,
4674 # since we use that variable for pyexecdir.
4675 if test "x$exec_prefix" = xNONE; then
4676 am__usable_exec_prefix=$am__usable_prefix
4677 else
4678 am__usable_exec_prefix=$exec_prefix
4679 fi
4680 #
4681 if $am_use_python_sys; then # using python sys.exec_prefix, not GNU
4682 AC_CACHE_CHECK([for python default $am_display_PYTHON exec_prefix],
4683 [am_cv_python_exec_prefix],
4684 [am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`])
4685 dnl If sys.exec_prefix is a subdir of $exec_prefix, replace the
4686 dnl literal value of $exec_prefix with a variable reference so it can
4687 dnl be overridden.
4688 case $am_cv_python_exec_prefix in
4689 $am__usable_exec_prefix*)
4690 am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'`
4691 am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"`
4692 ;;
4693 *)
4694 am_python_exec_prefix_subst=$am_cv_python_exec_prefix
4695 ;;
4696 esac
4697 else # using GNU $exec_prefix, not python sys.exec_prefix
4698 am_python_exec_prefix_subst='${exec_prefix}'
4699 am_python_exec_prefix=$am_python_exec_prefix_subst
4700 AC_MSG_CHECKING([for GNU default $am_display_PYTHON exec_prefix])
4701 AC_MSG_RESULT([$am_python_exec_prefix])
4702 fi])])
4703 # Substituting python_exec_prefix_subst.
4704 AC_SUBST([PYTHON_EXEC_PREFIX], [$am_python_exec_prefix_subst])
4705
4706 # Factor out some code duplication into this shell variable.
4707 am_python_setup_sysconfig="\
4708 import sys
4709 # Prefer sysconfig over distutils.sysconfig, for better compatibility
4710 # with python 3.x. See automake bug#10227.
4711 try:
4712 import sysconfig
4713 except ImportError:
4714 can_use_sysconfig = 0
4715 else:
4716 can_use_sysconfig = 1
4717 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
4718 # <https://github.com/pypa/virtualenv/issues/118>
4719 try:
4720 from platform import python_implementation
4721 if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
4722 can_use_sysconfig = 0
4723 except ImportError:
4724 pass"
4725
4726 dnl emacs-page Set up 4 directories:
4727
4728 dnl 1. pythondir: where to install python scripts. This is the
4729 dnl site-packages directory, not the python standard library
4730 dnl directory like in previous automake betas. This behavior
4731 dnl is more consistent with lispdir.m4 for example.
4732 dnl Query distutils for this directory.
4733 dnl
4734 AC_CACHE_CHECK([for $am_display_PYTHON script directory (pythondir)],
4735 [am_cv_python_pythondir],
4736 [if test "x$am_cv_python_prefix" = x; then
4737 am_py_prefix=$am__usable_prefix
4738 else
4739 am_py_prefix=$am_cv_python_prefix
4740 fi
4741 am_cv_python_pythondir=`$PYTHON -c "
4742 $am_python_setup_sysconfig
4743 if can_use_sysconfig:
4744 sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
4745 else:
4746 from distutils import sysconfig
4747 sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
4748 sys.stdout.write(sitedir)"`
4749 #
4750 case $am_cv_python_pythondir in
4751 $am_py_prefix*)
4752 am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
4753 am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"`
4754 ;;
4755 *)
4756 case $am_py_prefix in
4757 /usr|/System*) ;;
4758 *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages"
4759 ;;
4760 esac
4761 ;;
4762 esac
4763 ])
4764 AC_SUBST([pythondir], [$am_cv_python_pythondir])
4765
4766 dnl 2. pkgpythondir: $PACKAGE directory under pythondir. Was
4767 dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
4768 dnl more consistent with the rest of automake.
4769 dnl
4770 AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
4771
4772 dnl 3. pyexecdir: directory for installing python extension modules
4773 dnl (shared libraries).
4774 dnl Query distutils for this directory.
4775 dnl
4776 AC_CACHE_CHECK([for $am_display_PYTHON extension module directory (pyexecdir)],
4777 [am_cv_python_pyexecdir],
4778 [if test "x$am_cv_python_exec_prefix" = x; then
4779 am_py_exec_prefix=$am__usable_exec_prefix
4780 else
4781 am_py_exec_prefix=$am_cv_python_exec_prefix
4782 fi
4783 am_cv_python_pyexecdir=`$PYTHON -c "
4784 $am_python_setup_sysconfig
4785 if can_use_sysconfig:
4786 sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'})
4787 else:
4788 from distutils import sysconfig
4789 sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix')
4790 sys.stdout.write(sitedir)"`
4791 #
4792 case $am_cv_python_pyexecdir in
4793 $am_py_exec_prefix*)
4794 am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
4795 am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"`
4796 ;;
4797 *)
4798 case $am_py_exec_prefix in
4799 /usr|/System*) ;;
4800 *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages"
4801 ;;
4802 esac
4803 ;;
4804 esac
4805 ])
4806 AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
4807
4808 dnl 4. pkgpyexecdir: $(pyexecdir)/$(PACKAGE)
4809 dnl
4810 AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
4811
4812 dnl Run any user-specified action.
4813 $2
4814 fi
4815 ])
4816
4817
4818 # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
4819 # ---------------------------------------------------------------------------
4820 # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
4821 # Run ACTION-IF-FALSE otherwise.
4822 # This test uses sys.hexversion instead of the string equivalent (first
4823 # word of sys.version), in order to cope with versions such as 2.2c1.
4824 # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
4825 AC_DEFUN([AM_PYTHON_CHECK_VERSION],
4826 [prog="import sys
4827 # split strings by '.' and convert to numeric. Append some zeros
4828 # because we need at least 4 digits for the hex conversion.
4829 # map returns an iterator in Python 3.0 and a list in 2.x
4830 minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
4831 minverhex = 0
4832 # xrange is not present in Python 3.0 and range returns an iterator
4833 for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
4834 sys.exit(sys.hexversion < minverhex)"
4835 AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
4836
4837 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
4838 #
4839 # This file is free software; the Free Software Foundation
4840 # gives unlimited permission to copy and/or distribute it,
4841 # with or without modifications, as long as this notice is preserved.
4842
4843 # AM_RUN_LOG(COMMAND)
4844 # -------------------
4845 # Run COMMAND, save the exit status in ac_status, and log it.
4846 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
4847 AC_DEFUN([AM_RUN_LOG],
4848 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
4849 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
4850 ac_status=$?
4851 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
4852 (exit $ac_status); }])
4853
4854 # Check to make sure that the build environment is sane. -*- Autoconf -*-
4855
4856 # Copyright (C) 1996-2021 Free Software Foundation, Inc.
4857 #
4858 # This file is free software; the Free Software Foundation
4859 # gives unlimited permission to copy and/or distribute it,
4860 # with or without modifications, as long as this notice is preserved.
4861
4862 # AM_SANITY_CHECK
4863 # ---------------
4864 AC_DEFUN([AM_SANITY_CHECK],
4865 [AC_MSG_CHECKING([whether build environment is sane])
4866 # Reject unsafe characters in $srcdir or the absolute working directory
4867 # name. Accept space and tab only in the latter.
4868 am_lf='
4869 '
4870 case `pwd` in
4871 *[[\\\"\#\$\&\'\`$am_lf]]*)
4872 AC_MSG_ERROR([unsafe absolute working directory name]);;
4873 esac
4874 case $srcdir in
4875 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
4876 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
4877 esac
4878
4879 # Do 'set' in a subshell so we don't clobber the current shell's
4880 # arguments. Must try -L first in case configure is actually a
4881 # symlink; some systems play weird games with the mod time of symlinks
4882 # (eg FreeBSD returns the mod time of the symlink's containing
4883 # directory).
4884 if (
4885 am_has_slept=no
4886 for am_try in 1 2; do
4887 echo "timestamp, slept: $am_has_slept" > conftest.file
4888 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
4889 if test "$[*]" = "X"; then
4890 # -L didn't work.
4891 set X `ls -t "$srcdir/configure" conftest.file`
4892 fi
4893 if test "$[*]" != "X $srcdir/configure conftest.file" \
4894 && test "$[*]" != "X conftest.file $srcdir/configure"; then
4895
4896 # If neither matched, then we have a broken ls. This can happen
4897 # if, for instance, CONFIG_SHELL is bash and it inherits a
4898 # broken ls alias from the environment. This has actually
4899 # happened. Such a system could not be considered "sane".
4900 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
4901 alias in your environment])
4902 fi
4903 if test "$[2]" = conftest.file || test $am_try -eq 2; then
4904 break
4905 fi
4906 # Just in case.
4907 sleep 1
4908 am_has_slept=yes
4909 done
4910 test "$[2]" = conftest.file
4911 )
4912 then
4913 # Ok.
4914 :
4915 else
4916 AC_MSG_ERROR([newly created file is older than distributed files!
4917 Check your system clock])
4918 fi
4919 AC_MSG_RESULT([yes])
4920 # If we didn't sleep, we still need to ensure time stamps of config.status and
4921 # generated files are strictly newer.
4922 am_sleep_pid=
4923 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
4924 ( sleep 1 ) &
4925 am_sleep_pid=$!
4926 fi
4927 AC_CONFIG_COMMANDS_PRE(
4928 [AC_MSG_CHECKING([that generated files are newer than configure])
4929 if test -n "$am_sleep_pid"; then
4930 # Hide warnings about reused PIDs.
4931 wait $am_sleep_pid 2>/dev/null
4932 fi
4933 AC_MSG_RESULT([done])])
4934 rm -f conftest.file
4935 ])
4936
4937 # Copyright (C) 2009-2021 Free Software Foundation, Inc.
4938 #
4939 # This file is free software; the Free Software Foundation
4940 # gives unlimited permission to copy and/or distribute it,
4941 # with or without modifications, as long as this notice is preserved.
4942
4943 # AM_SILENT_RULES([DEFAULT])
4944 # --------------------------
4945 # Enable less verbose build rules; with the default set to DEFAULT
4946 # ("yes" being less verbose, "no" or empty being verbose).
4947 AC_DEFUN([AM_SILENT_RULES],
4948 [AC_ARG_ENABLE([silent-rules], [dnl
4949 AS_HELP_STRING(
4950 [--enable-silent-rules],
4951 [less verbose build output (undo: "make V=1")])
4952 AS_HELP_STRING(
4953 [--disable-silent-rules],
4954 [verbose build output (undo: "make V=0")])dnl
4955 ])
4956 case $enable_silent_rules in @%:@ (((
4957 yes) AM_DEFAULT_VERBOSITY=0;;
4958 no) AM_DEFAULT_VERBOSITY=1;;
4959 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
4960 esac
4961 dnl
4962 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
4963 dnl do not support nested variable expansions.
4964 dnl See automake bug#9928 and bug#10237.
4965 am_make=${MAKE-make}
4966 AC_CACHE_CHECK([whether $am_make supports nested variables],
4967 [am_cv_make_support_nested_variables],
4968 [if AS_ECHO([['TRUE=$(BAR$(V))
4969 BAR0=false
4970 BAR1=true
4971 V=1
4972 am__doit:
4973 @$(TRUE)
4974 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
4975 am_cv_make_support_nested_variables=yes
4976 else
4977 am_cv_make_support_nested_variables=no
4978 fi])
4979 if test $am_cv_make_support_nested_variables = yes; then
4980 dnl Using '$V' instead of '$(V)' breaks IRIX make.
4981 AM_V='$(V)'
4982 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
4983 else
4984 AM_V=$AM_DEFAULT_VERBOSITY
4985 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
4986 fi
4987 AC_SUBST([AM_V])dnl
4988 AM_SUBST_NOTMAKE([AM_V])dnl
4989 AC_SUBST([AM_DEFAULT_V])dnl
4990 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
4991 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
4992 AM_BACKSLASH='\'
4993 AC_SUBST([AM_BACKSLASH])dnl
4994 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
4995 ])
4996
4997 # Copyright (C) 2001-2021 Free Software Foundation, Inc.
4998 #
4999 # This file is free software; the Free Software Foundation
5000 # gives unlimited permission to copy and/or distribute it,
5001 # with or without modifications, as long as this notice is preserved.
5002
5003 # AM_PROG_INSTALL_STRIP
5004 # ---------------------
5005 # One issue with vendor 'install' (even GNU) is that you can't
5006 # specify the program used to strip binaries. This is especially
5007 # annoying in cross-compiling environments, where the build's strip
5008 # is unlikely to handle the host's binaries.
5009 # Fortunately install-sh will honor a STRIPPROG variable, so we
5010 # always use install-sh in "make install-strip", and initialize
5011 # STRIPPROG with the value of the STRIP variable (set by the user).
5012 AC_DEFUN([AM_PROG_INSTALL_STRIP],
5013 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
5014 # Installed binaries are usually stripped using 'strip' when the user
5015 # run "make install-strip". However 'strip' might not be the right
5016 # tool to use in cross-compilation environments, therefore Automake
5017 # will honor the 'STRIP' environment variable to overrule this program.
5018 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
5019 if test "$cross_compiling" != no; then
5020 AC_CHECK_TOOL([STRIP], [strip], :)
5021 fi
5022 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
5023 AC_SUBST([INSTALL_STRIP_PROGRAM])])
5024
5025 # Copyright (C) 2006-2021 Free Software Foundation, Inc.
5026 #
5027 # This file is free software; the Free Software Foundation
5028 # gives unlimited permission to copy and/or distribute it,
5029 # with or without modifications, as long as this notice is preserved.
5030
5031 # _AM_SUBST_NOTMAKE(VARIABLE)
5032 # ---------------------------
5033 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
5034 # This macro is traced by Automake.
5035 AC_DEFUN([_AM_SUBST_NOTMAKE])
5036
5037 # AM_SUBST_NOTMAKE(VARIABLE)
5038 # --------------------------
5039 # Public sister of _AM_SUBST_NOTMAKE.
5040 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
5041
5042 # Check how to create a tarball. -*- Autoconf -*-
5043
5044 # Copyright (C) 2004-2021 Free Software Foundation, Inc.
5045 #
5046 # This file is free software; the Free Software Foundation
5047 # gives unlimited permission to copy and/or distribute it,
5048 # with or without modifications, as long as this notice is preserved.
5049
5050 # _AM_PROG_TAR(FORMAT)
5051 # --------------------
5052 # Check how to create a tarball in format FORMAT.
5053 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
5054 #
5055 # Substitute a variable $(am__tar) that is a command
5056 # writing to stdout a FORMAT-tarball containing the directory
5057 # $tardir.
5058 # tardir=directory && $(am__tar) > result.tar
5059 #
5060 # Substitute a variable $(am__untar) that extract such
5061 # a tarball read from stdin.
5062 # $(am__untar) < result.tar
5063 #
5064 AC_DEFUN([_AM_PROG_TAR],
5065 [# Always define AMTAR for backward compatibility. Yes, it's still used
5066 # in the wild :-( We should find a proper way to deprecate it ...
5067 AC_SUBST([AMTAR], ['$${TAR-tar}'])
5068
5069 # We'll loop over all known methods to create a tar archive until one works.
5070 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
5071
5072 m4_if([$1], [v7],
5073 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
5074
5075 [m4_case([$1],
5076 [ustar],
5077 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
5078 # There is notably a 21 bits limit for the UID and the GID. In fact,
5079 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
5080 # and bug#13588).
5081 am_max_uid=2097151 # 2^21 - 1
5082 am_max_gid=$am_max_uid
5083 # The $UID and $GID variables are not portable, so we need to resort
5084 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
5085 # below are definitely unexpected, so allow the users to see them
5086 # (that is, avoid stderr redirection).
5087 am_uid=`id -u || echo unknown`
5088 am_gid=`id -g || echo unknown`
5089 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
5090 if test $am_uid -le $am_max_uid; then
5091 AC_MSG_RESULT([yes])
5092 else
5093 AC_MSG_RESULT([no])
5094 _am_tools=none
5095 fi
5096 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
5097 if test $am_gid -le $am_max_gid; then
5098 AC_MSG_RESULT([yes])
5099 else
5100 AC_MSG_RESULT([no])
5101 _am_tools=none
5102 fi],
5103
5104 [pax],
5105 [],
5106
5107 [m4_fatal([Unknown tar format])])
5108
5109 AC_MSG_CHECKING([how to create a $1 tar archive])
5110
5111 # Go ahead even if we have the value already cached. We do so because we
5112 # need to set the values for the 'am__tar' and 'am__untar' variables.
5113 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
5114
5115 for _am_tool in $_am_tools; do
5116 case $_am_tool in
5117 gnutar)
5118 for _am_tar in tar gnutar gtar; do
5119 AM_RUN_LOG([$_am_tar --version]) && break
5120 done
5121 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
5122 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
5123 am__untar="$_am_tar -xf -"
5124 ;;
5125 plaintar)
5126 # Must skip GNU tar: if it does not support --format= it doesn't create
5127 # ustar tarball either.
5128 (tar --version) >/dev/null 2>&1 && continue
5129 am__tar='tar chf - "$$tardir"'
5130 am__tar_='tar chf - "$tardir"'
5131 am__untar='tar xf -'
5132 ;;
5133 pax)
5134 am__tar='pax -L -x $1 -w "$$tardir"'
5135 am__tar_='pax -L -x $1 -w "$tardir"'
5136 am__untar='pax -r'
5137 ;;
5138 cpio)
5139 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
5140 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
5141 am__untar='cpio -i -H $1 -d'
5142 ;;
5143 none)
5144 am__tar=false
5145 am__tar_=false
5146 am__untar=false
5147 ;;
5148 esac
5149
5150 # If the value was cached, stop now. We just wanted to have am__tar
5151 # and am__untar set.
5152 test -n "${am_cv_prog_tar_$1}" && break
5153
5154 # tar/untar a dummy directory, and stop if the command works.
5155 rm -rf conftest.dir
5156 mkdir conftest.dir
5157 echo GrepMe > conftest.dir/file
5158 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
5159 rm -rf conftest.dir
5160 if test -s conftest.tar; then
5161 AM_RUN_LOG([$am__untar <conftest.tar])
5162 AM_RUN_LOG([cat conftest.dir/file])
5163 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
5164 fi
5165 done
5166 rm -rf conftest.dir
5167
5168 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
5169 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
5170
5171 AC_SUBST([am__tar])
5172 AC_SUBST([am__untar])
5173 ]) # _AM_PROG_TAR
5174