1 # generated automatically by aclocal 1.16.2 -*- Autoconf -*-
3 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
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.
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
14 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 # gettext.m4 serial 68 (gettext-0.19.8)
16 dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
17 dnl This file is free software; the Free Software Foundation
18 dnl gives unlimited permission to copy and/or distribute it,
19 dnl with or without modifications, as long as this notice is preserved.
21 dnl This file can be used in projects which are not available under
22 dnl the GNU General Public License or the GNU Library General Public
23 dnl License but which still want to provide support for the GNU gettext
25 dnl Please note that the actual code of the GNU gettext library is covered
26 dnl by the GNU Library General Public License, and the rest of the GNU
27 dnl gettext package is covered by the GNU General Public License.
28 dnl They are *not* in the public domain.
31 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
32 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
34 dnl Macro to add for using GNU gettext.
36 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
37 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
38 dnl default (if it is not specified or empty) is 'no-libtool'.
39 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
40 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
41 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
42 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
43 dnl depending on --{enable,disable}-{shared,static} and on the presence of
44 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
45 dnl $(top_builddir)/intl/libintl.a will be created.
46 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
47 dnl implementations (in libc or libintl) without the ngettext() function
48 dnl will be ignored. If NEEDSYMBOL is specified and is
49 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
50 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
51 dnl INTLDIR is used to find the intl libraries. If empty,
52 dnl the value '$(top_builddir)/intl/' is used.
54 dnl The result of the configuration is one of three cases:
55 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
57 dnl Catalog format: GNU --> install in $(datadir)
58 dnl Catalog extension: .mo after installation, .gmo in source tree
59 dnl 2) GNU gettext has been found in the system's C library.
60 dnl Catalog format: GNU --> install in $(datadir)
61 dnl Catalog extension: .mo after installation, .gmo in source tree
62 dnl 3) No internationalization, always use English msgid.
63 dnl Catalog format: none
64 dnl Catalog extension: none
65 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
66 dnl The use of .gmo is historical (it was needed to avoid overwriting the
67 dnl GNU format catalogs when building on a platform with an X/Open gettext),
68 dnl but we keep it in order not to force irrelevant filename changes on the
71 AC_DEFUN([AM_GNU_GETTEXT],
73 dnl Argument checking.
74 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
75 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
77 ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
78 [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
79 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
80 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
82 define([gt_included_intl],
83 ifelse([$1], [external],
84 ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
86 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
88 AM_GNU_GETTEXT_NEED([$2])
90 AC_REQUIRE([AM_PO_SUBDIRS])dnl
91 ifelse(gt_included_intl, yes, [
92 AC_REQUIRE([AM_INTL_SUBDIR])dnl
95 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
96 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
97 AC_REQUIRE([AC_LIB_RPATH])
99 dnl Sometimes libintl requires libiconv, so first search for libiconv.
100 dnl Ideally we would do this search only after the
101 dnl if test "$USE_NLS" = "yes"; then
102 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
103 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
104 dnl the configure script would need to contain the same shell code
105 dnl again, outside any 'if'. There are two solutions:
106 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
107 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
108 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
109 dnl documented, we avoid it.
110 ifelse(gt_included_intl, yes, , [
111 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
114 dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
120 ifelse(gt_included_intl, yes, [
121 BUILD_INCLUDED_LIBINTL=no
122 USE_INCLUDED_LIBINTL=no
128 dnl Add a version number to the cache macros.
129 case " $gt_needs " in
130 *" need-formatstring-macros "*) gt_api_version=3 ;;
131 *" need-ngettext "*) gt_api_version=2 ;;
132 *) gt_api_version=1 ;;
134 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
135 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
137 dnl If we use NLS figure out what method
138 if test "$USE_NLS" = "yes"; then
139 gt_use_preinstalled_gnugettext=no
140 ifelse(gt_included_intl, yes, [
141 AC_MSG_CHECKING([whether included gettext is requested])
142 AC_ARG_WITH([included-gettext],
143 [ --with-included-gettext use the GNU gettext library included here],
144 nls_cv_force_use_gnu_gettext=$withval,
145 nls_cv_force_use_gnu_gettext=no)
146 AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
148 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
149 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
151 dnl User does not insist on using GNU NLS library. Figure out what
152 dnl to use. If GNU gettext is available we use this. Else we have
153 dnl to fall back to GNU NLS library.
155 if test $gt_api_version -ge 3; then
156 gt_revision_test_code='
157 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
158 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
161 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
165 gt_revision_test_code=
167 if test $gt_api_version -ge 2; then
168 gt_expression_test_code=' + * ngettext ("", "", 0)'
170 gt_expression_test_code=
173 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
178 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
179 extern int _nl_msg_cat_cntr;
180 extern int *_nl_domain_bindings;
181 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
183 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
185 $gt_revision_test_code
188 bindtextdomain ("", "");
189 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
191 [eval "$gt_func_gnugettext_libc=yes"],
192 [eval "$gt_func_gnugettext_libc=no"])])
194 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
195 dnl Sometimes libintl requires libiconv, so first search for libiconv.
196 ifelse(gt_included_intl, yes, , [
199 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
200 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
201 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
202 dnl even if libiconv doesn't exist.
203 AC_LIB_LINKFLAGS_BODY([intl])
204 AC_CACHE_CHECK([for GNU gettext in libintl],
205 [$gt_func_gnugettext_libintl],
206 [gt_save_CPPFLAGS="$CPPFLAGS"
207 CPPFLAGS="$CPPFLAGS $INCINTL"
209 LIBS="$LIBS $LIBINTL"
210 dnl Now see whether libintl exists and does not depend on libiconv.
215 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
216 extern int _nl_msg_cat_cntr;
221 const char *_nl_expand_alias (const char *);
222 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
224 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
226 $gt_revision_test_code
229 bindtextdomain ("", "");
230 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
232 [eval "$gt_func_gnugettext_libintl=yes"],
233 [eval "$gt_func_gnugettext_libintl=no"])
234 dnl Now see whether libintl exists and depends on libiconv.
235 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
236 LIBS="$LIBS $LIBICONV"
241 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
242 extern int _nl_msg_cat_cntr;
247 const char *_nl_expand_alias (const char *);
248 #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
250 #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
252 $gt_revision_test_code
255 bindtextdomain ("", "");
256 return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
258 [LIBINTL="$LIBINTL $LIBICONV"
259 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
260 eval "$gt_func_gnugettext_libintl=yes"
263 CPPFLAGS="$gt_save_CPPFLAGS"
264 LIBS="$gt_save_LIBS"])
267 dnl If an already present or preinstalled GNU gettext() is found,
268 dnl use it. But if this macro is used in GNU gettext, and GNU
269 dnl gettext is already preinstalled in libintl, we update this
270 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
271 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
272 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
273 && test "$PACKAGE" != gettext-runtime \
274 && test "$PACKAGE" != gettext-tools; }; then
275 gt_use_preinstalled_gnugettext=yes
277 dnl Reset the values set by searching for libintl.
283 ifelse(gt_included_intl, yes, [
284 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
285 dnl GNU gettext is not found in the C library.
286 dnl Fall back on included GNU gettext library.
287 nls_cv_use_gnu_gettext=yes
291 if test "$nls_cv_use_gnu_gettext" = "yes"; then
292 dnl Mark actions used to generate GNU NLS library.
293 BUILD_INCLUDED_LIBINTL=yes
294 USE_INCLUDED_LIBINTL=yes
295 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
296 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
297 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
301 if test "$gt_use_preinstalled_gnugettext" = "yes" \
302 || test "$nls_cv_use_gnu_gettext" = "yes"; then
303 dnl Mark actions to use GNU gettext tools.
308 if test -n "$INTL_MACOSX_LIBS"; then
309 if test "$gt_use_preinstalled_gnugettext" = "yes" \
310 || test "$nls_cv_use_gnu_gettext" = "yes"; then
311 dnl Some extra flags are needed during linking.
312 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
313 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
317 if test "$gt_use_preinstalled_gnugettext" = "yes" \
318 || test "$nls_cv_use_gnu_gettext" = "yes"; then
319 AC_DEFINE([ENABLE_NLS], [1],
320 [Define to 1 if translation of program messages to the user's native language
327 AC_MSG_CHECKING([whether to use NLS])
328 AC_MSG_RESULT([$USE_NLS])
329 if test "$USE_NLS" = "yes"; then
330 AC_MSG_CHECKING([where the gettext function comes from])
331 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
332 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
333 gt_source="external libintl"
338 gt_source="included intl directory"
340 AC_MSG_RESULT([$gt_source])
343 if test "$USE_NLS" = "yes"; then
345 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
346 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
347 AC_MSG_CHECKING([how to link with libintl])
348 AC_MSG_RESULT([$LIBINTL])
349 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
352 dnl For backward compatibility. Some packages may be using this.
353 AC_DEFINE([HAVE_GETTEXT], [1],
354 [Define if the GNU gettext() function is already present or preinstalled.])
355 AC_DEFINE([HAVE_DCGETTEXT], [1],
356 [Define if the GNU dcgettext() function is already present or preinstalled.])
359 dnl We need to process the po/ directory.
363 ifelse(gt_included_intl, yes, [
364 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
365 dnl to 'yes' because some of the testsuite requires it.
366 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
367 BUILD_INCLUDED_LIBINTL=yes
370 dnl Make all variables we use known to autoconf.
371 AC_SUBST([BUILD_INCLUDED_LIBINTL])
372 AC_SUBST([USE_INCLUDED_LIBINTL])
373 AC_SUBST([CATOBJEXT])
375 dnl For backward compatibility. Some configure.ins may be using this.
379 dnl For backward compatibility. Some Makefiles may be using this.
381 AC_SUBST([DATADIRNAME])
383 dnl For backward compatibility. Some Makefiles may be using this.
385 AC_SUBST([INSTOBJEXT])
387 dnl For backward compatibility. Some Makefiles may be using this.
391 dnl For backward compatibility. Some Makefiles may be using this.
393 if test "$USE_INCLUDED_LIBINTL" = yes; then
394 INTLOBJS="\$(GETTOBJS)"
398 dnl Enable libtool support if the surrounding package wishes it.
399 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
400 AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
403 dnl For backward compatibility. Some Makefiles may be using this.
407 dnl Make all documented variables known to autoconf.
409 AC_SUBST([LTLIBINTL])
414 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
415 m4_define([gt_NEEDS_INIT],
417 m4_divert_text([DEFAULTS], [gt_needs=])
418 m4_define([gt_NEEDS_INIT], [])
422 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
423 AC_DEFUN([AM_GNU_GETTEXT_NEED],
425 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
429 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
430 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
433 dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
434 AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
436 # iconv.m4 serial 19 (gettext-0.18.2)
437 dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
438 dnl This file is free software; the Free Software Foundation
439 dnl gives unlimited permission to copy and/or distribute it,
440 dnl with or without modifications, as long as this notice is preserved.
442 dnl From Bruno Haible.
444 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
446 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
447 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
448 AC_REQUIRE([AC_LIB_RPATH])
450 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
452 AC_LIB_LINKFLAGS_BODY([iconv])
455 AC_DEFUN([AM_ICONV_LINK],
457 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
458 dnl those with the standalone portable GNU libiconv installed).
459 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
461 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
463 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
465 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
466 dnl because if the user has installed libiconv and not disabled its use
467 dnl via --without-libiconv-prefix, he wants to use it. The first
468 dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
469 am_save_CPPFLAGS="$CPPFLAGS"
470 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
472 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
473 am_cv_func_iconv="no, consider installing GNU libiconv"
481 [[iconv_t cd = iconv_open("","");
482 iconv(cd,NULL,NULL,NULL,NULL);
483 iconv_close(cd);]])],
484 [am_cv_func_iconv=yes])
485 if test "$am_cv_func_iconv" != yes; then
487 LIBS="$LIBS $LIBICONV"
494 [[iconv_t cd = iconv_open("","");
495 iconv(cd,NULL,NULL,NULL,NULL);
496 iconv_close(cd);]])],
497 [am_cv_lib_iconv=yes]
498 [am_cv_func_iconv=yes])
502 if test "$am_cv_func_iconv" = yes; then
503 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
504 dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
507 if test $am_cv_lib_iconv = yes; then
508 LIBS="$LIBS $LIBICONV"
510 am_cv_func_iconv_works=no
511 for ac_iconv_const in '' 'const'; do
519 # define ICONV_CONST $ac_iconv_const
523 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
526 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
527 if (cd_utf8_to_88591 != (iconv_t)(-1))
529 static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
531 ICONV_CONST char *inptr = input;
532 size_t inbytesleft = strlen (input);
534 size_t outbytesleft = sizeof (buf);
535 size_t res = iconv (cd_utf8_to_88591,
536 &inptr, &inbytesleft,
537 &outptr, &outbytesleft);
540 iconv_close (cd_utf8_to_88591);
543 /* Test against Solaris 10 bug: Failures are not distinguishable from
544 successful returns. */
546 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
547 if (cd_ascii_to_88591 != (iconv_t)(-1))
549 static ICONV_CONST char input[] = "\263";
551 ICONV_CONST char *inptr = input;
552 size_t inbytesleft = strlen (input);
554 size_t outbytesleft = sizeof (buf);
555 size_t res = iconv (cd_ascii_to_88591,
556 &inptr, &inbytesleft,
557 &outptr, &outbytesleft);
560 iconv_close (cd_ascii_to_88591);
563 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
565 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
566 if (cd_88591_to_utf8 != (iconv_t)(-1))
568 static ICONV_CONST char input[] = "\304";
569 static char buf[2] = { (char)0xDE, (char)0xAD };
570 ICONV_CONST char *inptr = input;
571 size_t inbytesleft = 1;
573 size_t outbytesleft = 1;
574 size_t res = iconv (cd_88591_to_utf8,
575 &inptr, &inbytesleft,
576 &outptr, &outbytesleft);
577 if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
579 iconv_close (cd_88591_to_utf8);
582 #if 0 /* This bug could be worked around by the caller. */
583 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
585 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
586 if (cd_88591_to_utf8 != (iconv_t)(-1))
588 static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
590 ICONV_CONST char *inptr = input;
591 size_t inbytesleft = strlen (input);
593 size_t outbytesleft = sizeof (buf);
594 size_t res = iconv (cd_88591_to_utf8,
595 &inptr, &inbytesleft,
596 &outptr, &outbytesleft);
599 iconv_close (cd_88591_to_utf8);
603 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
605 if (/* Try standardized names. */
606 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
607 /* Try IRIX, OSF/1 names. */
608 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
610 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
611 /* Try HP-UX names. */
612 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
616 [am_cv_func_iconv_works=yes], ,
618 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
619 *) am_cv_func_iconv_works="guessing yes" ;;
621 test "$am_cv_func_iconv_works" = no || break
625 case "$am_cv_func_iconv_works" in
626 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
627 *) am_func_iconv=yes ;;
630 am_func_iconv=no am_cv_lib_iconv=no
632 if test "$am_func_iconv" = yes; then
633 AC_DEFINE([HAVE_ICONV], [1],
634 [Define if you have the iconv() function and it works.])
636 if test "$am_cv_lib_iconv" = yes; then
637 AC_MSG_CHECKING([how to link with libiconv])
638 AC_MSG_RESULT([$LIBICONV])
640 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
642 CPPFLAGS="$am_save_CPPFLAGS"
647 AC_SUBST([LTLIBICONV])
650 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
651 dnl avoid warnings like
652 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
653 dnl This is tricky because of the way 'aclocal' is implemented:
654 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
655 dnl Otherwise aclocal's initial scan pass would miss the macro definition.
656 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
657 dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
659 m4_define([gl_iconv_AC_DEFUN],
660 m4_version_prereq([2.64],
663 [m4_ifdef([gl_00GNULIB],
668 gl_iconv_AC_DEFUN([AM_ICONV],
671 if test "$am_cv_func_iconv" = yes; then
672 AC_MSG_CHECKING([for iconv declaration])
673 AC_CACHE_VAL([am_cv_proto_iconv], [
683 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
684 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
690 [am_cv_proto_iconv_arg1=""],
691 [am_cv_proto_iconv_arg1="const"])
692 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);"])
693 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
696 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
697 [Define as const if the declaration of iconv() needs const.])
698 dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
699 m4_ifdef([gl_ICONV_H_DEFAULTS],
700 [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
701 if test -n "$am_cv_proto_iconv_arg1"; then
708 # intlmacosx.m4 serial 5 (gettext-0.18.2)
709 dnl Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc.
710 dnl This file is free software; the Free Software Foundation
711 dnl gives unlimited permission to copy and/or distribute it,
712 dnl with or without modifications, as long as this notice is preserved.
714 dnl This file can be used in projects which are not available under
715 dnl the GNU General Public License or the GNU Library General Public
716 dnl License but which still want to provide support for the GNU gettext
718 dnl Please note that the actual code of the GNU gettext library is covered
719 dnl by the GNU Library General Public License, and the rest of the GNU
720 dnl gettext package is covered by the GNU General Public License.
721 dnl They are *not* in the public domain.
723 dnl Checks for special options needed on Mac OS X.
724 dnl Defines INTL_MACOSX_LIBS.
725 AC_DEFUN([gt_INTL_MACOSX],
727 dnl Check for API introduced in Mac OS X 10.2.
728 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
729 [gt_cv_func_CFPreferencesCopyAppValue],
730 [gt_save_LIBS="$LIBS"
731 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
734 [[#include <CoreFoundation/CFPreferences.h>]],
735 [[CFPreferencesCopyAppValue(NULL, NULL)]])],
736 [gt_cv_func_CFPreferencesCopyAppValue=yes],
737 [gt_cv_func_CFPreferencesCopyAppValue=no])
738 LIBS="$gt_save_LIBS"])
739 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
740 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
741 [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
743 dnl Check for API introduced in Mac OS X 10.3.
744 AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
745 [gt_save_LIBS="$LIBS"
746 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
749 [[#include <CoreFoundation/CFLocale.h>]],
750 [[CFLocaleCopyCurrent();]])],
751 [gt_cv_func_CFLocaleCopyCurrent=yes],
752 [gt_cv_func_CFLocaleCopyCurrent=no])
753 LIBS="$gt_save_LIBS"])
754 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
755 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
756 [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
759 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
760 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
762 AC_SUBST([INTL_MACOSX_LIBS])
766 dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
767 dnl This file is free software; the Free Software Foundation
768 dnl gives unlimited permission to copy and/or distribute it,
769 dnl with or without modifications, as long as this notice is preserved.
771 dnl Subroutines of libtool.m4,
772 dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
773 dnl collision with libtool.m4.
775 dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
776 AC_DEFUN([AC_LIB_PROG_LD_GNU],
777 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
778 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
779 case `$LD -v 2>&1 </dev/null` in
780 *GNU* | *'with BFD'*)
781 acl_cv_prog_gnu_ld=yes
784 acl_cv_prog_gnu_ld=no
787 with_gnu_ld=$acl_cv_prog_gnu_ld
790 dnl From libtool-2.4. Sets the variable LD.
791 AC_DEFUN([AC_LIB_PROG_LD],
792 [AC_REQUIRE([AC_PROG_CC])dnl
793 AC_REQUIRE([AC_CANONICAL_HOST])dnl
795 AC_ARG_WITH([gnu-ld],
796 [AS_HELP_STRING([--with-gnu-ld],
797 [assume the C compiler uses GNU ld [default=no]])],
798 [test "$withval" = no || with_gnu_ld=yes],
801 # Prepare PATH_SEPARATOR.
802 # The user is always right.
803 if test "${PATH_SEPARATOR+set}" != set; then
804 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
805 # contains only /bin. Note that ksh looks also at the FPATH variable,
806 # so we have to set that as well for the test.
808 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
809 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
810 || PATH_SEPARATOR=';'
815 if test "$GCC" = yes; then
816 # Check if gcc -print-prog-name=ld gives a path.
817 AC_MSG_CHECKING([for ld used by $CC])
820 # gcc leaves a trailing carriage return which upsets mingw
821 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
823 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
826 # Accept absolute paths.
827 [[\\/]]* | ?:[[\\/]]*)
828 re_direlt='/[[^/]][[^/]]*/\.\./'
829 # Canonicalize the pathname of ld
830 ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
831 while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
832 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
834 test -z "$LD" && LD="$ac_prog"
837 # If it fails, then pretend we aren't using GCC.
841 # If it is relative, then search for the first ld in PATH.
845 elif test "$with_gnu_ld" = yes; then
846 AC_MSG_CHECKING([for GNU ld])
848 AC_MSG_CHECKING([for non-GNU ld])
850 AC_CACHE_VAL([acl_cv_path_LD],
851 [if test -z "$LD"; then
852 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
853 for ac_dir in $PATH; do
855 test -z "$ac_dir" && ac_dir=.
856 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
857 acl_cv_path_LD="$ac_dir/$ac_prog"
858 # Check to see if the program is GNU ld. I'd rather use --version,
859 # but apparently some variants of GNU ld only accept -v.
860 # Break only if it was the GNU/non-GNU ld that we prefer.
861 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
862 *GNU* | *'with BFD'*)
863 test "$with_gnu_ld" != no && break
866 test "$with_gnu_ld" != yes && break
873 acl_cv_path_LD="$LD" # Let the user override the test with a path.
876 if test -n "$LD"; then
881 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
885 # lib-link.m4 serial 26 (gettext-0.18.2)
886 dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
887 dnl This file is free software; the Free Software Foundation
888 dnl gives unlimited permission to copy and/or distribute it,
889 dnl with or without modifications, as long as this notice is preserved.
891 dnl From Bruno Haible.
895 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
896 dnl the libraries corresponding to explicit and implicit dependencies.
897 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
898 dnl augments the CPPFLAGS variable.
899 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
900 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
901 AC_DEFUN([AC_LIB_LINKFLAGS],
903 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
904 AC_REQUIRE([AC_LIB_RPATH])
905 pushdef([Name],[m4_translit([$1],[./+-], [____])])
906 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
907 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
908 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
909 AC_LIB_LINKFLAGS_BODY([$1], [$2])
910 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
911 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
912 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
913 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
915 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
916 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
917 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
918 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
919 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
921 AC_SUBST([LTLIB]NAME)
922 AC_SUBST([LIB]NAME[_PREFIX])
923 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
924 dnl results of this search when this library appears as a dependency.
930 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
931 dnl searches for libname and the libraries corresponding to explicit and
932 dnl implicit dependencies, together with the specified include files and
933 dnl the ability to compile and link the specified testcode. The missing-message
934 dnl defaults to 'no' and may contain additional hints for the user.
935 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
936 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
937 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
938 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
939 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
940 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
941 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
943 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
944 AC_REQUIRE([AC_LIB_RPATH])
945 pushdef([Name],[m4_translit([$1],[./+-], [____])])
946 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
947 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
949 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
951 AC_LIB_LINKFLAGS_BODY([$1], [$2])
953 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
954 dnl because if the user has installed lib[]Name and not disabled its use
955 dnl via --without-lib[]Name-prefix, he wants to use it.
956 ac_save_CPPFLAGS="$CPPFLAGS"
957 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
959 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
961 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
962 dnl because these -l options might require -L options that are present in
963 dnl LIBS. -l options benefit only from the -L options listed before it.
964 dnl Otherwise, add it to the front of LIBS, because it may be a static
965 dnl library that depends on another static library that is present in LIBS.
966 dnl Static libraries benefit only from the static libraries listed after
968 case " $LIB[]NAME" in
969 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
970 *) LIBS="$LIB[]NAME $LIBS" ;;
973 [AC_LANG_PROGRAM([[$3]], [[$4]])],
974 [ac_cv_lib[]Name=yes],
975 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
978 if test "$ac_cv_lib[]Name" = yes; then
980 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
981 AC_MSG_CHECKING([how to link with lib[]$1])
982 AC_MSG_RESULT([$LIB[]NAME])
985 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
986 dnl $INC[]NAME either.
987 CPPFLAGS="$ac_save_CPPFLAGS"
992 AC_SUBST([HAVE_LIB]NAME)
994 AC_SUBST([LTLIB]NAME)
995 AC_SUBST([LIB]NAME[_PREFIX])
1000 dnl Determine the platform dependent parameters needed to use rpath:
1003 dnl acl_libname_spec,
1004 dnl acl_library_names_spec,
1005 dnl acl_hardcode_libdir_flag_spec,
1006 dnl acl_hardcode_libdir_separator,
1007 dnl acl_hardcode_direct,
1008 dnl acl_hardcode_minus_L.
1009 AC_DEFUN([AC_LIB_RPATH],
1011 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
1012 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
1013 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1014 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1015 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1016 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1017 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
1018 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1019 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1025 acl_libext="$acl_cv_libext"
1026 acl_shlibext="$acl_cv_shlibext"
1027 acl_libname_spec="$acl_cv_libname_spec"
1028 acl_library_names_spec="$acl_cv_library_names_spec"
1029 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1030 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1031 acl_hardcode_direct="$acl_cv_hardcode_direct"
1032 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
1033 dnl Determine whether the user wants rpath handling at all.
1034 AC_ARG_ENABLE([rpath],
1035 [ --disable-rpath do not hardcode runtime library paths],
1036 :, enable_rpath=yes)
1039 dnl AC_LIB_FROMPACKAGE(name, package)
1040 dnl declares that libname comes from the given package. The configure file
1041 dnl will then not have a --with-libname-prefix option but a
1042 dnl --with-package-prefix option. Several libraries can come from the same
1043 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
1044 dnl macro call that searches for libname.
1045 AC_DEFUN([AC_LIB_FROMPACKAGE],
1047 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1048 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1049 define([acl_frompackage_]NAME, [$2])
1051 pushdef([PACK],[$2])
1052 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
1053 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1054 define([acl_libsinpackage_]PACKUP,
1055 m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
1060 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1061 dnl the libraries corresponding to explicit and implicit dependencies.
1062 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1063 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
1064 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1065 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1067 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1068 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1069 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1070 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
1071 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
1072 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1073 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
1074 dnl Autoconf >= 2.61 supports dots in --with options.
1075 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
1076 dnl By default, look in $includedir and $libdir.
1078 AC_LIB_WITH_FINAL_PREFIX([
1079 eval additional_includedir=\"$includedir\"
1080 eval additional_libdir=\"$libdir\"
1082 AC_ARG_WITH(P_A_C_K[-prefix],
1083 [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
1084 --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
1086 if test "X$withval" = "Xno"; then
1089 if test "X$withval" = "X"; then
1090 AC_LIB_WITH_FINAL_PREFIX([
1091 eval additional_includedir=\"$includedir\"
1092 eval additional_libdir=\"$libdir\"
1095 additional_includedir="$withval/include"
1096 additional_libdir="$withval/$acl_libdirstem"
1097 if test "$acl_libdirstem2" != "$acl_libdirstem" \
1098 && ! test -d "$withval/$acl_libdirstem"; then
1099 additional_libdir="$withval/$acl_libdirstem2"
1104 dnl Search the library and its dependencies in $additional_libdir and
1105 dnl $LDFLAGS. Using breadth-first-seach.
1110 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
1111 dnl computed. So it has to be reset here.
1115 names_already_handled=
1116 names_next_round='$1 $2'
1117 while test -n "$names_next_round"; do
1118 names_this_round="$names_next_round"
1120 for name in $names_this_round; do
1122 for n in $names_already_handled; do
1123 if test "$n" = "$name"; then
1128 if test -z "$already_handled"; then
1129 names_already_handled="$names_already_handled $name"
1130 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1131 dnl or AC_LIB_HAVE_LINKFLAGS call.
1132 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
1133 eval value=\"\$HAVE_LIB$uppername\"
1134 if test -n "$value"; then
1135 if test "$value" = yes; then
1136 eval value=\"\$LIB$uppername\"
1137 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1138 eval value=\"\$LTLIB$uppername\"
1139 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1141 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1142 dnl that this library doesn't exist. So just drop it.
1146 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1147 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1152 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
1153 if test -n "$acl_shlibext"; then
1154 shrext=".$acl_shlibext" # typically: shrext=.so
1158 if test $use_additional = yes; then
1159 dir="$additional_libdir"
1160 dnl The same code as in the loop below:
1161 dnl First look for a shared library.
1162 if test -n "$acl_shlibext"; then
1163 if test -f "$dir/$libname$shrext"; then
1165 found_so="$dir/$libname$shrext"
1167 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1168 ver=`(cd "$dir" && \
1169 for f in "$libname$shrext".*; do echo "$f"; done \
1170 | sed -e "s,^$libname$shrext\\\\.,," \
1171 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1172 | sed 1q ) 2>/dev/null`
1173 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1175 found_so="$dir/$libname$shrext.$ver"
1178 eval library_names=\"$acl_library_names_spec\"
1179 for f in $library_names; do
1180 if test -f "$dir/$f"; then
1189 dnl Then look for a static library.
1190 if test "X$found_dir" = "X"; then
1191 if test -f "$dir/$libname.$acl_libext"; then
1193 found_a="$dir/$libname.$acl_libext"
1196 if test "X$found_dir" != "X"; then
1197 if test -f "$dir/$libname.la"; then
1198 found_la="$dir/$libname.la"
1202 if test "X$found_dir" = "X"; then
1203 for x in $LDFLAGS $LTLIB[]NAME; do
1204 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1207 dir=`echo "X$x" | sed -e 's/^X-L//'`
1208 dnl First look for a shared library.
1209 if test -n "$acl_shlibext"; then
1210 if test -f "$dir/$libname$shrext"; then
1212 found_so="$dir/$libname$shrext"
1214 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1215 ver=`(cd "$dir" && \
1216 for f in "$libname$shrext".*; do echo "$f"; done \
1217 | sed -e "s,^$libname$shrext\\\\.,," \
1218 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1219 | sed 1q ) 2>/dev/null`
1220 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1222 found_so="$dir/$libname$shrext.$ver"
1225 eval library_names=\"$acl_library_names_spec\"
1226 for f in $library_names; do
1227 if test -f "$dir/$f"; then
1236 dnl Then look for a static library.
1237 if test "X$found_dir" = "X"; then
1238 if test -f "$dir/$libname.$acl_libext"; then
1240 found_a="$dir/$libname.$acl_libext"
1243 if test "X$found_dir" != "X"; then
1244 if test -f "$dir/$libname.la"; then
1245 found_la="$dir/$libname.la"
1250 if test "X$found_dir" != "X"; then
1255 if test "X$found_dir" != "X"; then
1256 dnl Found the library.
1257 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1258 if test "X$found_so" != "X"; then
1259 dnl Linking with a shared library. We attempt to hardcode its
1260 dnl directory into the executable's runpath, unless it's the
1261 dnl standard /usr/lib.
1262 if test "$enable_rpath" = no \
1263 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
1264 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
1265 dnl No hardcoding is needed.
1266 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1268 dnl Use an explicit option to hardcode DIR into the resulting
1270 dnl Potentially add DIR to ltrpathdirs.
1271 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1273 for x in $ltrpathdirs; do
1274 if test "X$x" = "X$found_dir"; then
1279 if test -z "$haveit"; then
1280 ltrpathdirs="$ltrpathdirs $found_dir"
1282 dnl The hardcoding into $LIBNAME is system dependent.
1283 if test "$acl_hardcode_direct" = yes; then
1284 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1285 dnl resulting binary.
1286 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1288 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1289 dnl Use an explicit option to hardcode DIR into the resulting
1291 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1292 dnl Potentially add DIR to rpathdirs.
1293 dnl The rpathdirs will be appended to $LIBNAME at the end.
1295 for x in $rpathdirs; do
1296 if test "X$x" = "X$found_dir"; then
1301 if test -z "$haveit"; then
1302 rpathdirs="$rpathdirs $found_dir"
1305 dnl Rely on "-L$found_dir".
1306 dnl But don't add it if it's already contained in the LDFLAGS
1307 dnl or the already constructed $LIBNAME
1309 for x in $LDFLAGS $LIB[]NAME; do
1310 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1311 if test "X$x" = "X-L$found_dir"; then
1316 if test -z "$haveit"; then
1317 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1319 if test "$acl_hardcode_minus_L" != no; then
1320 dnl FIXME: Not sure whether we should use
1321 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1323 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1325 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1326 dnl here, because this doesn't fit in flags passed to the
1327 dnl compiler. So give up. No hardcoding. This affects only
1328 dnl very old systems.
1329 dnl FIXME: Not sure whether we should use
1330 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1332 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1338 if test "X$found_a" != "X"; then
1339 dnl Linking with a static library.
1340 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1342 dnl We shouldn't come here, but anyway it's good to have a
1344 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1347 dnl Assume the include files are nearby.
1348 additional_includedir=
1349 case "$found_dir" in
1350 */$acl_libdirstem | */$acl_libdirstem/)
1351 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1352 if test "$name" = '$1'; then
1353 LIB[]NAME[]_PREFIX="$basedir"
1355 additional_includedir="$basedir/include"
1357 */$acl_libdirstem2 | */$acl_libdirstem2/)
1358 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
1359 if test "$name" = '$1'; then
1360 LIB[]NAME[]_PREFIX="$basedir"
1362 additional_includedir="$basedir/include"
1365 if test "X$additional_includedir" != "X"; then
1366 dnl Potentially add $additional_includedir to $INCNAME.
1367 dnl But don't add it
1368 dnl 1. if it's the standard /usr/include,
1369 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1370 dnl 3. if it's already present in $CPPFLAGS or the already
1371 dnl constructed $INCNAME,
1372 dnl 4. if it doesn't exist as a directory.
1373 if test "X$additional_includedir" != "X/usr/include"; then
1375 if test "X$additional_includedir" = "X/usr/local/include"; then
1376 if test -n "$GCC"; then
1378 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1382 if test -z "$haveit"; then
1383 for x in $CPPFLAGS $INC[]NAME; do
1384 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1385 if test "X$x" = "X-I$additional_includedir"; then
1390 if test -z "$haveit"; then
1391 if test -d "$additional_includedir"; then
1392 dnl Really add $additional_includedir to $INCNAME.
1393 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1399 dnl Look for dependencies.
1400 if test -n "$found_la"; then
1401 dnl Read the .la file. It defines the variables
1402 dnl dlname, library_names, old_library, dependency_libs, current,
1403 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1404 save_libdir="$libdir"
1406 */* | *\\*) . "$found_la" ;;
1407 *) . "./$found_la" ;;
1409 libdir="$save_libdir"
1410 dnl We use only dependency_libs.
1411 for dep in $dependency_libs; do
1414 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1415 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1416 dnl But don't add it
1417 dnl 1. if it's the standard /usr/lib,
1418 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1419 dnl 3. if it's already present in $LDFLAGS or the already
1420 dnl constructed $LIBNAME,
1421 dnl 4. if it doesn't exist as a directory.
1422 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
1423 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
1425 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
1426 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
1427 if test -n "$GCC"; then
1429 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1433 if test -z "$haveit"; then
1435 for x in $LDFLAGS $LIB[]NAME; do
1436 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1437 if test "X$x" = "X-L$additional_libdir"; then
1442 if test -z "$haveit"; then
1443 if test -d "$additional_libdir"; then
1444 dnl Really add $additional_libdir to $LIBNAME.
1445 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1449 for x in $LDFLAGS $LTLIB[]NAME; do
1450 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1451 if test "X$x" = "X-L$additional_libdir"; then
1456 if test -z "$haveit"; then
1457 if test -d "$additional_libdir"; then
1458 dnl Really add $additional_libdir to $LTLIBNAME.
1459 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1466 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1467 if test "$enable_rpath" != no; then
1468 dnl Potentially add DIR to rpathdirs.
1469 dnl The rpathdirs will be appended to $LIBNAME at the end.
1471 for x in $rpathdirs; do
1472 if test "X$x" = "X$dir"; then
1477 if test -z "$haveit"; then
1478 rpathdirs="$rpathdirs $dir"
1480 dnl Potentially add DIR to ltrpathdirs.
1481 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1483 for x in $ltrpathdirs; do
1484 if test "X$x" = "X$dir"; then
1489 if test -z "$haveit"; then
1490 ltrpathdirs="$ltrpathdirs $dir"
1495 dnl Handle this in the next round.
1496 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1499 dnl Handle this in the next round. Throw away the .la's
1500 dnl directory; it is already contained in a preceding -L
1502 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1505 dnl Most likely an immediate library name.
1506 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1507 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1513 dnl Didn't find the library; assume it is in the system directories
1514 dnl known to the linker and runtime loader. (All the system
1515 dnl directories known to the linker should also be known to the
1516 dnl runtime loader, otherwise the system is severely misconfigured.)
1517 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1518 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1524 if test "X$rpathdirs" != "X"; then
1525 if test -n "$acl_hardcode_libdir_separator"; then
1526 dnl Weird platform: only the last -rpath option counts, the user must
1527 dnl pass all path elements in one option. We can arrange that for a
1528 dnl single library, but not when more than one $LIBNAMEs are used.
1530 for found_dir in $rpathdirs; do
1531 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1533 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1534 acl_save_libdir="$libdir"
1536 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1537 libdir="$acl_save_libdir"
1538 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1540 dnl The -rpath options are cumulative.
1541 for found_dir in $rpathdirs; do
1542 acl_save_libdir="$libdir"
1544 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1545 libdir="$acl_save_libdir"
1546 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1550 if test "X$ltrpathdirs" != "X"; then
1551 dnl When using libtool, the option that works for both libraries and
1552 dnl executables is -R. The -R options are cumulative.
1553 for found_dir in $ltrpathdirs; do
1554 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1564 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1565 dnl unless already present in VAR.
1566 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1567 dnl contains two or three consecutive elements that belong together.
1568 AC_DEFUN([AC_LIB_APPENDTOVAR],
1570 for element in [$2]; do
1573 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1574 if test "X$x" = "X$element"; then
1579 if test -z "$haveit"; then
1580 [$1]="${[$1]}${[$1]:+ }$element"
1585 dnl For those cases where a variable contains several -L and -l options
1586 dnl referring to unknown libraries and directories, this macro determines the
1587 dnl necessary additional linker options for the runtime path.
1588 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1589 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1590 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1591 dnl otherwise linking without libtool is assumed.
1592 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1594 AC_REQUIRE([AC_LIB_RPATH])
1595 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1597 if test "$enable_rpath" != no; then
1598 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1599 dnl Use an explicit option to hardcode directories into the resulting
1604 if test -n "$next"; then
1606 dnl No need to hardcode the standard /usr/lib.
1607 if test "X$dir" != "X/usr/$acl_libdirstem" \
1608 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1609 rpathdirs="$rpathdirs $dir"
1615 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1616 dnl No need to hardcode the standard /usr/lib.
1617 if test "X$dir" != "X/usr/$acl_libdirstem" \
1618 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1619 rpathdirs="$rpathdirs $dir"
1626 if test "X$rpathdirs" != "X"; then
1627 if test -n ""$3""; then
1628 dnl libtool is used for linking. Use -R options.
1629 for dir in $rpathdirs; do
1630 $1="${$1}${$1:+ }-R$dir"
1633 dnl The linker is used for linking directly.
1634 if test -n "$acl_hardcode_libdir_separator"; then
1635 dnl Weird platform: only the last -rpath option counts, the user
1636 dnl must pass all path elements in one option.
1638 for dir in $rpathdirs; do
1639 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1641 acl_save_libdir="$libdir"
1643 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1644 libdir="$acl_save_libdir"
1647 dnl The -rpath options are cumulative.
1648 for dir in $rpathdirs; do
1649 acl_save_libdir="$libdir"
1651 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1652 libdir="$acl_save_libdir"
1653 $1="${$1}${$1:+ }$flag"
1663 # lib-prefix.m4 serial 7 (gettext-0.18)
1664 dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
1665 dnl This file is free software; the Free Software Foundation
1666 dnl gives unlimited permission to copy and/or distribute it,
1667 dnl with or without modifications, as long as this notice is preserved.
1669 dnl From Bruno Haible.
1671 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1672 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1673 dnl require excessive bracketing.
1674 ifdef([AC_HELP_STRING],
1675 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1676 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1678 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1679 dnl to access previously installed libraries. The basic assumption is that
1680 dnl a user will want packages to use other packages he previously installed
1681 dnl with the same --prefix option.
1682 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1683 dnl libraries, but is otherwise very convenient.
1684 AC_DEFUN([AC_LIB_PREFIX],
1686 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1687 AC_REQUIRE([AC_PROG_CC])
1688 AC_REQUIRE([AC_CANONICAL_HOST])
1689 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1690 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1691 dnl By default, look in $includedir and $libdir.
1693 AC_LIB_WITH_FINAL_PREFIX([
1694 eval additional_includedir=\"$includedir\"
1695 eval additional_libdir=\"$libdir\"
1697 AC_LIB_ARG_WITH([lib-prefix],
1698 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1699 --without-lib-prefix don't search for libraries in includedir and libdir],
1701 if test "X$withval" = "Xno"; then
1704 if test "X$withval" = "X"; then
1705 AC_LIB_WITH_FINAL_PREFIX([
1706 eval additional_includedir=\"$includedir\"
1707 eval additional_libdir=\"$libdir\"
1710 additional_includedir="$withval/include"
1711 additional_libdir="$withval/$acl_libdirstem"
1715 if test $use_additional = yes; then
1716 dnl Potentially add $additional_includedir to $CPPFLAGS.
1717 dnl But don't add it
1718 dnl 1. if it's the standard /usr/include,
1719 dnl 2. if it's already present in $CPPFLAGS,
1720 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1721 dnl 4. if it doesn't exist as a directory.
1722 if test "X$additional_includedir" != "X/usr/include"; then
1724 for x in $CPPFLAGS; do
1725 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1726 if test "X$x" = "X-I$additional_includedir"; then
1731 if test -z "$haveit"; then
1732 if test "X$additional_includedir" = "X/usr/local/include"; then
1733 if test -n "$GCC"; then
1735 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1739 if test -z "$haveit"; then
1740 if test -d "$additional_includedir"; then
1741 dnl Really add $additional_includedir to $CPPFLAGS.
1742 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1747 dnl Potentially add $additional_libdir to $LDFLAGS.
1748 dnl But don't add it
1749 dnl 1. if it's the standard /usr/lib,
1750 dnl 2. if it's already present in $LDFLAGS,
1751 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1752 dnl 4. if it doesn't exist as a directory.
1753 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1755 for x in $LDFLAGS; do
1756 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1757 if test "X$x" = "X-L$additional_libdir"; then
1762 if test -z "$haveit"; then
1763 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1764 if test -n "$GCC"; then
1766 linux*) haveit=yes;;
1770 if test -z "$haveit"; then
1771 if test -d "$additional_libdir"; then
1772 dnl Really add $additional_libdir to $LDFLAGS.
1773 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1781 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1782 dnl acl_final_exec_prefix, containing the values to which $prefix and
1783 dnl $exec_prefix will expand at the end of the configure script.
1784 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1786 dnl Unfortunately, prefix and exec_prefix get only finally determined
1787 dnl at the end of configure.
1788 if test "X$prefix" = "XNONE"; then
1789 acl_final_prefix="$ac_default_prefix"
1791 acl_final_prefix="$prefix"
1793 if test "X$exec_prefix" = "XNONE"; then
1794 acl_final_exec_prefix='${prefix}'
1796 acl_final_exec_prefix="$exec_prefix"
1798 acl_save_prefix="$prefix"
1799 prefix="$acl_final_prefix"
1800 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1801 prefix="$acl_save_prefix"
1804 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1805 dnl variables prefix and exec_prefix bound to the values they will have
1806 dnl at the end of the configure script.
1807 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1809 acl_save_prefix="$prefix"
1810 prefix="$acl_final_prefix"
1811 acl_save_exec_prefix="$exec_prefix"
1812 exec_prefix="$acl_final_exec_prefix"
1814 exec_prefix="$acl_save_exec_prefix"
1815 prefix="$acl_save_prefix"
1818 dnl AC_LIB_PREPARE_MULTILIB creates
1819 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1820 dnl "lib" or "lib64" or "lib/64",
1821 dnl - a variable acl_libdirstem2, as a secondary possible value for
1822 dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1824 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1826 dnl There is no formal standard regarding lib and lib64.
1827 dnl On glibc systems, the current practice is that on a system supporting
1828 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1829 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1830 dnl the compiler's default mode by looking at the compiler's library search
1831 dnl path. If at least one of its elements ends in /lib64 or points to a
1832 dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1833 dnl Otherwise we use the default, namely "lib".
1834 dnl On Solaris systems, the current practice is that on a system supporting
1835 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1836 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1837 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1838 AC_REQUIRE([AC_CANONICAL_HOST])
1843 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1844 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1845 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1846 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1847 dnl symlink is missing, so we set acl_libdirstem2 too.
1848 AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1849 [AC_EGREP_CPP([sixtyfour bits], [
1853 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
1855 if test $gl_cv_solaris_64bit = yes; then
1856 acl_libdirstem=lib/64
1858 sparc*) acl_libdirstem2=lib/sparcv9 ;;
1859 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1864 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1865 if test -n "$searchpath"; then
1866 acl_save_IFS="${IFS= }"; IFS=":"
1867 for searchdir in $searchpath; do
1868 if test -d "$searchdir"; then
1869 case "$searchdir" in
1870 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1872 # Better ignore directories of this form. They are misleading.
1874 *) searchdir=`cd "$searchdir" && pwd`
1875 case "$searchdir" in
1876 */lib64 ) acl_libdirstem=lib64 ;;
1885 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1888 # nls.m4 serial 5 (gettext-0.18)
1889 dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software
1890 dnl Foundation, Inc.
1891 dnl This file is free software; the Free Software Foundation
1892 dnl gives unlimited permission to copy and/or distribute it,
1893 dnl with or without modifications, as long as this notice is preserved.
1895 dnl This file can be used in projects which are not available under
1896 dnl the GNU General Public License or the GNU Library General Public
1897 dnl License but which still want to provide support for the GNU gettext
1899 dnl Please note that the actual code of the GNU gettext library is covered
1900 dnl by the GNU Library General Public License, and the rest of the GNU
1901 dnl gettext package is covered by the GNU General Public License.
1902 dnl They are *not* in the public domain.
1905 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1906 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1912 AC_MSG_CHECKING([whether NLS is requested])
1913 dnl Default is enabled NLS
1914 AC_ARG_ENABLE([nls],
1915 [ --disable-nls do not use Native Language Support],
1916 USE_NLS=$enableval, USE_NLS=yes)
1917 AC_MSG_RESULT([$USE_NLS])
1921 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1922 # serial 11 (pkg-config-0.29.1)
1924 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1925 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
1927 dnl This program is free software; you can redistribute it and/or modify
1928 dnl it under the terms of the GNU General Public License as published by
1929 dnl the Free Software Foundation; either version 2 of the License, or
1930 dnl (at your option) any later version.
1932 dnl This program is distributed in the hope that it will be useful, but
1933 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
1934 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1935 dnl General Public License for more details.
1937 dnl You should have received a copy of the GNU General Public License
1938 dnl along with this program; if not, write to the Free Software
1939 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1940 dnl 02111-1307, USA.
1942 dnl As a special exception to the GNU General Public License, if you
1943 dnl distribute this file as part of a program that contains a
1944 dnl configuration script generated by Autoconf, you may include it under
1945 dnl the same distribution terms that you use for the rest of that
1948 dnl PKG_PREREQ(MIN-VERSION)
1949 dnl -----------------------
1952 dnl Verify that the version of the pkg-config macros are at least
1953 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
1954 dnl installed version of pkg-config, this checks the developer's version
1955 dnl of pkg.m4 when generating configure.
1957 dnl To ensure that this macro is defined, also add:
1958 dnl m4_ifndef([PKG_PREREQ],
1959 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
1961 dnl See the "Since" comment for each macro you use to see what version
1962 dnl of the macros you require.
1963 m4_defun([PKG_PREREQ],
1964 [m4_define([PKG_MACROS_VERSION], [0.29.1])
1965 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
1966 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
1969 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
1970 dnl ----------------------------------
1973 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
1974 dnl first found in the path. Checks that the version of pkg-config found
1975 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
1976 dnl used since that's the first version where most current features of
1977 dnl pkg-config existed.
1978 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1979 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1980 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1981 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1982 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1983 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1984 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1986 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1987 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1989 if test -n "$PKG_CONFIG"; then
1990 _pkg_min_version=m4_default([$1], [0.9.0])
1991 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1992 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1993 AC_MSG_RESULT([yes])
1999 ])dnl PKG_PROG_PKG_CONFIG
2001 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2002 dnl -------------------------------------------------------------------
2005 dnl Check to see whether a particular set of modules exists. Similar to
2006 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
2008 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2009 dnl only at the first occurence in configure.ac, so if the first place
2010 dnl it's called might be skipped (such as if it is within an "if", you
2011 dnl have to call PKG_CHECK_EXISTS manually
2012 AC_DEFUN([PKG_CHECK_EXISTS],
2013 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2014 if test -n "$PKG_CONFIG" && \
2015 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2016 m4_default([$2], [:])
2017 m4_ifvaln([$3], [else
2021 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2022 dnl ---------------------------------------------
2023 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
2024 dnl pkg_failed based on the result.
2025 m4_define([_PKG_CONFIG],
2026 [if test -n "$$1"; then
2028 elif test -n "$PKG_CONFIG"; then
2029 PKG_CHECK_EXISTS([$3],
2030 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
2031 test "x$?" != "x0" && pkg_failed=yes ],
2038 dnl _PKG_SHORT_ERRORS_SUPPORTED
2039 dnl ---------------------------
2040 dnl Internal check to see if pkg-config supports short errors.
2041 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2042 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2043 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2044 _pkg_short_errors_supported=yes
2046 _pkg_short_errors_supported=no
2048 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
2051 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2052 dnl [ACTION-IF-NOT-FOUND])
2053 dnl --------------------------------------------------------------
2056 dnl Note that if there is a possibility the first call to
2057 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
2058 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2059 AC_DEFUN([PKG_CHECK_MODULES],
2060 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2061 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2062 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2065 AC_MSG_CHECKING([for $1])
2067 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2068 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
2070 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2071 and $1[]_LIBS to avoid the need to call pkg-config.
2072 See the pkg-config man page for more details.])
2074 if test $pkg_failed = yes; then
2076 _PKG_SHORT_ERRORS_SUPPORTED
2077 if test $_pkg_short_errors_supported = yes; then
2078 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
2080 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
2082 # Put the nasty error message in config.log where it belongs
2083 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2085 m4_default([$4], [AC_MSG_ERROR(
2086 [Package requirements ($2) were not met:
2090 Consider adjusting the PKG_CONFIG_PATH environment variable if you
2091 installed software in a non-standard prefix.
2095 elif test $pkg_failed = untried; then
2097 m4_default([$4], [AC_MSG_FAILURE(
2098 [The pkg-config script could not be found or is too old. Make sure it
2099 is in your PATH or set the PKG_CONFIG environment variable to the full
2104 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
2107 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2108 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2109 AC_MSG_RESULT([yes])
2112 ])dnl PKG_CHECK_MODULES
2115 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2116 dnl [ACTION-IF-NOT-FOUND])
2117 dnl ---------------------------------------------------------------------
2120 dnl Checks for existence of MODULES and gathers its build flags with
2121 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
2122 dnl and VARIABLE-PREFIX_LIBS from --libs.
2124 dnl Note that if there is a possibility the first call to
2125 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
2126 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
2128 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
2129 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2130 _save_PKG_CONFIG=$PKG_CONFIG
2131 PKG_CONFIG="$PKG_CONFIG --static"
2132 PKG_CHECK_MODULES($@)
2133 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
2134 ])dnl PKG_CHECK_MODULES_STATIC
2137 dnl PKG_INSTALLDIR([DIRECTORY])
2138 dnl -------------------------
2141 dnl Substitutes the variable pkgconfigdir as the location where a module
2142 dnl should install pkg-config .pc files. By default the directory is
2143 dnl $libdir/pkgconfig, but the default can be changed by passing
2144 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
2146 AC_DEFUN([PKG_INSTALLDIR],
2147 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
2148 m4_pushdef([pkg_description],
2149 [pkg-config installation directory @<:@]pkg_default[@:>@])
2150 AC_ARG_WITH([pkgconfigdir],
2151 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
2152 [with_pkgconfigdir=]pkg_default)
2153 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
2154 m4_popdef([pkg_default])
2155 m4_popdef([pkg_description])
2156 ])dnl PKG_INSTALLDIR
2159 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
2160 dnl --------------------------------
2163 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
2164 dnl module should install arch-independent pkg-config .pc files. By
2165 dnl default the directory is $datadir/pkgconfig, but the default can be
2166 dnl changed by passing DIRECTORY. The user can override through the
2167 dnl --with-noarch-pkgconfigdir parameter.
2168 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
2169 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
2170 m4_pushdef([pkg_description],
2171 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
2172 AC_ARG_WITH([noarch-pkgconfigdir],
2173 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
2174 [with_noarch_pkgconfigdir=]pkg_default)
2175 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
2176 m4_popdef([pkg_default])
2177 m4_popdef([pkg_description])
2178 ])dnl PKG_NOARCH_INSTALLDIR
2181 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
2182 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2183 dnl -------------------------------------------
2186 dnl Retrieves the value of the pkg-config variable for the given module.
2187 AC_DEFUN([PKG_CHECK_VAR],
2188 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2189 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
2191 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
2192 AS_VAR_COPY([$1], [pkg_cv_][$1])
2194 AS_VAR_IF([$1], [""], [$5], [$4])dnl
2197 dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
2198 dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
2199 dnl [DESCRIPTION], [DEFAULT])
2200 dnl ------------------------------------------
2202 dnl Prepare a "--with-" configure option using the lowercase
2203 dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
2204 dnl PKG_CHECK_MODULES in a single macro.
2205 AC_DEFUN([PKG_WITH_MODULES],
2207 m4_pushdef([with_arg], m4_tolower([$1]))
2209 m4_pushdef([description],
2210 [m4_default([$5], [build with ]with_arg[ support])])
2212 m4_pushdef([def_arg], [m4_default([$6], [auto])])
2213 m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
2214 m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
2217 [yes],[m4_pushdef([with_without], [--without-]with_arg)],
2218 [m4_pushdef([with_without],[--with-]with_arg)])
2220 AC_ARG_WITH(with_arg,
2221 AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
2222 [AS_TR_SH([with_]with_arg)=def_arg])
2224 AS_CASE([$AS_TR_SH([with_]with_arg)],
2225 [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
2226 [auto],[PKG_CHECK_MODULES([$1],[$2],
2227 [m4_n([def_action_if_found]) $3],
2228 [m4_n([def_action_if_not_found]) $4])])
2230 m4_popdef([with_arg])
2231 m4_popdef([description])
2232 m4_popdef([def_arg])
2234 ])dnl PKG_WITH_MODULES
2236 dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
2237 dnl [DESCRIPTION], [DEFAULT])
2238 dnl -----------------------------------------------
2240 dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
2241 dnl check._[VARIABLE-PREFIX] is exported as make variable.
2242 AC_DEFUN([PKG_HAVE_WITH_MODULES],
2244 PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
2246 AM_CONDITIONAL([HAVE_][$1],
2247 [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
2248 ])dnl PKG_HAVE_WITH_MODULES
2250 dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
2251 dnl [DESCRIPTION], [DEFAULT])
2252 dnl ------------------------------------------------------
2254 dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
2255 dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
2256 dnl and preprocessor variable.
2257 AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
2259 PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
2261 AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
2262 [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
2263 ])dnl PKG_HAVE_DEFINE_WITH_MODULES
2265 # po.m4 serial 24 (gettext-0.19)
2266 dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
2267 dnl This file is free software; the Free Software Foundation
2268 dnl gives unlimited permission to copy and/or distribute it,
2269 dnl with or without modifications, as long as this notice is preserved.
2271 dnl This file can be used in projects which are not available under
2272 dnl the GNU General Public License or the GNU Library General Public
2273 dnl License but which still want to provide support for the GNU gettext
2275 dnl Please note that the actual code of the GNU gettext library is covered
2276 dnl by the GNU Library General Public License, and the rest of the GNU
2277 dnl gettext package is covered by the GNU General Public License.
2278 dnl They are *not* in the public domain.
2281 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2282 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2286 dnl Checks for all prerequisites of the po subdirectory.
2287 AC_DEFUN([AM_PO_SUBDIRS],
2289 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2290 AC_REQUIRE([AC_PROG_INSTALL])dnl
2291 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2292 AC_REQUIRE([AC_PROG_SED])dnl
2293 AC_REQUIRE([AM_NLS])dnl
2295 dnl Release version of the gettext macros. This is used to ensure that
2296 dnl the gettext macros and po/Makefile.in.in are in sync.
2297 AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
2299 dnl Perform the following tests also if --disable-nls has been given,
2300 dnl because they are needed for "make dist" to work.
2302 dnl Search for GNU msgfmt in the PATH.
2303 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2304 dnl The second test excludes FreeBSD msgfmt.
2305 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2306 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2307 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2309 AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
2311 dnl Test whether it is GNU msgfmt >= 0.15.
2313 case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2314 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
2315 *) MSGFMT_015=$MSGFMT ;;
2318 AC_SUBST([MSGFMT_015])
2320 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2321 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
2322 *) GMSGFMT_015=$GMSGFMT ;;
2325 AC_SUBST([GMSGFMT_015])
2327 dnl Search for GNU xgettext 0.12 or newer in the PATH.
2328 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2329 dnl The second test excludes FreeBSD xgettext.
2330 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2331 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2332 (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)],
2334 dnl Remove leftover from FreeBSD xgettext call.
2337 dnl Test whether it is GNU xgettext >= 0.15.
2339 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2340 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
2341 *) XGETTEXT_015=$XGETTEXT ;;
2344 AC_SUBST([XGETTEXT_015])
2346 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2347 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2348 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2350 dnl Installation directories.
2351 dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
2352 dnl have to define it here, so that it can be used in po/Makefile.
2353 test -n "$localedir" || localedir='${datadir}/locale'
2354 AC_SUBST([localedir])
2356 dnl Support for AM_XGETTEXT_OPTION.
2357 test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
2358 AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
2360 AC_CONFIG_COMMANDS([po-directories], [[
2361 for ac_file in $CONFIG_FILES; do
2362 # Support "outfile[:infile[:infile...]]"
2364 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2366 # PO directories have a Makefile.in generated from Makefile.in.in.
2367 case "$ac_file" in */Makefile.in)
2368 # Adjust a relative srcdir.
2369 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2370 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
2371 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2372 # In autoconf-2.13 it is called $ac_given_srcdir.
2373 # In autoconf-2.50 it is called $srcdir.
2374 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2375 case "$ac_given_srcdir" in
2376 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2377 /*) top_srcdir="$ac_given_srcdir" ;;
2378 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2380 # Treat a directory as a PO directory if and only if it has a
2381 # POTFILES.in file. This allows packages to have multiple PO
2382 # directories under different names or in different locations.
2383 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2384 rm -f "$ac_dir/POTFILES"
2385 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2386 gt_tab=`printf '\t'`
2387 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"
2388 POMAKEFILEDEPS="POTFILES.in"
2389 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2390 # on $ac_dir but don't depend on user-specified configuration
2392 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2393 # The LINGUAS file contains the set of available languages.
2394 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2395 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2397 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2398 # Hide the ALL_LINGUAS assignment from automake < 1.5.
2399 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2400 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2402 # The set of available languages was given in configure.in.
2403 # Hide the ALL_LINGUAS assignment from automake < 1.5.
2404 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2407 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2408 # Compute UPDATEPOFILES
2409 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2410 # Compute DUMMYPOFILES
2411 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2413 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2414 case "$ac_given_srcdir" in
2416 *) srcdirpre='$(srcdir)/' ;;
2422 for lang in $ALL_LINGUAS; do
2423 POFILES="$POFILES $srcdirpre$lang.po"
2424 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2425 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2426 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2428 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2429 # environment variable.
2431 if test -n "$ALL_LINGUAS"; then
2432 for presentlang in $ALL_LINGUAS; do
2434 if test "%UNSET%" != "$LINGUAS"; then
2435 desiredlanguages="$LINGUAS"
2437 desiredlanguages="$ALL_LINGUAS"
2439 for desiredlang in $desiredlanguages; do
2440 # Use the presentlang catalog if desiredlang is
2441 # a. equal to presentlang, or
2442 # b. a variant of presentlang (because in this case,
2443 # presentlang can be used as a fallback for messages
2444 # which are not translated in the desiredlang catalog).
2445 case "$desiredlang" in
2446 "$presentlang"*) useit=yes;;
2449 if test $useit = yes; then
2450 INST_LINGUAS="$INST_LINGUAS $presentlang"
2455 if test -n "$INST_LINGUAS"; then
2456 for lang in $INST_LINGUAS; do
2457 CATALOGS="$CATALOGS $lang.gmo"
2460 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2461 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"
2462 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2463 if test -f "$f"; then
2465 *.orig | *.bak | *~) ;;
2466 *) cat "$f" >> "$ac_dir/Makefile" ;;
2474 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2475 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2476 # from automake < 1.5.
2477 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2478 # Capture the value of LINGUAS because we need it to compute CATALOGS.
2479 LINGUAS="${LINGUAS-%UNSET%}"
2483 dnl Postprocesses a Makefile in a directory containing PO files.
2484 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2486 # When this code is run, in config.status, two variables have already been
2488 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2489 # - LINGUAS is the value of the environment variable LINGUAS at configure
2493 # Adjust a relative srcdir.
2494 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2495 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
2496 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2497 # In autoconf-2.13 it is called $ac_given_srcdir.
2498 # In autoconf-2.50 it is called $srcdir.
2499 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2500 case "$ac_given_srcdir" in
2501 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2502 /*) top_srcdir="$ac_given_srcdir" ;;
2503 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2506 # Find a way to echo strings without interpreting backslash.
2507 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2510 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2511 gt_echo='printf %s\n'
2522 # A sed script that extracts the value of VARIABLE from a Makefile.
2525 # Test if the hold space is empty.
2530 # Yes it was empty. Look if we have the expected variable definition.
2531 /^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
2532 # Seen the first line of the variable definition.
2533 s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
2538 # Here we are processing a line from the variable definition.
2539 # Remove comment, more precisely replace it with a space.
2541 # See if the line ends in a backslash.
2545 # Print the line, without the trailing backslash.
2548 # There was no trailing backslash. The end of the variable definition is
2549 # reached. Clear the hold space.
2554 # A trailing backslash means that the variable definition continues in the
2555 # next line. Put a nonempty string into the hold space to indicate this.
2562 # Set POTFILES to the value of the Makefile variable POTFILES.
2563 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
2564 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2565 # Compute POTFILES_DEPS as
2566 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2568 for file in $POTFILES; do
2569 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2573 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2574 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2576 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2577 # The LINGUAS file contains the set of available languages.
2578 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2579 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2581 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2582 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2583 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2585 # Hide the ALL_LINGUAS assignment from automake < 1.5.
2586 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2588 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2589 # Compute UPDATEPOFILES
2590 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2591 # Compute DUMMYPOFILES
2592 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2594 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2595 # Compute PROPERTIESFILES
2596 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2597 # Compute CLASSFILES
2598 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2600 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2602 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2603 # Compute RESOURCESDLLFILES
2604 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2605 case "$ac_given_srcdir" in
2607 *) srcdirpre='$(srcdir)/' ;;
2618 for lang in $ALL_LINGUAS; do
2619 POFILES="$POFILES $srcdirpre$lang.po"
2620 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2621 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2622 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2623 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2624 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2625 QMFILES="$QMFILES $srcdirpre$lang.qm"
2626 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2627 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2628 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/'`
2629 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2631 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2632 # environment variable.
2634 if test -n "$ALL_LINGUAS"; then
2635 for presentlang in $ALL_LINGUAS; do
2637 if test "%UNSET%" != "$LINGUAS"; then
2638 desiredlanguages="$LINGUAS"
2640 desiredlanguages="$ALL_LINGUAS"
2642 for desiredlang in $desiredlanguages; do
2643 # Use the presentlang catalog if desiredlang is
2644 # a. equal to presentlang, or
2645 # b. a variant of presentlang (because in this case,
2646 # presentlang can be used as a fallback for messages
2647 # which are not translated in the desiredlang catalog).
2648 case "$desiredlang" in
2649 "$presentlang"*) useit=yes;;
2652 if test $useit = yes; then
2653 INST_LINGUAS="$INST_LINGUAS $presentlang"
2662 if test -n "$INST_LINGUAS"; then
2663 for lang in $INST_LINGUAS; do
2664 CATALOGS="$CATALOGS $lang.gmo"
2665 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2666 QTCATALOGS="$QTCATALOGS $lang.qm"
2667 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2668 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2669 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/'`
2670 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2674 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"
2676 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2677 # Add dependencies that cannot be formulated as a simple suffix rule.
2678 for lang in $ALL_LINGUAS; do
2679 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2680 cat >> "$ac_file.tmp" <<EOF
2681 $frobbedlang.msg: $lang.po
2682 ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2683 ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2687 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2688 # Add dependencies that cannot be formulated as a simple suffix rule.
2689 for lang in $ALL_LINGUAS; do
2690 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/'`
2691 cat >> "$ac_file.tmp" <<EOF
2692 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2693 ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2694 ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2698 if test -n "$POMAKEFILEDEPS"; then
2699 cat >> "$ac_file.tmp" <<EOF
2700 Makefile: $POMAKEFILEDEPS
2703 mv "$ac_file.tmp" "$ac_file"
2706 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
2707 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
2709 XGETTEXT_EXTRA_OPTIONS=
2712 dnl Registers an option to be passed to xgettext in the po subdirectory.
2713 AC_DEFUN([AM_XGETTEXT_OPTION],
2715 AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
2716 XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
2719 # progtest.m4 serial 7 (gettext-0.18.2)
2720 dnl Copyright (C) 1996-2003, 2005, 2008-2016 Free Software Foundation, Inc.
2721 dnl This file is free software; the Free Software Foundation
2722 dnl gives unlimited permission to copy and/or distribute it,
2723 dnl with or without modifications, as long as this notice is preserved.
2725 dnl This file can be used in projects which are not available under
2726 dnl the GNU General Public License or the GNU Library General Public
2727 dnl License but which still want to provide support for the GNU gettext
2729 dnl Please note that the actual code of the GNU gettext library is covered
2730 dnl by the GNU Library General Public License, and the rest of the GNU
2731 dnl gettext package is covered by the GNU General Public License.
2732 dnl They are *not* in the public domain.
2735 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2739 # Search path for a program which passes the given test.
2741 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2742 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2743 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2745 # Prepare PATH_SEPARATOR.
2746 # The user is always right.
2747 if test "${PATH_SEPARATOR+set}" != set; then
2748 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
2749 # contains only /bin. Note that ksh looks also at the FPATH variable,
2750 # so we have to set that as well for the test.
2752 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
2753 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
2754 || PATH_SEPARATOR=';'
2758 # Find out how to test for executable files. Don't use a zero-byte file,
2759 # as systems may use methods other than mode bits to determine executability.
2760 cat >conf$$.file <<_ASEOF
2764 chmod +x conf$$.file
2765 if test -x conf$$.file >/dev/null 2>&1; then
2766 ac_executable_p="test -x"
2768 ac_executable_p="test -f"
2772 # Extract the first word of "$2", so it can be a program name with args.
2773 set dummy $2; ac_word=[$]2
2774 AC_MSG_CHECKING([for $ac_word])
2775 AC_CACHE_VAL([ac_cv_path_$1],
2777 [[\\/]]* | ?:[[\\/]]*)
2778 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2781 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2782 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2784 test -z "$ac_dir" && ac_dir=.
2785 for ac_exec_ext in '' $ac_executable_extensions; do
2786 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2787 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2789 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2796 dnl If no 4th arg is given, leave the cache variable unset,
2797 dnl so AC_PATH_PROGS will keep looking.
2798 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2803 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2804 AC_MSG_RESULT([$][$1])
2811 m4_include([acinclude.m4])