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