1 # generated automatically by aclocal 1.14.1 -*- Autoconf -*-
3 # Copyright (C) 1996-2013 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 # codeset.m4 serial 5 (gettext-0.18.2)
16 dnl Copyright (C) 2000-2002, 2006, 2008-2013 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 From Bruno Haible.
23 AC_DEFUN([AM_LANGINFO_CODESET],
25 AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
28 [[#include <langinfo.h>]],
29 [[char* cs = nl_langinfo(CODESET); return !cs;]])],
30 [am_cv_langinfo_codeset=yes],
31 [am_cv_langinfo_codeset=no])
33 if test $am_cv_langinfo_codeset = yes; then
34 AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
35 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
39 dnl 'extern inline' a la ISO C99.
41 dnl Copyright 2012-2013 Free Software Foundation, Inc.
42 dnl This file is free software; the Free Software Foundation
43 dnl gives unlimited permission to copy and/or distribute it,
44 dnl with or without modifications, as long as this notice is preserved.
46 AC_DEFUN([gl_EXTERN_INLINE],
48 AH_VERBATIM([extern_inline],
49 [/* Please see the Gnulib manual for how to use these macros.
51 Suppress extern inline with HP-UX cc, as it appears to be broken; see
52 <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
54 Suppress extern inline with Sun C in standards-conformance mode, as it
55 mishandles inline functions that call each other. E.g., for 'inline void f
56 (void) { } inline void g (void) { f (); }', c99 incorrectly complains
57 'reference to static identifier "f" in extern inline function'.
58 This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
60 Suppress the use of extern inline on Apple's platforms, as Libc at least
61 through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
62 <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
63 Perhaps Apple will fix this some day. */
65 ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
66 : (199901L <= __STDC_VERSION__ \
68 && !(defined __SUNPRO_C && __STDC__))) \
69 && !defined __APPLE__)
70 # define _GL_INLINE inline
71 # define _GL_EXTERN_INLINE extern inline
72 #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
73 && !defined __APPLE__)
74 # if __GNUC_GNU_INLINE__
75 /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
76 # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
78 # define _GL_INLINE extern inline
80 # define _GL_EXTERN_INLINE extern
82 # define _GL_INLINE static _GL_UNUSED
83 # define _GL_EXTERN_INLINE static _GL_UNUSED
86 #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
87 # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
88 # define _GL_INLINE_HEADER_CONST_PRAGMA
90 # define _GL_INLINE_HEADER_CONST_PRAGMA \
91 _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
93 /* Suppress GCC's bogus "no previous prototype for 'FOO'"
94 and "no previous declaration for 'FOO'" diagnostics,
95 when FOO is an inline function in the header; see
96 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */
97 # define _GL_INLINE_HEADER_BEGIN \
98 _Pragma ("GCC diagnostic push") \
99 _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
100 _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
101 _GL_INLINE_HEADER_CONST_PRAGMA
102 # define _GL_INLINE_HEADER_END \
103 _Pragma ("GCC diagnostic pop")
105 # define _GL_INLINE_HEADER_BEGIN
106 # define _GL_INLINE_HEADER_END
110 # fcntl-o.m4 serial 4
111 dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
112 dnl This file is free software; the Free Software Foundation
113 dnl gives unlimited permission to copy and/or distribute it,
114 dnl with or without modifications, as long as this notice is preserved.
116 dnl Written by Paul Eggert.
118 # Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
119 # Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
120 # Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
121 AC_DEFUN([gl_FCNTL_O_FLAGS],
123 dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
124 dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
126 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
127 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
128 [AC_REQUIRE([AC_GNU_SOURCE])])
130 AC_CHECK_HEADERS_ONCE([unistd.h])
131 AC_CHECK_FUNCS_ONCE([symlink])
132 AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
135 [[#include <sys/types.h>
136 #include <sys/stat.h>
139 #else /* on Windows with MSVC */
142 # defined sleep(n) _sleep ((n) * 1000)
151 static int const constants[] =
153 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
154 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
158 int result = !constants;
161 static char const sym[] = "conftest.sym";
162 if (symlink ("/dev/null", sym) != 0)
166 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
173 if (unlink (sym) != 0 || symlink (".", sym) != 0)
177 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
188 static char const file[] = "confdefs.h";
189 int fd = open (file, O_RDONLY | O_NOATIME);
195 if (fstat (fd, &st0) != 0)
201 if (read (fd, &c, 1) != 1)
210 if (stat (file, &st1) != 0)
213 if (st0.st_atime != st1.st_atime)
221 [gl_cv_header_working_fcntl_h=yes],
223 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
224 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
225 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
226 *) gl_cv_header_working_fcntl_h='no';;
228 [gl_cv_header_working_fcntl_h=cross-compiling])])
230 case $gl_cv_header_working_fcntl_h in #(
231 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
234 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
235 [Define to 1 if O_NOATIME works.])
237 case $gl_cv_header_working_fcntl_h in #(
238 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
241 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
242 [Define to 1 if O_NOFOLLOW works.])
245 # gettext.m4 serial 66 (gettext-0.18.2)
246 dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
247 dnl This file is free software; the Free Software Foundation
248 dnl gives unlimited permission to copy and/or distribute it,
249 dnl with or without modifications, as long as this notice is preserved.
251 dnl This file can can be used in projects which are not available under
252 dnl the GNU General Public License or the GNU Library General Public
253 dnl License but which still want to provide support for the GNU gettext
255 dnl Please note that the actual code of the GNU gettext library is covered
256 dnl by the GNU Library General Public License, and the rest of the GNU
257 dnl gettext package package is covered by the GNU General Public License.
258 dnl They are *not* in the public domain.
261 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
262 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
264 dnl Macro to add for using GNU gettext.
266 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
267 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
268 dnl default (if it is not specified or empty) is 'no-libtool'.
269 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
270 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
271 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
272 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
273 dnl depending on --{enable,disable}-{shared,static} and on the presence of
274 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
275 dnl $(top_builddir)/intl/libintl.a will be created.
276 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
277 dnl implementations (in libc or libintl) without the ngettext() function
278 dnl will be ignored. If NEEDSYMBOL is specified and is
279 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
280 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
281 dnl INTLDIR is used to find the intl libraries. If empty,
282 dnl the value '$(top_builddir)/intl/' is used.
284 dnl The result of the configuration is one of three cases:
285 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
287 dnl Catalog format: GNU --> install in $(datadir)
288 dnl Catalog extension: .mo after installation, .gmo in source tree
289 dnl 2) GNU gettext has been found in the system's C library.
290 dnl Catalog format: GNU --> install in $(datadir)
291 dnl Catalog extension: .mo after installation, .gmo in source tree
292 dnl 3) No internationalization, always use English msgid.
293 dnl Catalog format: none
294 dnl Catalog extension: none
295 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
296 dnl The use of .gmo is historical (it was needed to avoid overwriting the
297 dnl GNU format catalogs when building on a platform with an X/Open gettext),
298 dnl but we keep it in order not to force irrelevant filename changes on the
301 AC_DEFUN([AM_GNU_GETTEXT],
303 dnl Argument checking.
304 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
305 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
307 ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
308 [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
309 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
310 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
312 define([gt_included_intl],
313 ifelse([$1], [external],
314 ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
316 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
318 AM_GNU_GETTEXT_NEED([$2])
320 AC_REQUIRE([AM_PO_SUBDIRS])dnl
321 ifelse(gt_included_intl, yes, [
322 AC_REQUIRE([AM_INTL_SUBDIR])dnl
325 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
326 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
327 AC_REQUIRE([AC_LIB_RPATH])
329 dnl Sometimes libintl requires libiconv, so first search for libiconv.
330 dnl Ideally we would do this search only after the
331 dnl if test "$USE_NLS" = "yes"; then
332 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
333 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
334 dnl the configure script would need to contain the same shell code
335 dnl again, outside any 'if'. There are two solutions:
336 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
337 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
338 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
339 dnl documented, we avoid it.
340 ifelse(gt_included_intl, yes, , [
341 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
344 dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
350 ifelse(gt_included_intl, yes, [
351 BUILD_INCLUDED_LIBINTL=no
352 USE_INCLUDED_LIBINTL=no
358 dnl Add a version number to the cache macros.
359 case " $gt_needs " in
360 *" need-formatstring-macros "*) gt_api_version=3 ;;
361 *" need-ngettext "*) gt_api_version=2 ;;
362 *) gt_api_version=1 ;;
364 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
365 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
367 dnl If we use NLS figure out what method
368 if test "$USE_NLS" = "yes"; then
369 gt_use_preinstalled_gnugettext=no
370 ifelse(gt_included_intl, yes, [
371 AC_MSG_CHECKING([whether included gettext is requested])
372 AC_ARG_WITH([included-gettext],
373 [ --with-included-gettext use the GNU gettext library included here],
374 nls_cv_force_use_gnu_gettext=$withval,
375 nls_cv_force_use_gnu_gettext=no)
376 AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
378 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
379 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
381 dnl User does not insist on using GNU NLS library. Figure out what
382 dnl to use. If GNU gettext is available we use this. Else we have
383 dnl to fall back to GNU NLS library.
385 if test $gt_api_version -ge 3; then
386 gt_revision_test_code='
387 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
388 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
391 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
395 gt_revision_test_code=
397 if test $gt_api_version -ge 2; then
398 gt_expression_test_code=' + * ngettext ("", "", 0)'
400 gt_expression_test_code=
403 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
408 $gt_revision_test_code
409 extern int _nl_msg_cat_cntr;
410 extern int *_nl_domain_bindings;
413 bindtextdomain ("", "");
414 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
416 [eval "$gt_func_gnugettext_libc=yes"],
417 [eval "$gt_func_gnugettext_libc=no"])])
419 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
420 dnl Sometimes libintl requires libiconv, so first search for libiconv.
421 ifelse(gt_included_intl, yes, , [
424 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
425 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
426 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
427 dnl even if libiconv doesn't exist.
428 AC_LIB_LINKFLAGS_BODY([intl])
429 AC_CACHE_CHECK([for GNU gettext in libintl],
430 [$gt_func_gnugettext_libintl],
431 [gt_save_CPPFLAGS="$CPPFLAGS"
432 CPPFLAGS="$CPPFLAGS $INCINTL"
434 LIBS="$LIBS $LIBINTL"
435 dnl Now see whether libintl exists and does not depend on libiconv.
440 $gt_revision_test_code
441 extern int _nl_msg_cat_cntr;
446 const char *_nl_expand_alias (const char *);
449 bindtextdomain ("", "");
450 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
452 [eval "$gt_func_gnugettext_libintl=yes"],
453 [eval "$gt_func_gnugettext_libintl=no"])
454 dnl Now see whether libintl exists and depends on libiconv.
455 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
456 LIBS="$LIBS $LIBICONV"
461 $gt_revision_test_code
462 extern int _nl_msg_cat_cntr;
467 const char *_nl_expand_alias (const char *);
470 bindtextdomain ("", "");
471 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
473 [LIBINTL="$LIBINTL $LIBICONV"
474 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
475 eval "$gt_func_gnugettext_libintl=yes"
478 CPPFLAGS="$gt_save_CPPFLAGS"
479 LIBS="$gt_save_LIBS"])
482 dnl If an already present or preinstalled GNU gettext() is found,
483 dnl use it. But if this macro is used in GNU gettext, and GNU
484 dnl gettext is already preinstalled in libintl, we update this
485 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
486 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
487 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
488 && test "$PACKAGE" != gettext-runtime \
489 && test "$PACKAGE" != gettext-tools; }; then
490 gt_use_preinstalled_gnugettext=yes
492 dnl Reset the values set by searching for libintl.
498 ifelse(gt_included_intl, yes, [
499 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
500 dnl GNU gettext is not found in the C library.
501 dnl Fall back on included GNU gettext library.
502 nls_cv_use_gnu_gettext=yes
506 if test "$nls_cv_use_gnu_gettext" = "yes"; then
507 dnl Mark actions used to generate GNU NLS library.
508 BUILD_INCLUDED_LIBINTL=yes
509 USE_INCLUDED_LIBINTL=yes
510 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
511 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
512 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
516 if test "$gt_use_preinstalled_gnugettext" = "yes" \
517 || test "$nls_cv_use_gnu_gettext" = "yes"; then
518 dnl Mark actions to use GNU gettext tools.
523 if test -n "$INTL_MACOSX_LIBS"; then
524 if test "$gt_use_preinstalled_gnugettext" = "yes" \
525 || test "$nls_cv_use_gnu_gettext" = "yes"; then
526 dnl Some extra flags are needed during linking.
527 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
528 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
532 if test "$gt_use_preinstalled_gnugettext" = "yes" \
533 || test "$nls_cv_use_gnu_gettext" = "yes"; then
534 AC_DEFINE([ENABLE_NLS], [1],
535 [Define to 1 if translation of program messages to the user's native language
542 AC_MSG_CHECKING([whether to use NLS])
543 AC_MSG_RESULT([$USE_NLS])
544 if test "$USE_NLS" = "yes"; then
545 AC_MSG_CHECKING([where the gettext function comes from])
546 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
547 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
548 gt_source="external libintl"
553 gt_source="included intl directory"
555 AC_MSG_RESULT([$gt_source])
558 if test "$USE_NLS" = "yes"; then
560 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
561 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
562 AC_MSG_CHECKING([how to link with libintl])
563 AC_MSG_RESULT([$LIBINTL])
564 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
567 dnl For backward compatibility. Some packages may be using this.
568 AC_DEFINE([HAVE_GETTEXT], [1],
569 [Define if the GNU gettext() function is already present or preinstalled.])
570 AC_DEFINE([HAVE_DCGETTEXT], [1],
571 [Define if the GNU dcgettext() function is already present or preinstalled.])
574 dnl We need to process the po/ directory.
578 ifelse(gt_included_intl, yes, [
579 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
580 dnl to 'yes' because some of the testsuite requires it.
581 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
582 BUILD_INCLUDED_LIBINTL=yes
585 dnl Make all variables we use known to autoconf.
586 AC_SUBST([BUILD_INCLUDED_LIBINTL])
587 AC_SUBST([USE_INCLUDED_LIBINTL])
588 AC_SUBST([CATOBJEXT])
590 dnl For backward compatibility. Some configure.ins may be using this.
594 dnl For backward compatibility. Some Makefiles may be using this.
596 AC_SUBST([DATADIRNAME])
598 dnl For backward compatibility. Some Makefiles may be using this.
600 AC_SUBST([INSTOBJEXT])
602 dnl For backward compatibility. Some Makefiles may be using this.
606 dnl For backward compatibility. Some Makefiles may be using this.
608 if test "$USE_INCLUDED_LIBINTL" = yes; then
609 INTLOBJS="\$(GETTOBJS)"
613 dnl Enable libtool support if the surrounding package wishes it.
614 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
615 AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
618 dnl For backward compatibility. Some Makefiles may be using this.
622 dnl Make all documented variables known to autoconf.
624 AC_SUBST([LTLIBINTL])
629 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
630 m4_define([gt_NEEDS_INIT],
632 m4_divert_text([DEFAULTS], [gt_needs=])
633 m4_define([gt_NEEDS_INIT], [])
637 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
638 AC_DEFUN([AM_GNU_GETTEXT_NEED],
640 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
644 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
645 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
648 dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
650 dnl This file is free software; the Free Software Foundation
651 dnl gives unlimited permission to copy and/or distribute it,
652 dnl with or without modifications, as long as this notice is preserved.
654 # Test for the GNU C Library, version 2.0 or newer.
657 AC_DEFUN([gt_GLIBC2],
659 AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
660 [ac_cv_gnu_library_2],
661 [AC_EGREP_CPP([Lucky GNU user],
663 #include <features.h>
664 #ifdef __GNU_LIBRARY__
665 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
670 [ac_cv_gnu_library_2=yes],
671 [ac_cv_gnu_library_2=no])
675 GLIBC2="$ac_cv_gnu_library_2"
679 # glibc21.m4 serial 5
680 dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
682 dnl This file is free software; the Free Software Foundation
683 dnl gives unlimited permission to copy and/or distribute it,
684 dnl with or without modifications, as long as this notice is preserved.
686 # Test for the GNU C Library, version 2.1 or newer, or uClibc.
689 AC_DEFUN([gl_GLIBC21],
691 AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
692 [ac_cv_gnu_library_2_1],
693 [AC_EGREP_CPP([Lucky],
695 #include <features.h>
696 #ifdef __GNU_LIBRARY__
697 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
705 [ac_cv_gnu_library_2_1=yes],
706 [ac_cv_gnu_library_2_1=no])
710 GLIBC21="$ac_cv_gnu_library_2_1"
714 # iconv.m4 serial 18 (gettext-0.18.2)
715 dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc.
716 dnl This file is free software; the Free Software Foundation
717 dnl gives unlimited permission to copy and/or distribute it,
718 dnl with or without modifications, as long as this notice is preserved.
720 dnl From Bruno Haible.
722 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
724 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
725 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
726 AC_REQUIRE([AC_LIB_RPATH])
728 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
730 AC_LIB_LINKFLAGS_BODY([iconv])
733 AC_DEFUN([AM_ICONV_LINK],
735 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
736 dnl those with the standalone portable GNU libiconv installed).
737 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
739 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
741 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
743 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
744 dnl because if the user has installed libiconv and not disabled its use
745 dnl via --without-libiconv-prefix, he wants to use it. The first
746 dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
747 am_save_CPPFLAGS="$CPPFLAGS"
748 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
750 AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
751 am_cv_func_iconv="no, consider installing GNU libiconv"
759 [[iconv_t cd = iconv_open("","");
760 iconv(cd,NULL,NULL,NULL,NULL);
761 iconv_close(cd);]])],
762 [am_cv_func_iconv=yes])
763 if test "$am_cv_func_iconv" != yes; then
765 LIBS="$LIBS $LIBICONV"
772 [[iconv_t cd = iconv_open("","");
773 iconv(cd,NULL,NULL,NULL,NULL);
774 iconv_close(cd);]])],
775 [am_cv_lib_iconv=yes]
776 [am_cv_func_iconv=yes])
780 if test "$am_cv_func_iconv" = yes; then
781 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
782 dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
785 if test $am_cv_lib_iconv = yes; then
786 LIBS="$LIBS $LIBICONV"
795 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
798 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
799 if (cd_utf8_to_88591 != (iconv_t)(-1))
801 static const char input[] = "\342\202\254"; /* EURO SIGN */
803 const char *inptr = input;
804 size_t inbytesleft = strlen (input);
806 size_t outbytesleft = sizeof (buf);
807 size_t res = iconv (cd_utf8_to_88591,
808 (char **) &inptr, &inbytesleft,
809 &outptr, &outbytesleft);
812 iconv_close (cd_utf8_to_88591);
815 /* Test against Solaris 10 bug: Failures are not distinguishable from
816 successful returns. */
818 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
819 if (cd_ascii_to_88591 != (iconv_t)(-1))
821 static const char input[] = "\263";
823 const char *inptr = input;
824 size_t inbytesleft = strlen (input);
826 size_t outbytesleft = sizeof (buf);
827 size_t res = iconv (cd_ascii_to_88591,
828 (char **) &inptr, &inbytesleft,
829 &outptr, &outbytesleft);
832 iconv_close (cd_ascii_to_88591);
835 /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
837 iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
838 if (cd_88591_to_utf8 != (iconv_t)(-1))
840 static const char input[] = "\304";
841 static char buf[2] = { (char)0xDE, (char)0xAD };
842 const char *inptr = input;
843 size_t inbytesleft = 1;
845 size_t outbytesleft = 1;
846 size_t res = iconv (cd_88591_to_utf8,
847 (char **) &inptr, &inbytesleft,
848 &outptr, &outbytesleft);
849 if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
851 iconv_close (cd_88591_to_utf8);
854 #if 0 /* This bug could be worked around by the caller. */
855 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
857 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
858 if (cd_88591_to_utf8 != (iconv_t)(-1))
860 static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
862 const char *inptr = input;
863 size_t inbytesleft = strlen (input);
865 size_t outbytesleft = sizeof (buf);
866 size_t res = iconv (cd_88591_to_utf8,
867 (char **) &inptr, &inbytesleft,
868 &outptr, &outbytesleft);
871 iconv_close (cd_88591_to_utf8);
875 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
877 if (/* Try standardized names. */
878 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
879 /* Try IRIX, OSF/1 names. */
880 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
882 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
883 /* Try HP-UX names. */
884 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
888 [am_cv_func_iconv_works=yes],
889 [am_cv_func_iconv_works=no],
893 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
894 *) am_cv_func_iconv_works="guessing yes" ;;
900 case "$am_cv_func_iconv_works" in
901 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
902 *) am_func_iconv=yes ;;
905 am_func_iconv=no am_cv_lib_iconv=no
907 if test "$am_func_iconv" = yes; then
908 AC_DEFINE([HAVE_ICONV], [1],
909 [Define if you have the iconv() function and it works.])
911 if test "$am_cv_lib_iconv" = yes; then
912 AC_MSG_CHECKING([how to link with libiconv])
913 AC_MSG_RESULT([$LIBICONV])
915 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
917 CPPFLAGS="$am_save_CPPFLAGS"
922 AC_SUBST([LTLIBICONV])
925 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
926 dnl avoid warnings like
927 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
928 dnl This is tricky because of the way 'aclocal' is implemented:
929 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
930 dnl Otherwise aclocal's initial scan pass would miss the macro definition.
931 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
932 dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
934 m4_define([gl_iconv_AC_DEFUN],
935 m4_version_prereq([2.64],
938 [m4_ifdef([gl_00GNULIB],
943 gl_iconv_AC_DEFUN([AM_ICONV],
946 if test "$am_cv_func_iconv" = yes; then
947 AC_MSG_CHECKING([for iconv declaration])
948 AC_CACHE_VAL([am_cv_proto_iconv], [
958 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
959 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
965 [am_cv_proto_iconv_arg1=""],
966 [am_cv_proto_iconv_arg1="const"])
967 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);"])
968 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
971 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
972 [Define as const if the declaration of iconv() needs const.])
973 dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
974 m4_ifdef([gl_ICONV_H_DEFAULTS],
975 [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
976 if test -n "$am_cv_proto_iconv_arg1"; then
983 # intdiv0.m4 serial 6 (gettext-0.18.2)
984 dnl Copyright (C) 2002, 2007-2008, 2010-2013 Free Software Foundation, Inc.
985 dnl This file is free software; the Free Software Foundation
986 dnl gives unlimited permission to copy and/or distribute it,
987 dnl with or without modifications, as long as this notice is preserved.
989 dnl From Bruno Haible.
991 AC_DEFUN([gt_INTDIV0],
993 AC_REQUIRE([AC_PROG_CC])dnl
994 AC_REQUIRE([AC_CANONICAL_HOST])dnl
996 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
997 gt_cv_int_divbyzero_sigfpe,
999 gt_cv_int_divbyzero_sigfpe=
1002 macos* | darwin[6-9]* | darwin[1-9][0-9]*)
1003 # On Mac OS X 10.2 or newer, just assume the same as when cross-
1004 # compiling. If we were to perform the real test, 1 Crash Report
1005 # dialog window would pop up.
1007 i[34567]86 | x86_64)
1008 gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
1013 if test -z "$gt_cv_int_divbyzero_sigfpe"; then
1020 sigfpe_handler (int sig)
1022 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
1023 exit (sig != SIGFPE);
1033 signal (SIGFPE, sigfpe_handler);
1034 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
1035 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
1036 signal (SIGTRAP, sigfpe_handler);
1038 /* Linux/SPARC yields signal SIGILL. */
1039 #if defined (__sparc__) && defined (__linux__)
1040 signal (SIGILL, sigfpe_handler);
1048 [gt_cv_int_divbyzero_sigfpe=yes],
1049 [gt_cv_int_divbyzero_sigfpe=no],
1051 # Guess based on the CPU.
1054 alpha* | i[34567]86 | x86_64 | m68k | s390*)
1055 gt_cv_int_divbyzero_sigfpe="guessing yes";;
1057 gt_cv_int_divbyzero_sigfpe="guessing no";;
1063 case "$gt_cv_int_divbyzero_sigfpe" in
1067 AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
1068 [Define if integer division by zero raises signal SIGFPE.])
1071 # intl.m4 serial 25 (gettext-0.18.3)
1072 dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
1073 dnl This file is free software; the Free Software Foundation
1074 dnl gives unlimited permission to copy and/or distribute it,
1075 dnl with or without modifications, as long as this notice is preserved.
1077 dnl This file can can be used in projects which are not available under
1078 dnl the GNU General Public License or the GNU Library General Public
1079 dnl License but which still want to provide support for the GNU gettext
1081 dnl Please note that the actual code of the GNU gettext library is covered
1082 dnl by the GNU Library General Public License, and the rest of the GNU
1083 dnl gettext package package is covered by the GNU General Public License.
1084 dnl They are *not* in the public domain.
1087 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1088 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
1092 dnl Checks for all prerequisites of the intl subdirectory,
1093 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1094 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1095 AC_DEFUN([AM_INTL_SUBDIR],
1097 AC_REQUIRE([AC_PROG_INSTALL])dnl
1098 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1099 AC_REQUIRE([AC_PROG_CC])dnl
1100 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1101 AC_REQUIRE([gt_GLIBC2])dnl
1102 AC_REQUIRE([AC_PROG_RANLIB])dnl
1103 AC_REQUIRE([gl_VISIBILITY])dnl
1104 AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
1105 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
1106 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
1107 AC_REQUIRE([gt_TYPE_WINT_T])dnl
1108 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1109 AC_REQUIRE([gt_TYPE_INTMAX_T])
1110 AC_REQUIRE([gt_PRINTF_POSIX])
1111 AC_REQUIRE([gl_GLIBC21])dnl
1112 AC_REQUIRE([gl_XSIZE])dnl
1113 AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
1114 AC_REQUIRE([gt_INTL_MACOSX])dnl
1115 AC_REQUIRE([gl_EXTERN_INLINE])dnl
1117 dnl Support for automake's --enable-silent-rules.
1118 case "$enable_silent_rules" in
1119 yes) INTL_DEFAULT_VERBOSITY=0;;
1120 no) INTL_DEFAULT_VERBOSITY=1;;
1121 *) INTL_DEFAULT_VERBOSITY=1;;
1123 AC_SUBST([INTL_DEFAULT_VERBOSITY])
1125 AC_CHECK_TYPE([ptrdiff_t], ,
1126 [AC_DEFINE([ptrdiff_t], [long],
1127 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
1129 AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
1130 AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
1131 snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
1133 dnl Use the _snprintf function only if it is declared (because on NetBSD it
1134 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
1135 AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
1137 dnl Use the *_unlocked functions only if they are declared.
1138 dnl (because some of them were defined without being declared in Solaris
1139 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1140 dnl on Solaris 2.5.1 to run on Solaris 2.6).
1141 AC_CHECK_DECLS([getc_unlocked], , , [#include <stdio.h>])
1143 case $gt_cv_func_printf_posix in
1144 *yes) HAVE_POSIX_PRINTF=1 ;;
1145 *) HAVE_POSIX_PRINTF=0 ;;
1147 AC_SUBST([HAVE_POSIX_PRINTF])
1148 if test "$ac_cv_func_asprintf" = yes; then
1153 AC_SUBST([HAVE_ASPRINTF])
1154 if test "$ac_cv_func_snprintf" = yes; then
1159 AC_SUBST([HAVE_SNPRINTF])
1160 if test "$ac_cv_func_newlocale" = yes; then
1165 AC_SUBST([HAVE_NEWLOCALE])
1166 if test "$ac_cv_func_wprintf" = yes; then
1171 AC_SUBST([HAVE_WPRINTF])
1176 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
1177 dnl 1. when we install a shared library, we must arrange to export
1178 dnl auxiliary pointer variables for every exported variable,
1179 dnl 2. when we install a shared library and a static library simultaneously,
1180 dnl the include file specifies __declspec(dllimport) and therefore we
1181 dnl must arrange to define the auxiliary pointer variables for the
1182 dnl exported variables _also_ in the static library.
1183 if test "$enable_shared" = yes; then
1185 mingw* | cygwin*) is_woe32dll=yes ;;
1186 *) is_woe32dll=no ;;
1191 WOE32DLL=$is_woe32dll
1192 AC_SUBST([WOE32DLL])
1194 dnl On mingw and Cygwin, we can activate special Makefile rules which add
1195 dnl version information to the shared libraries and executables.
1197 mingw* | cygwin*) is_woe32=yes ;;
1202 if test $WOE32 = yes; then
1203 dnl Check for a program that compiles Windows resource files.
1204 AC_CHECK_TOOL([WINDRES], [windres])
1207 dnl Determine whether when creating a library, "-lc" should be passed to
1208 dnl libtool or not. On many platforms, it is required for the libtool option
1209 dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
1210 dnl in the *.la files - makes it impossible to create multithreaded programs,
1211 dnl because libtool also reorders the -lc to come before the -pthread, and
1212 dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
1219 dnl Rename some macros and functions used for locking.
1221 #define __libc_lock_t gl_lock_t
1222 #define __libc_lock_define gl_lock_define
1223 #define __libc_lock_define_initialized gl_lock_define_initialized
1224 #define __libc_lock_init gl_lock_init
1225 #define __libc_lock_lock gl_lock_lock
1226 #define __libc_lock_unlock gl_lock_unlock
1227 #define __libc_lock_recursive_t gl_recursive_lock_t
1228 #define __libc_lock_define_recursive gl_recursive_lock_define
1229 #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
1230 #define __libc_lock_init_recursive gl_recursive_lock_init
1231 #define __libc_lock_lock_recursive gl_recursive_lock_lock
1232 #define __libc_lock_unlock_recursive gl_recursive_lock_unlock
1233 #define glthread_in_use libintl_thread_in_use
1234 #define glthread_lock_init_func libintl_lock_init_func
1235 #define glthread_lock_lock_func libintl_lock_lock_func
1236 #define glthread_lock_unlock_func libintl_lock_unlock_func
1237 #define glthread_lock_destroy_func libintl_lock_destroy_func
1238 #define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
1239 #define glthread_rwlock_init_func libintl_rwlock_init_func
1240 #define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
1241 #define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
1242 #define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
1243 #define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
1244 #define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
1245 #define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
1246 #define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
1247 #define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
1248 #define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
1249 #define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
1250 #define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
1251 #define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
1252 #define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
1253 #define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
1254 #define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
1255 #define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
1256 #define glthread_once_func libintl_once_func
1257 #define glthread_once_singlethreaded libintl_once_singlethreaded
1258 #define glthread_once_multithreaded libintl_once_multithreaded
1263 dnl Checks for the core files of the intl subdirectory:
1270 dnl hash-string.h hash-string.c
1272 dnl libgnuintl.h.in (except the *printf stuff)
1277 dnl plural-exp.h plural-exp.c
1279 dnl Used by libglocale.
1280 AC_DEFUN([gt_INTL_SUBDIR_CORE],
1282 AC_REQUIRE([AC_C_INLINE])dnl
1283 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1284 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1285 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1286 AC_REQUIRE([AC_FUNC_MMAP])dnl
1287 AC_REQUIRE([gt_INTDIV0])dnl
1288 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
1289 AC_REQUIRE([gt_INTTYPES_PRI])dnl
1290 AC_REQUIRE([gl_LOCK])dnl
1294 [[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }]],
1296 [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
1297 [Define to 1 if the compiler understands __builtin_expect.])])
1299 AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
1300 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
1301 stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
1302 argz_stringify argz_next __fsetlocking])
1304 dnl Use the *_unlocked functions only if they are declared.
1305 dnl (because some of them were defined without being declared in Solaris
1306 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1307 dnl on Solaris 2.5.1 to run on Solaris 2.6).
1308 AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
1312 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1313 dnl because plural.y uses bison specific features. It requires at least
1314 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1316 dnl bison is only needed for the maintainer (who touches plural.y). But in
1317 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1318 dnl the rule in general Makefile. Now, some people carelessly touch the
1319 dnl files or have a broken "make" program, hence the plural.c rule will
1320 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1321 dnl present or too old.
1322 AC_CHECK_PROGS([INTLBISON], [bison])
1323 if test -z "$INTLBISON"; then
1326 dnl Found it, now check the version.
1327 AC_MSG_CHECKING([version of bison])
1328 changequote(<<,>>)dnl
1329 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1330 case $ac_prog_version in
1331 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1332 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1334 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1335 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1337 AC_MSG_RESULT([$ac_prog_version])
1339 if test $ac_verc_fail = yes; then
1344 # intlmacosx.m4 serial 5 (gettext-0.18.2)
1345 dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
1346 dnl This file is free software; the Free Software Foundation
1347 dnl gives unlimited permission to copy and/or distribute it,
1348 dnl with or without modifications, as long as this notice is preserved.
1350 dnl This file can can be used in projects which are not available under
1351 dnl the GNU General Public License or the GNU Library General Public
1352 dnl License but which still want to provide support for the GNU gettext
1354 dnl Please note that the actual code of the GNU gettext library is covered
1355 dnl by the GNU Library General Public License, and the rest of the GNU
1356 dnl gettext package package is covered by the GNU General Public License.
1357 dnl They are *not* in the public domain.
1359 dnl Checks for special options needed on Mac OS X.
1360 dnl Defines INTL_MACOSX_LIBS.
1361 AC_DEFUN([gt_INTL_MACOSX],
1363 dnl Check for API introduced in Mac OS X 10.2.
1364 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1365 [gt_cv_func_CFPreferencesCopyAppValue],
1366 [gt_save_LIBS="$LIBS"
1367 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1370 [[#include <CoreFoundation/CFPreferences.h>]],
1371 [[CFPreferencesCopyAppValue(NULL, NULL)]])],
1372 [gt_cv_func_CFPreferencesCopyAppValue=yes],
1373 [gt_cv_func_CFPreferencesCopyAppValue=no])
1374 LIBS="$gt_save_LIBS"])
1375 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1376 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
1377 [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1379 dnl Check for API introduced in Mac OS X 10.3.
1380 AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
1381 [gt_save_LIBS="$LIBS"
1382 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1385 [[#include <CoreFoundation/CFLocale.h>]],
1386 [[CFLocaleCopyCurrent();]])],
1387 [gt_cv_func_CFLocaleCopyCurrent=yes],
1388 [gt_cv_func_CFLocaleCopyCurrent=no])
1389 LIBS="$gt_save_LIBS"])
1390 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1391 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
1392 [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
1395 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1396 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1398 AC_SUBST([INTL_MACOSX_LIBS])
1401 # intmax.m4 serial 6 (gettext-0.18.2)
1402 dnl Copyright (C) 2002-2005, 2008-2013 Free Software Foundation, Inc.
1403 dnl This file is free software; the Free Software Foundation
1404 dnl gives unlimited permission to copy and/or distribute it,
1405 dnl with or without modifications, as long as this notice is preserved.
1407 dnl From Bruno Haible.
1408 dnl Test whether the system has the 'intmax_t' type, but don't attempt to
1409 dnl find a replacement if it is lacking.
1411 AC_DEFUN([gt_TYPE_INTMAX_T],
1413 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1414 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1415 AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
1421 #if HAVE_STDINT_H_WITH_UINTMAX
1424 #if HAVE_INTTYPES_H_WITH_UINTMAX
1425 #include <inttypes.h>
1430 [gt_cv_c_intmax_t=yes],
1431 [gt_cv_c_intmax_t=no])])
1432 if test $gt_cv_c_intmax_t = yes; then
1433 AC_DEFINE([HAVE_INTMAX_T], [1],
1434 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
1438 # inttypes-pri.m4 serial 7 (gettext-0.18.2)
1439 dnl Copyright (C) 1997-2002, 2006, 2008-2013 Free Software Foundation, Inc.
1440 dnl This file is free software; the Free Software Foundation
1441 dnl gives unlimited permission to copy and/or distribute it,
1442 dnl with or without modifications, as long as this notice is preserved.
1444 dnl From Bruno Haible.
1448 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
1449 # macros to non-string values. This is the case on AIX 4.3.3.
1451 AC_DEFUN([gt_INTTYPES_PRI],
1453 AC_CHECK_HEADERS([inttypes.h])
1454 if test $ac_cv_header_inttypes_h = yes; then
1455 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
1456 [gt_cv_inttypes_pri_broken],
1461 #include <inttypes.h>
1467 [gt_cv_inttypes_pri_broken=no],
1468 [gt_cv_inttypes_pri_broken=yes])
1471 if test "$gt_cv_inttypes_pri_broken" = yes; then
1472 AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
1473 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
1478 AC_SUBST([PRI_MACROS_BROKEN])
1481 # inttypes_h.m4 serial 10
1482 dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
1483 dnl This file is free software; the Free Software Foundation
1484 dnl gives unlimited permission to copy and/or distribute it,
1485 dnl with or without modifications, as long as this notice is preserved.
1487 dnl From Paul Eggert.
1489 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1490 # doesn't clash with <sys/types.h>, and declares uintmax_t.
1492 AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
1494 AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
1498 #include <sys/types.h>
1499 #include <inttypes.h>
1501 [[uintmax_t i = (uintmax_t) -1; return !i;]])],
1502 [gl_cv_header_inttypes_h=yes],
1503 [gl_cv_header_inttypes_h=no])])
1504 if test $gl_cv_header_inttypes_h = yes; then
1505 AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
1506 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1507 and declares uintmax_t. ])
1511 # lcmessage.m4 serial 7 (gettext-0.18.2)
1512 dnl Copyright (C) 1995-2002, 2004-2005, 2008-2013 Free Software Foundation,
1514 dnl This file is free software; the Free Software Foundation
1515 dnl gives unlimited permission to copy and/or distribute it,
1516 dnl with or without modifications, as long as this notice is preserved.
1518 dnl This file can can be used in projects which are not available under
1519 dnl the GNU General Public License or the GNU Library General Public
1520 dnl License but which still want to provide support for the GNU gettext
1522 dnl Please note that the actual code of the GNU gettext library is covered
1523 dnl by the GNU Library General Public License, and the rest of the GNU
1524 dnl gettext package package is covered by the GNU General Public License.
1525 dnl They are *not* in the public domain.
1528 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
1530 # Check whether LC_MESSAGES is available in <locale.h>.
1532 AC_DEFUN([gt_LC_MESSAGES],
1534 AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
1537 [[#include <locale.h>]],
1538 [[return LC_MESSAGES]])],
1539 [gt_cv_val_LC_MESSAGES=yes],
1540 [gt_cv_val_LC_MESSAGES=no])])
1541 if test $gt_cv_val_LC_MESSAGES = yes; then
1542 AC_DEFINE([HAVE_LC_MESSAGES], [1],
1543 [Define if your <locale.h> file defines LC_MESSAGES.])
1547 # lib-ld.m4 serial 6
1548 dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc.
1549 dnl This file is free software; the Free Software Foundation
1550 dnl gives unlimited permission to copy and/or distribute it,
1551 dnl with or without modifications, as long as this notice is preserved.
1553 dnl Subroutines of libtool.m4,
1554 dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
1555 dnl collision with libtool.m4.
1557 dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
1558 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1559 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
1560 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
1561 case `$LD -v 2>&1 </dev/null` in
1562 *GNU* | *'with BFD'*)
1563 acl_cv_prog_gnu_ld=yes
1566 acl_cv_prog_gnu_ld=no
1569 with_gnu_ld=$acl_cv_prog_gnu_ld
1572 dnl From libtool-2.4. Sets the variable LD.
1573 AC_DEFUN([AC_LIB_PROG_LD],
1574 [AC_REQUIRE([AC_PROG_CC])dnl
1575 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1577 AC_ARG_WITH([gnu-ld],
1578 [AS_HELP_STRING([--with-gnu-ld],
1579 [assume the C compiler uses GNU ld [default=no]])],
1580 [test "$withval" = no || with_gnu_ld=yes],
1581 [with_gnu_ld=no])dnl
1583 # Prepare PATH_SEPARATOR.
1584 # The user is always right.
1585 if test "${PATH_SEPARATOR+set}" != set; then
1586 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
1587 # contains only /bin. Note that ksh looks also at the FPATH variable,
1588 # so we have to set that as well for the test.
1590 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
1591 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
1592 || PATH_SEPARATOR=';'
1597 if test "$GCC" = yes; then
1598 # Check if gcc -print-prog-name=ld gives a path.
1599 AC_MSG_CHECKING([for ld used by $CC])
1602 # gcc leaves a trailing carriage return which upsets mingw
1603 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1605 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1608 # Accept absolute paths.
1609 [[\\/]]* | ?:[[\\/]]*)
1610 re_direlt='/[[^/]][[^/]]*/\.\./'
1611 # Canonicalize the pathname of ld
1612 ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
1613 while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
1614 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1616 test -z "$LD" && LD="$ac_prog"
1619 # If it fails, then pretend we aren't using GCC.
1623 # If it is relative, then search for the first ld in PATH.
1627 elif test "$with_gnu_ld" = yes; then
1628 AC_MSG_CHECKING([for GNU ld])
1630 AC_MSG_CHECKING([for non-GNU ld])
1632 AC_CACHE_VAL([acl_cv_path_LD],
1633 [if test -z "$LD"; then
1634 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1635 for ac_dir in $PATH; do
1637 test -z "$ac_dir" && ac_dir=.
1638 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1639 acl_cv_path_LD="$ac_dir/$ac_prog"
1640 # Check to see if the program is GNU ld. I'd rather use --version,
1641 # but apparently some variants of GNU ld only accept -v.
1642 # Break only if it was the GNU/non-GNU ld that we prefer.
1643 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
1644 *GNU* | *'with BFD'*)
1645 test "$with_gnu_ld" != no && break
1648 test "$with_gnu_ld" != yes && break
1655 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1657 LD="$acl_cv_path_LD"
1658 if test -n "$LD"; then
1659 AC_MSG_RESULT([$LD])
1663 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1667 # lib-link.m4 serial 26 (gettext-0.18.2)
1668 dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
1669 dnl This file is free software; the Free Software Foundation
1670 dnl gives unlimited permission to copy and/or distribute it,
1671 dnl with or without modifications, as long as this notice is preserved.
1673 dnl From Bruno Haible.
1677 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1678 dnl the libraries corresponding to explicit and implicit dependencies.
1679 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1680 dnl augments the CPPFLAGS variable.
1681 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1682 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1683 AC_DEFUN([AC_LIB_LINKFLAGS],
1685 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1686 AC_REQUIRE([AC_LIB_RPATH])
1687 pushdef([Name],[m4_translit([$1],[./+-], [____])])
1688 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1689 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1690 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1691 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1692 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1693 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1694 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1695 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
1697 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1698 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1699 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1700 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
1701 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1703 AC_SUBST([LTLIB]NAME)
1704 AC_SUBST([LIB]NAME[_PREFIX])
1705 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1706 dnl results of this search when this library appears as a dependency.
1712 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
1713 dnl searches for libname and the libraries corresponding to explicit and
1714 dnl implicit dependencies, together with the specified include files and
1715 dnl the ability to compile and link the specified testcode. The missing-message
1716 dnl defaults to 'no' and may contain additional hints for the user.
1717 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
1718 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1719 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1720 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1721 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1722 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1723 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1725 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1726 AC_REQUIRE([AC_LIB_RPATH])
1727 pushdef([Name],[m4_translit([$1],[./+-], [____])])
1728 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1729 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1731 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1733 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1735 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1736 dnl because if the user has installed lib[]Name and not disabled its use
1737 dnl via --without-lib[]Name-prefix, he wants to use it.
1738 ac_save_CPPFLAGS="$CPPFLAGS"
1739 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1741 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1742 ac_save_LIBS="$LIBS"
1743 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
1744 dnl because these -l options might require -L options that are present in
1745 dnl LIBS. -l options benefit only from the -L options listed before it.
1746 dnl Otherwise, add it to the front of LIBS, because it may be a static
1747 dnl library that depends on another static library that is present in LIBS.
1748 dnl Static libraries benefit only from the static libraries listed after
1750 case " $LIB[]NAME" in
1751 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
1752 *) LIBS="$LIB[]NAME $LIBS" ;;
1755 [AC_LANG_PROGRAM([[$3]], [[$4]])],
1756 [ac_cv_lib[]Name=yes],
1757 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
1758 LIBS="$ac_save_LIBS"
1760 if test "$ac_cv_lib[]Name" = yes; then
1762 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
1763 AC_MSG_CHECKING([how to link with lib[]$1])
1764 AC_MSG_RESULT([$LIB[]NAME])
1767 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1768 dnl $INC[]NAME either.
1769 CPPFLAGS="$ac_save_CPPFLAGS"
1774 AC_SUBST([HAVE_LIB]NAME)
1776 AC_SUBST([LTLIB]NAME)
1777 AC_SUBST([LIB]NAME[_PREFIX])
1782 dnl Determine the platform dependent parameters needed to use rpath:
1785 dnl acl_libname_spec,
1786 dnl acl_library_names_spec,
1787 dnl acl_hardcode_libdir_flag_spec,
1788 dnl acl_hardcode_libdir_separator,
1789 dnl acl_hardcode_direct,
1790 dnl acl_hardcode_minus_L.
1791 AC_DEFUN([AC_LIB_RPATH],
1793 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
1794 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
1795 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1796 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1797 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1798 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1799 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
1800 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1801 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1807 acl_libext="$acl_cv_libext"
1808 acl_shlibext="$acl_cv_shlibext"
1809 acl_libname_spec="$acl_cv_libname_spec"
1810 acl_library_names_spec="$acl_cv_library_names_spec"
1811 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1812 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1813 acl_hardcode_direct="$acl_cv_hardcode_direct"
1814 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
1815 dnl Determine whether the user wants rpath handling at all.
1816 AC_ARG_ENABLE([rpath],
1817 [ --disable-rpath do not hardcode runtime library paths],
1818 :, enable_rpath=yes)
1821 dnl AC_LIB_FROMPACKAGE(name, package)
1822 dnl declares that libname comes from the given package. The configure file
1823 dnl will then not have a --with-libname-prefix option but a
1824 dnl --with-package-prefix option. Several libraries can come from the same
1825 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
1826 dnl macro call that searches for libname.
1827 AC_DEFUN([AC_LIB_FROMPACKAGE],
1829 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1830 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1831 define([acl_frompackage_]NAME, [$2])
1833 pushdef([PACK],[$2])
1834 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
1835 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1836 define([acl_libsinpackage_]PACKUP,
1837 m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
1842 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1843 dnl the libraries corresponding to explicit and implicit dependencies.
1844 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1845 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
1846 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1847 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1849 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1850 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
1851 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1852 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
1853 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
1854 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
1855 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
1856 dnl Autoconf >= 2.61 supports dots in --with options.
1857 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
1858 dnl By default, look in $includedir and $libdir.
1860 AC_LIB_WITH_FINAL_PREFIX([
1861 eval additional_includedir=\"$includedir\"
1862 eval additional_libdir=\"$libdir\"
1864 AC_ARG_WITH(P_A_C_K[-prefix],
1865 [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
1866 --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
1868 if test "X$withval" = "Xno"; then
1871 if test "X$withval" = "X"; then
1872 AC_LIB_WITH_FINAL_PREFIX([
1873 eval additional_includedir=\"$includedir\"
1874 eval additional_libdir=\"$libdir\"
1877 additional_includedir="$withval/include"
1878 additional_libdir="$withval/$acl_libdirstem"
1879 if test "$acl_libdirstem2" != "$acl_libdirstem" \
1880 && ! test -d "$withval/$acl_libdirstem"; then
1881 additional_libdir="$withval/$acl_libdirstem2"
1886 dnl Search the library and its dependencies in $additional_libdir and
1887 dnl $LDFLAGS. Using breadth-first-search.
1892 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
1893 dnl computed. So it has to be reset here.
1897 names_already_handled=
1898 names_next_round='$1 $2'
1899 while test -n "$names_next_round"; do
1900 names_this_round="$names_next_round"
1902 for name in $names_this_round; do
1904 for n in $names_already_handled; do
1905 if test "$n" = "$name"; then
1910 if test -z "$already_handled"; then
1911 names_already_handled="$names_already_handled $name"
1912 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1913 dnl or AC_LIB_HAVE_LINKFLAGS call.
1914 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
1915 eval value=\"\$HAVE_LIB$uppername\"
1916 if test -n "$value"; then
1917 if test "$value" = yes; then
1918 eval value=\"\$LIB$uppername\"
1919 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1920 eval value=\"\$LTLIB$uppername\"
1921 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1923 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1924 dnl that this library doesn't exist. So just drop it.
1928 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1929 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1934 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
1935 if test -n "$acl_shlibext"; then
1936 shrext=".$acl_shlibext" # typically: shrext=.so
1940 if test $use_additional = yes; then
1941 dir="$additional_libdir"
1942 dnl The same code as in the loop below:
1943 dnl First look for a shared library.
1944 if test -n "$acl_shlibext"; then
1945 if test -f "$dir/$libname$shrext"; then
1947 found_so="$dir/$libname$shrext"
1949 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1950 ver=`(cd "$dir" && \
1951 for f in "$libname$shrext".*; do echo "$f"; done \
1952 | sed -e "s,^$libname$shrext\\\\.,," \
1953 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1954 | sed 1q ) 2>/dev/null`
1955 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1957 found_so="$dir/$libname$shrext.$ver"
1960 eval library_names=\"$acl_library_names_spec\"
1961 for f in $library_names; do
1962 if test -f "$dir/$f"; then
1971 dnl Then look for a static library.
1972 if test "X$found_dir" = "X"; then
1973 if test -f "$dir/$libname.$acl_libext"; then
1975 found_a="$dir/$libname.$acl_libext"
1978 if test "X$found_dir" != "X"; then
1979 if test -f "$dir/$libname.la"; then
1980 found_la="$dir/$libname.la"
1984 if test "X$found_dir" = "X"; then
1985 for x in $LDFLAGS $LTLIB[]NAME; do
1986 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1989 dir=`echo "X$x" | sed -e 's/^X-L//'`
1990 dnl First look for a shared library.
1991 if test -n "$acl_shlibext"; then
1992 if test -f "$dir/$libname$shrext"; then
1994 found_so="$dir/$libname$shrext"
1996 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1997 ver=`(cd "$dir" && \
1998 for f in "$libname$shrext".*; do echo "$f"; done \
1999 | sed -e "s,^$libname$shrext\\\\.,," \
2000 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
2001 | sed 1q ) 2>/dev/null`
2002 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
2004 found_so="$dir/$libname$shrext.$ver"
2007 eval library_names=\"$acl_library_names_spec\"
2008 for f in $library_names; do
2009 if test -f "$dir/$f"; then
2018 dnl Then look for a static library.
2019 if test "X$found_dir" = "X"; then
2020 if test -f "$dir/$libname.$acl_libext"; then
2022 found_a="$dir/$libname.$acl_libext"
2025 if test "X$found_dir" != "X"; then
2026 if test -f "$dir/$libname.la"; then
2027 found_la="$dir/$libname.la"
2032 if test "X$found_dir" != "X"; then
2037 if test "X$found_dir" != "X"; then
2038 dnl Found the library.
2039 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2040 if test "X$found_so" != "X"; then
2041 dnl Linking with a shared library. We attempt to hardcode its
2042 dnl directory into the executable's runpath, unless it's the
2043 dnl standard /usr/lib.
2044 if test "$enable_rpath" = no \
2045 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
2046 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
2047 dnl No hardcoding is needed.
2048 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2050 dnl Use an explicit option to hardcode DIR into the resulting
2052 dnl Potentially add DIR to ltrpathdirs.
2053 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2055 for x in $ltrpathdirs; do
2056 if test "X$x" = "X$found_dir"; then
2061 if test -z "$haveit"; then
2062 ltrpathdirs="$ltrpathdirs $found_dir"
2064 dnl The hardcoding into $LIBNAME is system dependent.
2065 if test "$acl_hardcode_direct" = yes; then
2066 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2067 dnl resulting binary.
2068 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2070 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
2071 dnl Use an explicit option to hardcode DIR into the resulting
2073 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2074 dnl Potentially add DIR to rpathdirs.
2075 dnl The rpathdirs will be appended to $LIBNAME at the end.
2077 for x in $rpathdirs; do
2078 if test "X$x" = "X$found_dir"; then
2083 if test -z "$haveit"; then
2084 rpathdirs="$rpathdirs $found_dir"
2087 dnl Rely on "-L$found_dir".
2088 dnl But don't add it if it's already contained in the LDFLAGS
2089 dnl or the already constructed $LIBNAME
2091 for x in $LDFLAGS $LIB[]NAME; do
2092 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2093 if test "X$x" = "X-L$found_dir"; then
2098 if test -z "$haveit"; then
2099 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2101 if test "$acl_hardcode_minus_L" != no; then
2102 dnl FIXME: Not sure whether we should use
2103 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2105 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2107 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
2108 dnl here, because this doesn't fit in flags passed to the
2109 dnl compiler. So give up. No hardcoding. This affects only
2110 dnl very old systems.
2111 dnl FIXME: Not sure whether we should use
2112 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2114 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2120 if test "X$found_a" != "X"; then
2121 dnl Linking with a static library.
2122 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2124 dnl We shouldn't come here, but anyway it's good to have a
2126 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2129 dnl Assume the include files are nearby.
2130 additional_includedir=
2131 case "$found_dir" in
2132 */$acl_libdirstem | */$acl_libdirstem/)
2133 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
2134 if test "$name" = '$1'; then
2135 LIB[]NAME[]_PREFIX="$basedir"
2137 additional_includedir="$basedir/include"
2139 */$acl_libdirstem2 | */$acl_libdirstem2/)
2140 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
2141 if test "$name" = '$1'; then
2142 LIB[]NAME[]_PREFIX="$basedir"
2144 additional_includedir="$basedir/include"
2147 if test "X$additional_includedir" != "X"; then
2148 dnl Potentially add $additional_includedir to $INCNAME.
2149 dnl But don't add it
2150 dnl 1. if it's the standard /usr/include,
2151 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2152 dnl 3. if it's already present in $CPPFLAGS or the already
2153 dnl constructed $INCNAME,
2154 dnl 4. if it doesn't exist as a directory.
2155 if test "X$additional_includedir" != "X/usr/include"; then
2157 if test "X$additional_includedir" = "X/usr/local/include"; then
2158 if test -n "$GCC"; then
2160 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2164 if test -z "$haveit"; then
2165 for x in $CPPFLAGS $INC[]NAME; do
2166 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2167 if test "X$x" = "X-I$additional_includedir"; then
2172 if test -z "$haveit"; then
2173 if test -d "$additional_includedir"; then
2174 dnl Really add $additional_includedir to $INCNAME.
2175 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2181 dnl Look for dependencies.
2182 if test -n "$found_la"; then
2183 dnl Read the .la file. It defines the variables
2184 dnl dlname, library_names, old_library, dependency_libs, current,
2185 dnl age, revision, installed, dlopen, dlpreopen, libdir.
2186 save_libdir="$libdir"
2188 */* | *\\*) . "$found_la" ;;
2189 *) . "./$found_la" ;;
2191 libdir="$save_libdir"
2192 dnl We use only dependency_libs.
2193 for dep in $dependency_libs; do
2196 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2197 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2198 dnl But don't add it
2199 dnl 1. if it's the standard /usr/lib,
2200 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2201 dnl 3. if it's already present in $LDFLAGS or the already
2202 dnl constructed $LIBNAME,
2203 dnl 4. if it doesn't exist as a directory.
2204 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
2205 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
2207 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
2208 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
2209 if test -n "$GCC"; then
2211 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2215 if test -z "$haveit"; then
2217 for x in $LDFLAGS $LIB[]NAME; do
2218 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2219 if test "X$x" = "X-L$additional_libdir"; then
2224 if test -z "$haveit"; then
2225 if test -d "$additional_libdir"; then
2226 dnl Really add $additional_libdir to $LIBNAME.
2227 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2231 for x in $LDFLAGS $LTLIB[]NAME; do
2232 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2233 if test "X$x" = "X-L$additional_libdir"; then
2238 if test -z "$haveit"; then
2239 if test -d "$additional_libdir"; then
2240 dnl Really add $additional_libdir to $LTLIBNAME.
2241 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2248 dir=`echo "X$dep" | sed -e 's/^X-R//'`
2249 if test "$enable_rpath" != no; then
2250 dnl Potentially add DIR to rpathdirs.
2251 dnl The rpathdirs will be appended to $LIBNAME at the end.
2253 for x in $rpathdirs; do
2254 if test "X$x" = "X$dir"; then
2259 if test -z "$haveit"; then
2260 rpathdirs="$rpathdirs $dir"
2262 dnl Potentially add DIR to ltrpathdirs.
2263 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2265 for x in $ltrpathdirs; do
2266 if test "X$x" = "X$dir"; then
2271 if test -z "$haveit"; then
2272 ltrpathdirs="$ltrpathdirs $dir"
2277 dnl Handle this in the next round.
2278 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2281 dnl Handle this in the next round. Throw away the .la's
2282 dnl directory; it is already contained in a preceding -L
2284 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2287 dnl Most likely an immediate library name.
2288 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2289 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2295 dnl Didn't find the library; assume it is in the system directories
2296 dnl known to the linker and runtime loader. (All the system
2297 dnl directories known to the linker should also be known to the
2298 dnl runtime loader, otherwise the system is severely misconfigured.)
2299 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2300 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2306 if test "X$rpathdirs" != "X"; then
2307 if test -n "$acl_hardcode_libdir_separator"; then
2308 dnl Weird platform: only the last -rpath option counts, the user must
2309 dnl pass all path elements in one option. We can arrange that for a
2310 dnl single library, but not when more than one $LIBNAMEs are used.
2312 for found_dir in $rpathdirs; do
2313 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
2315 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
2316 acl_save_libdir="$libdir"
2318 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2319 libdir="$acl_save_libdir"
2320 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2322 dnl The -rpath options are cumulative.
2323 for found_dir in $rpathdirs; do
2324 acl_save_libdir="$libdir"
2326 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2327 libdir="$acl_save_libdir"
2328 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2332 if test "X$ltrpathdirs" != "X"; then
2333 dnl When using libtool, the option that works for both libraries and
2334 dnl executables is -R. The -R options are cumulative.
2335 for found_dir in $ltrpathdirs; do
2336 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2346 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2347 dnl unless already present in VAR.
2348 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2349 dnl contains two or three consecutive elements that belong together.
2350 AC_DEFUN([AC_LIB_APPENDTOVAR],
2352 for element in [$2]; do
2355 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2356 if test "X$x" = "X$element"; then
2361 if test -z "$haveit"; then
2362 [$1]="${[$1]}${[$1]:+ }$element"
2367 dnl For those cases where a variable contains several -L and -l options
2368 dnl referring to unknown libraries and directories, this macro determines the
2369 dnl necessary additional linker options for the runtime path.
2370 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
2371 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
2372 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
2373 dnl otherwise linking without libtool is assumed.
2374 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
2376 AC_REQUIRE([AC_LIB_RPATH])
2377 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2379 if test "$enable_rpath" != no; then
2380 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
2381 dnl Use an explicit option to hardcode directories into the resulting
2386 if test -n "$next"; then
2388 dnl No need to hardcode the standard /usr/lib.
2389 if test "X$dir" != "X/usr/$acl_libdirstem" \
2390 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
2391 rpathdirs="$rpathdirs $dir"
2397 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
2398 dnl No need to hardcode the standard /usr/lib.
2399 if test "X$dir" != "X/usr/$acl_libdirstem" \
2400 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
2401 rpathdirs="$rpathdirs $dir"
2408 if test "X$rpathdirs" != "X"; then
2409 if test -n ""$3""; then
2410 dnl libtool is used for linking. Use -R options.
2411 for dir in $rpathdirs; do
2412 $1="${$1}${$1:+ }-R$dir"
2415 dnl The linker is used for linking directly.
2416 if test -n "$acl_hardcode_libdir_separator"; then
2417 dnl Weird platform: only the last -rpath option counts, the user
2418 dnl must pass all path elements in one option.
2420 for dir in $rpathdirs; do
2421 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
2423 acl_save_libdir="$libdir"
2425 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2426 libdir="$acl_save_libdir"
2429 dnl The -rpath options are cumulative.
2430 for dir in $rpathdirs; do
2431 acl_save_libdir="$libdir"
2433 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2434 libdir="$acl_save_libdir"
2435 $1="${$1}${$1:+ }$flag"
2445 # lib-prefix.m4 serial 7 (gettext-0.18)
2446 dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc.
2447 dnl This file is free software; the Free Software Foundation
2448 dnl gives unlimited permission to copy and/or distribute it,
2449 dnl with or without modifications, as long as this notice is preserved.
2451 dnl From Bruno Haible.
2453 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
2454 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
2455 dnl require excessive bracketing.
2456 ifdef([AC_HELP_STRING],
2457 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
2458 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
2460 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2461 dnl to access previously installed libraries. The basic assumption is that
2462 dnl a user will want packages to use other packages he previously installed
2463 dnl with the same --prefix option.
2464 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2465 dnl libraries, but is otherwise very convenient.
2466 AC_DEFUN([AC_LIB_PREFIX],
2468 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2469 AC_REQUIRE([AC_PROG_CC])
2470 AC_REQUIRE([AC_CANONICAL_HOST])
2471 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2472 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2473 dnl By default, look in $includedir and $libdir.
2475 AC_LIB_WITH_FINAL_PREFIX([
2476 eval additional_includedir=\"$includedir\"
2477 eval additional_libdir=\"$libdir\"
2479 AC_LIB_ARG_WITH([lib-prefix],
2480 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2481 --without-lib-prefix don't search for libraries in includedir and libdir],
2483 if test "X$withval" = "Xno"; then
2486 if test "X$withval" = "X"; then
2487 AC_LIB_WITH_FINAL_PREFIX([
2488 eval additional_includedir=\"$includedir\"
2489 eval additional_libdir=\"$libdir\"
2492 additional_includedir="$withval/include"
2493 additional_libdir="$withval/$acl_libdirstem"
2497 if test $use_additional = yes; then
2498 dnl Potentially add $additional_includedir to $CPPFLAGS.
2499 dnl But don't add it
2500 dnl 1. if it's the standard /usr/include,
2501 dnl 2. if it's already present in $CPPFLAGS,
2502 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
2503 dnl 4. if it doesn't exist as a directory.
2504 if test "X$additional_includedir" != "X/usr/include"; then
2506 for x in $CPPFLAGS; do
2507 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2508 if test "X$x" = "X-I$additional_includedir"; then
2513 if test -z "$haveit"; then
2514 if test "X$additional_includedir" = "X/usr/local/include"; then
2515 if test -n "$GCC"; then
2517 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2521 if test -z "$haveit"; then
2522 if test -d "$additional_includedir"; then
2523 dnl Really add $additional_includedir to $CPPFLAGS.
2524 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2529 dnl Potentially add $additional_libdir to $LDFLAGS.
2530 dnl But don't add it
2531 dnl 1. if it's the standard /usr/lib,
2532 dnl 2. if it's already present in $LDFLAGS,
2533 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
2534 dnl 4. if it doesn't exist as a directory.
2535 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2537 for x in $LDFLAGS; do
2538 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2539 if test "X$x" = "X-L$additional_libdir"; then
2544 if test -z "$haveit"; then
2545 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2546 if test -n "$GCC"; then
2548 linux*) haveit=yes;;
2552 if test -z "$haveit"; then
2553 if test -d "$additional_libdir"; then
2554 dnl Really add $additional_libdir to $LDFLAGS.
2555 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2563 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2564 dnl acl_final_exec_prefix, containing the values to which $prefix and
2565 dnl $exec_prefix will expand at the end of the configure script.
2566 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2568 dnl Unfortunately, prefix and exec_prefix get only finally determined
2569 dnl at the end of configure.
2570 if test "X$prefix" = "XNONE"; then
2571 acl_final_prefix="$ac_default_prefix"
2573 acl_final_prefix="$prefix"
2575 if test "X$exec_prefix" = "XNONE"; then
2576 acl_final_exec_prefix='${prefix}'
2578 acl_final_exec_prefix="$exec_prefix"
2580 acl_save_prefix="$prefix"
2581 prefix="$acl_final_prefix"
2582 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2583 prefix="$acl_save_prefix"
2586 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2587 dnl variables prefix and exec_prefix bound to the values they will have
2588 dnl at the end of the configure script.
2589 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2591 acl_save_prefix="$prefix"
2592 prefix="$acl_final_prefix"
2593 acl_save_exec_prefix="$exec_prefix"
2594 exec_prefix="$acl_final_exec_prefix"
2596 exec_prefix="$acl_save_exec_prefix"
2597 prefix="$acl_save_prefix"
2600 dnl AC_LIB_PREPARE_MULTILIB creates
2601 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
2602 dnl "lib" or "lib64" or "lib/64",
2603 dnl - a variable acl_libdirstem2, as a secondary possible value for
2604 dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
2606 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
2608 dnl There is no formal standard regarding lib and lib64.
2609 dnl On glibc systems, the current practice is that on a system supporting
2610 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2611 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
2612 dnl the compiler's default mode by looking at the compiler's library search
2613 dnl path. If at least one of its elements ends in /lib64 or points to a
2614 dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
2615 dnl Otherwise we use the default, namely "lib".
2616 dnl On Solaris systems, the current practice is that on a system supporting
2617 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
2618 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
2619 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
2620 AC_REQUIRE([AC_CANONICAL_HOST])
2625 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
2626 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
2627 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
2628 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
2629 dnl symlink is missing, so we set acl_libdirstem2 too.
2630 AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
2631 [AC_EGREP_CPP([sixtyfour bits], [
2635 ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
2637 if test $gl_cv_solaris_64bit = yes; then
2638 acl_libdirstem=lib/64
2640 sparc*) acl_libdirstem2=lib/sparcv9 ;;
2641 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
2646 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
2647 if test -n "$searchpath"; then
2648 acl_save_IFS="${IFS= }"; IFS=":"
2649 for searchdir in $searchpath; do
2650 if test -d "$searchdir"; then
2651 case "$searchdir" in
2652 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
2654 # Better ignore directories of this form. They are misleading.
2656 *) searchdir=`cd "$searchdir" && pwd`
2657 case "$searchdir" in
2658 */lib64 ) acl_libdirstem=lib64 ;;
2667 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
2670 # lock.m4 serial 13 (gettext-0.18.2)
2671 dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
2672 dnl This file is free software; the Free Software Foundation
2673 dnl gives unlimited permission to copy and/or distribute it,
2674 dnl with or without modifications, as long as this notice is preserved.
2676 dnl From Bruno Haible.
2680 AC_REQUIRE([gl_THREADLIB])
2681 if test "$gl_threads_api" = posix; then
2682 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
2683 # pthread_rwlock_* functions.
2684 AC_CHECK_TYPE([pthread_rwlock_t],
2685 [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
2686 [Define if the POSIX multithreading library has read/write locks.])],
2688 [#include <pthread.h>])
2689 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
2692 [[#include <pthread.h>]],
2694 #if __FreeBSD__ == 4
2695 error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
2696 #elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
2697 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
2698 error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
2700 int x = (int)PTHREAD_MUTEX_RECURSIVE;
2704 [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
2705 [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
2710 # Prerequisites of lib/glthread/lock.c.
2711 AC_DEFUN([gl_PREREQ_LOCK], [:])
2713 # longlong.m4 serial 17
2714 dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc.
2715 dnl This file is free software; the Free Software Foundation
2716 dnl gives unlimited permission to copy and/or distribute it,
2717 dnl with or without modifications, as long as this notice is preserved.
2719 dnl From Paul Eggert.
2721 # Define HAVE_LONG_LONG_INT if 'long long int' works.
2722 # This fixes a bug in Autoconf 2.61, and can be faster
2723 # than what's in Autoconf 2.62 through 2.68.
2725 # Note: If the type 'long long int' exists but is only 32 bits large
2726 # (as on some very old compilers), HAVE_LONG_LONG_INT will not be
2727 # defined. In this case you can treat 'long long int' like 'long int'.
2729 AC_DEFUN([AC_TYPE_LONG_LONG_INT],
2731 AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
2732 AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
2733 [ac_cv_type_long_long_int=yes
2734 if test "x${ac_cv_prog_cc_c99-no}" = xno; then
2735 ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
2736 if test $ac_cv_type_long_long_int = yes; then
2737 dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
2738 dnl If cross compiling, assume the bug is not important, since
2739 dnl nobody cross compiles for this platform as far as we know.
2742 [[@%:@include <limits.h>
2743 @%:@ifndef LLONG_MAX
2745 (1LL << (sizeof (long long int) * CHAR_BIT - 2))
2746 @%:@ define LLONG_MAX (HALF - 1 + HALF)
2748 [[long long int n = 1;
2752 long long int m = n << i;
2755 if (LLONG_MAX / 2 < m)
2760 [ac_cv_type_long_long_int=no],
2764 if test $ac_cv_type_long_long_int = yes; then
2765 AC_DEFINE([HAVE_LONG_LONG_INT], [1],
2766 [Define to 1 if the system has the type 'long long int'.])
2770 # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
2771 # This fixes a bug in Autoconf 2.61, and can be faster
2772 # than what's in Autoconf 2.62 through 2.68.
2774 # Note: If the type 'unsigned long long int' exists but is only 32 bits
2775 # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
2776 # will not be defined. In this case you can treat 'unsigned long long int'
2777 # like 'unsigned long int'.
2779 AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
2781 AC_CACHE_CHECK([for unsigned long long int],
2782 [ac_cv_type_unsigned_long_long_int],
2783 [ac_cv_type_unsigned_long_long_int=yes
2784 if test "x${ac_cv_prog_cc_c99-no}" = xno; then
2786 [_AC_TYPE_LONG_LONG_SNIPPET],
2788 [ac_cv_type_unsigned_long_long_int=no])
2790 if test $ac_cv_type_unsigned_long_long_int = yes; then
2791 AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
2792 [Define to 1 if the system has the type 'unsigned long long int'.])
2796 # Expands to a C program that can be used to test for simultaneous support
2797 # of 'long long' and 'unsigned long long'. We don't want to say that
2798 # 'long long' is available if 'unsigned long long' is not, or vice versa,
2799 # because too many programs rely on the symmetry between signed and unsigned
2800 # integer types (excluding 'bool').
2801 AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
2804 [[/* For now, do not test the preprocessor; as of 2007 there are too many
2805 implementations with broken preprocessors. Perhaps this can
2806 be revisited in 2012. In the meantime, code should not expect
2807 #if to work with literals wider than 32 bits. */
2808 /* Test literals. */
2809 long long int ll = 9223372036854775807ll;
2810 long long int nll = -9223372036854775807LL;
2811 unsigned long long int ull = 18446744073709551615ULL;
2812 /* Test constant expressions. */
2813 typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
2815 typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
2818 [[/* Test availability of runtime routines for shift and division. */
2819 long long int llmax = 9223372036854775807ll;
2820 unsigned long long int ullmax = 18446744073709551615ull;
2821 return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
2822 | (llmax / ll) | (llmax % ll)
2823 | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
2824 | (ullmax / ull) | (ullmax % ull));]])
2827 # nls.m4 serial 5 (gettext-0.18)
2828 dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
2830 dnl This file is free software; the Free Software Foundation
2831 dnl gives unlimited permission to copy and/or distribute it,
2832 dnl with or without modifications, as long as this notice is preserved.
2834 dnl This file can can be used in projects which are not available under
2835 dnl the GNU General Public License or the GNU Library General Public
2836 dnl License but which still want to provide support for the GNU gettext
2838 dnl Please note that the actual code of the GNU gettext library is covered
2839 dnl by the GNU Library General Public License, and the rest of the GNU
2840 dnl gettext package package is covered by the GNU General Public License.
2841 dnl They are *not* in the public domain.
2844 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2845 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2851 AC_MSG_CHECKING([whether NLS is requested])
2852 dnl Default is enabled NLS
2853 AC_ARG_ENABLE([nls],
2854 [ --disable-nls do not use Native Language Support],
2855 USE_NLS=$enableval, USE_NLS=yes)
2856 AC_MSG_RESULT([$USE_NLS])
2860 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2861 # serial 1 (pkg-config-0.24)
2863 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2865 # This program is free software; you can redistribute it and/or modify
2866 # it under the terms of the GNU General Public License as published by
2867 # the Free Software Foundation; either version 2 of the License, or
2868 # (at your option) any later version.
2870 # This program is distributed in the hope that it will be useful, but
2871 # WITHOUT ANY WARRANTY; without even the implied warranty of
2872 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2873 # General Public License for more details.
2875 # You should have received a copy of the GNU General Public License
2876 # along with this program; if not, write to the Free Software
2877 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2879 # As a special exception to the GNU General Public License, if you
2880 # distribute this file as part of a program that contains a
2881 # configuration script generated by Autoconf, you may include it under
2882 # the same distribution terms that you use for the rest of that program.
2884 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
2885 # ----------------------------------
2886 AC_DEFUN([PKG_PROG_PKG_CONFIG],
2887 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2888 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
2889 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
2890 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
2891 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
2892 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
2894 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2895 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2897 if test -n "$PKG_CONFIG"; then
2898 _pkg_min_version=m4_default([$1], [0.9.0])
2899 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2900 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2901 AC_MSG_RESULT([yes])
2907 ])# PKG_PROG_PKG_CONFIG
2909 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2911 # Check to see whether a particular set of modules exists. Similar
2912 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
2914 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2915 # only at the first occurrence in configure.ac, so if the first place
2916 # it's called might be skipped (such as if it is within an "if", you
2917 # have to call PKG_CHECK_EXISTS manually
2918 # --------------------------------------------------------------
2919 AC_DEFUN([PKG_CHECK_EXISTS],
2920 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2921 if test -n "$PKG_CONFIG" && \
2922 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2923 m4_default([$2], [:])
2924 m4_ifvaln([$3], [else
2928 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2929 # ---------------------------------------------
2930 m4_define([_PKG_CONFIG],
2931 [if test -n "$$1"; then
2933 elif test -n "$PKG_CONFIG"; then
2934 PKG_CHECK_EXISTS([$3],
2935 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
2936 test "x$?" != "x0" && pkg_failed=yes ],
2943 # _PKG_SHORT_ERRORS_SUPPORTED
2944 # -----------------------------
2945 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2946 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2947 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2948 _pkg_short_errors_supported=yes
2950 _pkg_short_errors_supported=no
2952 ])# _PKG_SHORT_ERRORS_SUPPORTED
2955 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2956 # [ACTION-IF-NOT-FOUND])
2959 # Note that if there is a possibility the first call to
2960 # PKG_CHECK_MODULES might not happen, you should be sure to include an
2961 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2964 # --------------------------------------------------------------
2965 AC_DEFUN([PKG_CHECK_MODULES],
2966 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2967 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2968 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2971 AC_MSG_CHECKING([for $1])
2973 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2974 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
2976 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2977 and $1[]_LIBS to avoid the need to call pkg-config.
2978 See the pkg-config man page for more details.])
2980 if test $pkg_failed = yes; then
2982 _PKG_SHORT_ERRORS_SUPPORTED
2983 if test $_pkg_short_errors_supported = yes; then
2984 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
2986 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
2988 # Put the nasty error message in config.log where it belongs
2989 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2991 m4_default([$4], [AC_MSG_ERROR(
2992 [Package requirements ($2) were not met:
2996 Consider adjusting the PKG_CONFIG_PATH environment variable if you
2997 installed software in a non-standard prefix.
3001 elif test $pkg_failed = untried; then
3003 m4_default([$4], [AC_MSG_FAILURE(
3004 [The pkg-config script could not be found or is too old. Make sure it
3005 is in your PATH or set the PKG_CONFIG environment variable to the full
3010 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
3013 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
3014 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
3015 AC_MSG_RESULT([yes])
3018 ])# PKG_CHECK_MODULES
3021 # PKG_INSTALLDIR(DIRECTORY)
3022 # -------------------------
3023 # Substitutes the variable pkgconfigdir as the location where a module
3024 # should install pkg-config .pc files. By default the directory is
3025 # $libdir/pkgconfig, but the default can be changed by passing
3026 # DIRECTORY. The user can override through the --with-pkgconfigdir
3028 AC_DEFUN([PKG_INSTALLDIR],
3029 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
3030 m4_pushdef([pkg_description],
3031 [pkg-config installation directory @<:@]pkg_default[@:>@])
3032 AC_ARG_WITH([pkgconfigdir],
3033 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
3034 [with_pkgconfigdir=]pkg_default)
3035 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
3036 m4_popdef([pkg_default])
3037 m4_popdef([pkg_description])
3038 ]) dnl PKG_INSTALLDIR
3041 # PKG_NOARCH_INSTALLDIR(DIRECTORY)
3042 # -------------------------
3043 # Substitutes the variable noarch_pkgconfigdir as the location where a
3044 # module should install arch-independent pkg-config .pc files. By
3045 # default the directory is $datadir/pkgconfig, but the default can be
3046 # changed by passing DIRECTORY. The user can override through the
3047 # --with-noarch-pkgconfigdir parameter.
3048 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
3049 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
3050 m4_pushdef([pkg_description],
3051 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
3052 AC_ARG_WITH([noarch-pkgconfigdir],
3053 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
3054 [with_noarch_pkgconfigdir=]pkg_default)
3055 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
3056 m4_popdef([pkg_default])
3057 m4_popdef([pkg_description])
3058 ]) dnl PKG_NOARCH_INSTALLDIR
3061 # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
3062 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3063 # -------------------------------------------
3064 # Retrieves the value of the pkg-config variable for the given module.
3065 AC_DEFUN([PKG_CHECK_VAR],
3066 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
3067 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
3069 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
3070 AS_VAR_COPY([$1], [pkg_cv_][$1])
3072 AS_VAR_IF([$1], [""], [$5], [$4])dnl
3075 # po.m4 serial 21 (gettext-0.18.3)
3076 dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
3077 dnl This file is free software; the Free Software Foundation
3078 dnl gives unlimited permission to copy and/or distribute it,
3079 dnl with or without modifications, as long as this notice is preserved.
3081 dnl This file can can be used in projects which are not available under
3082 dnl the GNU General Public License or the GNU Library General Public
3083 dnl License but which still want to provide support for the GNU gettext
3085 dnl Please note that the actual code of the GNU gettext library is covered
3086 dnl by the GNU Library General Public License, and the rest of the GNU
3087 dnl gettext package package is covered by the GNU General Public License.
3088 dnl They are *not* in the public domain.
3091 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3092 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3096 dnl Checks for all prerequisites of the po subdirectory.
3097 AC_DEFUN([AM_PO_SUBDIRS],
3099 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3100 AC_REQUIRE([AC_PROG_INSTALL])dnl
3101 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3102 AC_REQUIRE([AC_PROG_SED])dnl
3103 AC_REQUIRE([AM_NLS])dnl
3105 dnl Release version of the gettext macros. This is used to ensure that
3106 dnl the gettext macros and po/Makefile.in.in are in sync.
3107 AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
3109 dnl Perform the following tests also if --disable-nls has been given,
3110 dnl because they are needed for "make dist" to work.
3112 dnl Search for GNU msgfmt in the PATH.
3113 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
3114 dnl The second test excludes FreeBSD msgfmt.
3115 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
3116 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3117 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3119 AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
3121 dnl Test whether it is GNU msgfmt >= 0.15.
3123 case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3124 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
3125 *) MSGFMT_015=$MSGFMT ;;
3128 AC_SUBST([MSGFMT_015])
3130 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3131 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
3132 *) GMSGFMT_015=$GMSGFMT ;;
3135 AC_SUBST([GMSGFMT_015])
3137 dnl Search for GNU xgettext 0.12 or newer in the PATH.
3138 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
3139 dnl The second test excludes FreeBSD xgettext.
3140 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
3141 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3142 (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)],
3144 dnl Remove leftover from FreeBSD xgettext call.
3147 dnl Test whether it is GNU xgettext >= 0.15.
3149 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3150 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
3151 *) XGETTEXT_015=$XGETTEXT ;;
3154 AC_SUBST([XGETTEXT_015])
3156 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
3157 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
3158 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
3160 dnl Installation directories.
3161 dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
3162 dnl have to define it here, so that it can be used in po/Makefile.
3163 test -n "$localedir" || localedir='${datadir}/locale'
3164 AC_SUBST([localedir])
3166 dnl Support for AM_XGETTEXT_OPTION.
3167 test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
3168 AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
3170 AC_CONFIG_COMMANDS([po-directories], [[
3171 for ac_file in $CONFIG_FILES; do
3172 # Support "outfile[:infile[:infile...]]"
3174 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3176 # PO directories have a Makefile.in generated from Makefile.in.in.
3177 case "$ac_file" in */Makefile.in)
3178 # Adjust a relative srcdir.
3179 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3180 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
3181 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3182 # In autoconf-2.13 it is called $ac_given_srcdir.
3183 # In autoconf-2.50 it is called $srcdir.
3184 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3185 case "$ac_given_srcdir" in
3186 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3187 /*) top_srcdir="$ac_given_srcdir" ;;
3188 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3190 # Treat a directory as a PO directory if and only if it has a
3191 # POTFILES.in file. This allows packages to have multiple PO
3192 # directories under different names or in different locations.
3193 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
3194 rm -f "$ac_dir/POTFILES"
3195 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
3196 gt_tab=`printf '\t'`
3197 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"
3198 POMAKEFILEDEPS="POTFILES.in"
3199 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
3200 # on $ac_dir but don't depend on user-specified configuration
3202 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3203 # The LINGUAS file contains the set of available languages.
3204 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3205 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3207 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3208 # Hide the ALL_LINGUAS assignment from automake < 1.5.
3209 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3210 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3212 # The set of available languages was given in configure.in.
3213 # Hide the ALL_LINGUAS assignment from automake < 1.5.
3214 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
3217 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3218 # Compute UPDATEPOFILES
3219 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3220 # Compute DUMMYPOFILES
3221 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3223 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3224 case "$ac_given_srcdir" in
3226 *) srcdirpre='$(srcdir)/' ;;
3232 for lang in $ALL_LINGUAS; do
3233 POFILES="$POFILES $srcdirpre$lang.po"
3234 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3235 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3236 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3238 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3239 # environment variable.
3241 if test -n "$ALL_LINGUAS"; then
3242 for presentlang in $ALL_LINGUAS; do
3244 if test "%UNSET%" != "$LINGUAS"; then
3245 desiredlanguages="$LINGUAS"
3247 desiredlanguages="$ALL_LINGUAS"
3249 for desiredlang in $desiredlanguages; do
3250 # Use the presentlang catalog if desiredlang is
3251 # a. equal to presentlang, or
3252 # b. a variant of presentlang (because in this case,
3253 # presentlang can be used as a fallback for messages
3254 # which are not translated in the desiredlang catalog).
3255 case "$desiredlang" in
3256 "$presentlang"*) useit=yes;;
3259 if test $useit = yes; then
3260 INST_LINGUAS="$INST_LINGUAS $presentlang"
3265 if test -n "$INST_LINGUAS"; then
3266 for lang in $INST_LINGUAS; do
3267 CATALOGS="$CATALOGS $lang.gmo"
3270 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
3271 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"
3272 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
3273 if test -f "$f"; then
3275 *.orig | *.bak | *~) ;;
3276 *) cat "$f" >> "$ac_dir/Makefile" ;;
3284 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
3285 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
3286 # from automake < 1.5.
3287 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
3288 # Capture the value of LINGUAS because we need it to compute CATALOGS.
3289 LINGUAS="${LINGUAS-%UNSET%}"
3293 dnl Postprocesses a Makefile in a directory containing PO files.
3294 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
3296 # When this code is run, in config.status, two variables have already been
3298 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
3299 # - LINGUAS is the value of the environment variable LINGUAS at configure
3303 # Adjust a relative srcdir.
3304 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3305 ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
3306 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3307 # In autoconf-2.13 it is called $ac_given_srcdir.
3308 # In autoconf-2.50 it is called $srcdir.
3309 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3310 case "$ac_given_srcdir" in
3311 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3312 /*) top_srcdir="$ac_given_srcdir" ;;
3313 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3316 # Find a way to echo strings without interpreting backslash.
3317 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
3320 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
3321 gt_echo='printf %s\n'
3332 # A sed script that extracts the value of VARIABLE from a Makefile.
3335 # Test if the hold space is empty.
3340 # Yes it was empty. Look if we have the expected variable definition.
3341 /^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
3342 # Seen the first line of the variable definition.
3343 s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
3348 # Here we are processing a line from the variable definition.
3349 # Remove comment, more precisely replace it with a space.
3351 # See if the line ends in a backslash.
3355 # Print the line, without the trailing backslash.
3358 # There was no trailing backslash. The end of the variable definition is
3359 # reached. Clear the hold space.
3364 # A trailing backslash means that the variable definition continues in the
3365 # next line. Put a nonempty string into the hold space to indicate this.
3372 # Set POTFILES to the value of the Makefile variable POTFILES.
3373 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
3374 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
3375 # Compute POTFILES_DEPS as
3376 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
3378 for file in $POTFILES; do
3379 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
3383 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3384 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3386 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3387 # The LINGUAS file contains the set of available languages.
3388 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3389 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3391 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
3392 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
3393 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
3395 # Hide the ALL_LINGUAS assignment from automake < 1.5.
3396 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3398 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3399 # Compute UPDATEPOFILES
3400 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3401 # Compute DUMMYPOFILES
3402 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3404 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3405 # Compute PROPERTIESFILES
3406 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
3407 # Compute CLASSFILES
3408 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
3410 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
3412 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
3413 # Compute RESOURCESDLLFILES
3414 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
3415 case "$ac_given_srcdir" in
3417 *) srcdirpre='$(srcdir)/' ;;
3428 for lang in $ALL_LINGUAS; do
3429 POFILES="$POFILES $srcdirpre$lang.po"
3430 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3431 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3432 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3433 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
3434 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
3435 QMFILES="$QMFILES $srcdirpre$lang.qm"
3436 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3437 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
3438 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/'`
3439 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
3441 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3442 # environment variable.
3444 if test -n "$ALL_LINGUAS"; then
3445 for presentlang in $ALL_LINGUAS; do
3447 if test "%UNSET%" != "$LINGUAS"; then
3448 desiredlanguages="$LINGUAS"
3450 desiredlanguages="$ALL_LINGUAS"
3452 for desiredlang in $desiredlanguages; do
3453 # Use the presentlang catalog if desiredlang is
3454 # a. equal to presentlang, or
3455 # b. a variant of presentlang (because in this case,
3456 # presentlang can be used as a fallback for messages
3457 # which are not translated in the desiredlang catalog).
3458 case "$desiredlang" in
3459 "$presentlang"*) useit=yes;;
3462 if test $useit = yes; then
3463 INST_LINGUAS="$INST_LINGUAS $presentlang"
3472 if test -n "$INST_LINGUAS"; then
3473 for lang in $INST_LINGUAS; do
3474 CATALOGS="$CATALOGS $lang.gmo"
3475 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
3476 QTCATALOGS="$QTCATALOGS $lang.qm"
3477 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3478 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
3479 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/'`
3480 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
3484 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"
3486 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
3487 # Add dependencies that cannot be formulated as a simple suffix rule.
3488 for lang in $ALL_LINGUAS; do
3489 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3490 cat >> "$ac_file.tmp" <<EOF
3491 $frobbedlang.msg: $lang.po
3492 ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
3493 ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3497 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
3498 # Add dependencies that cannot be formulated as a simple suffix rule.
3499 for lang in $ALL_LINGUAS; do
3500 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/'`
3501 cat >> "$ac_file.tmp" <<EOF
3502 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
3503 ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
3504 ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3508 if test -n "$POMAKEFILEDEPS"; then
3509 cat >> "$ac_file.tmp" <<EOF
3510 Makefile: $POMAKEFILEDEPS
3513 mv "$ac_file.tmp" "$ac_file"
3516 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
3517 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
3519 XGETTEXT_EXTRA_OPTIONS=
3522 dnl Registers an option to be passed to xgettext in the po subdirectory.
3523 AC_DEFUN([AM_XGETTEXT_OPTION],
3525 AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
3526 XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
3529 # printf-posix.m4 serial 6 (gettext-0.18.2)
3530 dnl Copyright (C) 2003, 2007, 2009-2013 Free Software Foundation, Inc.
3531 dnl This file is free software; the Free Software Foundation
3532 dnl gives unlimited permission to copy and/or distribute it,
3533 dnl with or without modifications, as long as this notice is preserved.
3535 dnl From Bruno Haible.
3536 dnl Test whether the printf() function supports POSIX/XSI format strings with
3539 AC_DEFUN([gt_PRINTF_POSIX],
3541 AC_REQUIRE([AC_PROG_CC])
3542 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
3543 gt_cv_func_printf_posix,
3549 /* The string "%2$d %1$d", with dollar characters protected from the shell's
3550 dollar expansion (possibly an autoconf bug). */
3551 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
3552 static char buf[100];
3555 sprintf (buf, format, 33, 55);
3556 return (strcmp (buf, "55 33") != 0);
3558 [gt_cv_func_printf_posix=yes],
3559 [gt_cv_func_printf_posix=no],
3561 AC_EGREP_CPP([notposix], [
3562 #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
3566 [gt_cv_func_printf_posix="guessing no"],
3567 [gt_cv_func_printf_posix="guessing yes"])
3570 case $gt_cv_func_printf_posix in
3572 AC_DEFINE([HAVE_POSIX_PRINTF], [1],
3573 [Define if your printf() function supports format strings with positions.])
3578 # progtest.m4 serial 7 (gettext-0.18.2)
3579 dnl Copyright (C) 1996-2003, 2005, 2008-2013 Free Software Foundation, Inc.
3580 dnl This file is free software; the Free Software Foundation
3581 dnl gives unlimited permission to copy and/or distribute it,
3582 dnl with or without modifications, as long as this notice is preserved.
3584 dnl This file can can be used in projects which are not available under
3585 dnl the GNU General Public License or the GNU Library General Public
3586 dnl License but which still want to provide support for the GNU gettext
3588 dnl Please note that the actual code of the GNU gettext library is covered
3589 dnl by the GNU Library General Public License, and the rest of the GNU
3590 dnl gettext package package is covered by the GNU General Public License.
3591 dnl They are *not* in the public domain.
3594 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
3598 # Search path for a program which passes the given test.
3600 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3601 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3602 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3604 # Prepare PATH_SEPARATOR.
3605 # The user is always right.
3606 if test "${PATH_SEPARATOR+set}" != set; then
3607 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
3608 # contains only /bin. Note that ksh looks also at the FPATH variable,
3609 # so we have to set that as well for the test.
3611 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
3612 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
3613 || PATH_SEPARATOR=';'
3617 # Find out how to test for executable files. Don't use a zero-byte file,
3618 # as systems may use methods other than mode bits to determine executability.
3619 cat >conf$$.file <<_ASEOF
3623 chmod +x conf$$.file
3624 if test -x conf$$.file >/dev/null 2>&1; then
3625 ac_executable_p="test -x"
3627 ac_executable_p="test -f"
3631 # Extract the first word of "$2", so it can be a program name with args.
3632 set dummy $2; ac_word=[$]2
3633 AC_MSG_CHECKING([for $ac_word])
3634 AC_CACHE_VAL([ac_cv_path_$1],
3636 [[\\/]]* | ?:[[\\/]]*)
3637 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3640 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
3641 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3643 test -z "$ac_dir" && ac_dir=.
3644 for ac_exec_ext in '' $ac_executable_extensions; do
3645 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
3646 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
3648 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
3655 dnl If no 4th arg is given, leave the cache variable unset,
3656 dnl so AC_PATH_PROGS will keep looking.
3657 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3662 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
3663 AC_MSG_RESULT([$][$1])
3670 # size_max.m4 serial 10
3671 dnl Copyright (C) 2003, 2005-2006, 2008-2013 Free Software Foundation, Inc.
3672 dnl This file is free software; the Free Software Foundation
3673 dnl gives unlimited permission to copy and/or distribute it,
3674 dnl with or without modifications, as long as this notice is preserved.
3676 dnl From Bruno Haible.
3678 AC_DEFUN([gl_SIZE_MAX],
3680 AC_CHECK_HEADERS([stdint.h])
3681 dnl First test whether the system already has SIZE_MAX.
3682 AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
3684 AC_EGREP_CPP([Found it], [
3692 ], [gl_cv_size_max=yes])
3693 if test -z "$gl_cv_size_max"; then
3694 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
3695 dnl than the type 'unsigned long'. Try hard to find a definition that can
3696 dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
3697 AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
3698 [#include <stddef.h>
3699 #include <limits.h>], [size_t_bits_minus_1=])
3700 AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
3701 [#include <stddef.h>], [fits_in_uint=])
3702 if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
3703 if test $fits_in_uint = 1; then
3704 dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
3705 dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
3708 [[#include <stddef.h>
3710 extern unsigned long foo;
3715 dnl We cannot use 'expr' to simplify this expression, because 'expr'
3716 dnl works only with 'long' integers in the host environment, while we
3717 dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
3718 if test $fits_in_uint = 1; then
3719 gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
3721 gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
3724 dnl Shouldn't happen, but who knows...
3725 gl_cv_size_max='((size_t)~(size_t)0)'
3729 if test "$gl_cv_size_max" != yes; then
3730 AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
3731 [Define as the maximum value of type 'size_t', if the system doesn't define it.])
3733 dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
3734 dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
3735 dnl #define by AC_DEFINE_UNQUOTED.
3736 AH_VERBATIM([SIZE_MAX],
3737 [/* Define as the maximum value of type 'size_t', if the system doesn't define
3744 dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
3745 dnl Remove this when we can assume autoconf >= 2.61.
3746 m4_ifdef([AC_COMPUTE_INT], [], [
3747 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
3750 # stdint_h.m4 serial 9
3751 dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
3752 dnl This file is free software; the Free Software Foundation
3753 dnl gives unlimited permission to copy and/or distribute it,
3754 dnl with or without modifications, as long as this notice is preserved.
3756 dnl From Paul Eggert.
3758 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
3759 # doesn't clash with <sys/types.h>, and declares uintmax_t.
3761 AC_DEFUN([gl_AC_HEADER_STDINT_H],
3763 AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
3766 [[#include <sys/types.h>
3767 #include <stdint.h>]],
3768 [[uintmax_t i = (uintmax_t) -1; return !i;]])],
3769 [gl_cv_header_stdint_h=yes],
3770 [gl_cv_header_stdint_h=no])])
3771 if test $gl_cv_header_stdint_h = yes; then
3772 AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
3773 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
3774 and declares uintmax_t. ])
3778 # threadlib.m4 serial 10 (gettext-0.18.2)
3779 dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
3780 dnl This file is free software; the Free Software Foundation
3781 dnl gives unlimited permission to copy and/or distribute it,
3782 dnl with or without modifications, as long as this notice is preserved.
3784 dnl From Bruno Haible.
3788 dnl Tests for a multithreading library to be used.
3789 dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
3790 dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
3791 dnl default is 'no', otherwise it is system dependent. In both cases, the user
3792 dnl can change the choice through the options --enable-threads=choice or
3793 dnl --disable-threads.
3794 dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
3795 dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
3796 dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
3797 dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
3799 dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
3800 dnl programs that really need multithread functionality. The difference
3801 dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
3802 dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
3803 dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
3804 dnl multithread-safe programs.
3806 AC_DEFUN([gl_THREADLIB_EARLY],
3808 AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
3811 dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
3813 AC_DEFUN([gl_THREADLIB_EARLY_BODY],
3815 dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
3816 dnl influences the result of the autoconf tests that test for *_unlocked
3817 dnl declarations, on AIX 5 at least. Therefore it must come early.
3818 AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
3819 AC_BEFORE([$0], [gl_ARGP])dnl
3821 AC_REQUIRE([AC_CANONICAL_HOST])
3822 dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
3823 dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
3825 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
3826 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
3827 [AC_REQUIRE([AC_GNU_SOURCE])])
3828 dnl Check for multithreading.
3829 m4_ifdef([gl_THREADLIB_DEFAULT_NO],
3830 [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
3831 [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
3832 AC_ARG_ENABLE([threads],
3833 AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
3834 AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
3835 [gl_use_threads=$enableval],
3836 [if test -n "$gl_use_threads_default"; then
3837 gl_use_threads="$gl_use_threads_default"
3841 dnl Disable multithreading by default on OSF/1, because it interferes
3842 dnl with fork()/exec(): When msgexec is linked with -lpthread, its
3843 dnl child process gets an endless segmentation fault inside execvp().
3844 dnl Disable multithreading by default on Cygwin 1.5.x, because it has
3845 dnl bugs that lead to endless loops or crashes. See
3846 dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
3847 osf*) gl_use_threads=no ;;
3850 1.[0-5].*) gl_use_threads=no ;;
3851 *) gl_use_threads=yes ;;
3854 *) gl_use_threads=yes ;;
3859 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
3860 # For using <pthread.h>:
3863 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
3864 # groks <pthread.h>. cc also understands the flag -pthread, but
3865 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
3866 # 2. putting a flag into CPPFLAGS that has an effect on the linker
3867 # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
3868 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
3869 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3872 # Some systems optimize for single-threaded programs by default, and
3873 # need special flags to disable these optimizations. For example, the
3874 # definition of 'errno' in <errno.h>.
3876 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
3877 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
3882 dnl The guts of gl_THREADLIB. Needs to be expanded only once.
3884 AC_DEFUN([gl_THREADLIB_BODY],
3886 AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
3892 if test "$gl_use_threads" != no; then
3893 dnl Check whether the compiler and linker support weak declarations.
3894 AC_CACHE_CHECK([whether imported symbols can be declared weak],
3897 dnl First, test whether the compiler accepts it syntactically.
3900 [[extern void xyzzy ();
3901 #pragma weak xyzzy]],
3903 [gl_cv_have_weak=maybe])
3904 if test $gl_cv_have_weak = maybe; then
3905 dnl Second, test whether it actually works. On Cygwin 1.7.2, with
3906 dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
3913 return (fputs == NULL);
3915 [gl_cv_have_weak=yes],
3916 [gl_cv_have_weak=no],
3917 [dnl When cross-compiling, assume that only ELF platforms support
3919 AC_EGREP_CPP([Extensible Linking Format],
3921 Extensible Linking Format
3924 [gl_cv_have_weak="guessing yes"],
3925 [gl_cv_have_weak="guessing no"])
3929 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
3930 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
3931 # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
3932 AC_CHECK_HEADER([pthread.h],
3933 [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
3934 if test "$gl_have_pthread_h" = yes; then
3935 # Other possible tests:
3936 # -lpthreads (FSU threads, PCthreads)
3939 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
3940 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
3941 # the second one only in libpthread, and lock.c needs it.
3944 [[#include <pthread.h>]],
3945 [[pthread_mutex_lock((pthread_mutex_t*)0);
3946 pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
3947 [gl_have_pthread=yes])
3948 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
3949 # since it is defined as a macro on OSF/1.)
3950 if test -n "$gl_have_pthread"; then
3951 # The program links fine without libpthread. But it may actually
3952 # need to link with libpthread in order to create multiple threads.
3953 AC_CHECK_LIB([pthread], [pthread_kill],
3954 [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
3955 # On Solaris and HP-UX, most pthread functions exist also in libc.
3956 # Therefore pthread_in_use() needs to actually try to create a
3957 # thread: pthread_create from libc will fail, whereas
3958 # pthread_create will actually create a thread.
3961 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
3962 [Define if the pthread_in_use() detection is hard.])
3966 # Some library is needed. Try libpthread and libc_r.
3967 AC_CHECK_LIB([pthread], [pthread_kill],
3968 [gl_have_pthread=yes
3969 LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
3970 LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
3971 if test -z "$gl_have_pthread"; then
3973 AC_CHECK_LIB([c_r], [pthread_kill],
3974 [gl_have_pthread=yes
3975 LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
3976 LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
3979 if test -n "$gl_have_pthread"; then
3980 gl_threads_api=posix
3981 AC_DEFINE([USE_POSIX_THREADS], [1],
3982 [Define if the POSIX multithreading library can be used.])
3983 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
3984 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
3985 AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
3986 [Define if references to the POSIX multithreading library should be made weak.])
3994 if test -z "$gl_have_pthread"; then
3995 if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
3996 gl_have_solaristhread=
3997 gl_save_LIBS="$LIBS"
3998 LIBS="$LIBS -lthread"
4006 [gl_have_solaristhread=yes])
4007 LIBS="$gl_save_LIBS"
4008 if test -n "$gl_have_solaristhread"; then
4009 gl_threads_api=solaris
4011 LTLIBTHREAD=-lthread
4012 LIBMULTITHREAD="$LIBTHREAD"
4013 LTLIBMULTITHREAD="$LTLIBTHREAD"
4014 AC_DEFINE([USE_SOLARIS_THREADS], [1],
4015 [Define if the old Solaris multithreading library can be used.])
4016 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
4017 AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
4018 [Define if references to the old Solaris multithreading library should be made weak.])
4025 if test "$gl_use_threads" = pth; then
4026 gl_save_CPPFLAGS="$CPPFLAGS"
4027 AC_LIB_LINKFLAGS([pth])
4029 gl_save_LIBS="$LIBS"
4030 LIBS="$LIBS $LIBPTH"
4032 [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
4034 LIBS="$gl_save_LIBS"
4035 if test -n "$gl_have_pth"; then
4038 LTLIBTHREAD="$LTLIBPTH"
4039 LIBMULTITHREAD="$LIBTHREAD"
4040 LTLIBMULTITHREAD="$LTLIBTHREAD"
4041 AC_DEFINE([USE_PTH_THREADS], [1],
4042 [Define if the GNU Pth multithreading library can be used.])
4043 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
4044 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
4045 AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
4046 [Define if references to the GNU Pth multithreading library should be made weak.])
4052 CPPFLAGS="$gl_save_CPPFLAGS"
4055 if test -z "$gl_have_pthread"; then
4056 case "$gl_use_threads" in
4057 yes | windows | win32) # The 'win32' is for backward compatibility.
4058 if { case "$host_os" in
4063 gl_threads_api=windows
4064 AC_DEFINE([USE_WINDOWS_THREADS], [1],
4065 [Define if the native Windows multithreading API can be used.])
4071 AC_MSG_CHECKING([for multithread API to use])
4072 AC_MSG_RESULT([$gl_threads_api])
4073 AC_SUBST([LIBTHREAD])
4074 AC_SUBST([LTLIBTHREAD])
4075 AC_SUBST([LIBMULTITHREAD])
4076 AC_SUBST([LTLIBMULTITHREAD])
4079 AC_DEFUN([gl_THREADLIB],
4081 AC_REQUIRE([gl_THREADLIB_EARLY])
4082 AC_REQUIRE([gl_THREADLIB_BODY])
4086 dnl gl_DISABLE_THREADS
4087 dnl ------------------
4088 dnl Sets the gl_THREADLIB default so that threads are not used by default.
4089 dnl The user can still override it at installation time, by using the
4090 dnl configure option '--enable-threads'.
4092 AC_DEFUN([gl_DISABLE_THREADS], [
4093 m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
4097 dnl Survey of platforms:
4099 dnl Platform Available Compiler Supports test-lock
4100 dnl flavours option weak result
4101 dnl --------------- --------- --------- -------- ---------
4102 dnl Linux 2.4/glibc posix -lpthread Y OK
4104 dnl GNU Hurd/glibc posix
4106 dnl FreeBSD 5.3 posix -lc_r Y
4108 dnl posix -lpthread ? Y
4111 dnl FreeBSD 5.2 posix -lc_r Y
4115 dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
4119 dnl OpenBSD 3.4 posix -lpthread Y OK
4121 dnl Mac OS X 10.[123] posix -lpthread Y OK
4123 dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
4124 dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
4126 dnl HP-UX 11 posix -lpthread N (cc) OK
4129 dnl IRIX 6.5 posix -lpthread Y 0.5
4131 dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
4133 dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
4134 dnl -lpthread (gcc) Y
4136 dnl Cygwin posix -lpthread Y OK
4138 dnl Any of the above pth -lpth 0.0
4140 dnl Mingw windows N OK
4144 dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
4146 dnl OK if all three tests terminate OK,
4147 dnl 0.5 if the first test terminates OK but the second one loops endlessly,
4148 dnl 0.0 if the first test already loops endlessly.
4150 # uintmax_t.m4 serial 12
4151 dnl Copyright (C) 1997-2004, 2007-2013 Free Software Foundation, Inc.
4152 dnl This file is free software; the Free Software Foundation
4153 dnl gives unlimited permission to copy and/or distribute it,
4154 dnl with or without modifications, as long as this notice is preserved.
4156 dnl From Paul Eggert.
4160 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
4161 # if it is not already defined in <stdint.h> or <inttypes.h>.
4163 AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
4165 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
4166 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
4167 if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
4168 AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
4169 test $ac_cv_type_unsigned_long_long_int = yes \
4170 && ac_type='unsigned long long' \
4171 || ac_type='unsigned long'
4172 AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
4173 [Define to unsigned long or unsigned long long
4174 if <stdint.h> and <inttypes.h> don't define.])
4176 AC_DEFINE([HAVE_UINTMAX_T], [1],
4177 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
4181 # visibility.m4 serial 5 (gettext-0.18.2)
4182 dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
4183 dnl This file is free software; the Free Software Foundation
4184 dnl gives unlimited permission to copy and/or distribute it,
4185 dnl with or without modifications, as long as this notice is preserved.
4187 dnl From Bruno Haible.
4189 dnl Tests whether the compiler supports the command-line option
4190 dnl -fvisibility=hidden and the function and variable attributes
4191 dnl __attribute__((__visibility__("hidden"))) and
4192 dnl __attribute__((__visibility__("default"))).
4193 dnl Does *not* test for __visibility__("protected") - which has tricky
4194 dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
4196 dnl Does *not* test for __visibility__("internal") - which has processor
4197 dnl dependent semantics.
4198 dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
4199 dnl "really only recommended for legacy code".
4200 dnl Set the variable CFLAG_VISIBILITY.
4201 dnl Defines and sets the variable HAVE_VISIBILITY.
4203 AC_DEFUN([gl_VISIBILITY],
4205 AC_REQUIRE([AC_PROG_CC])
4208 if test -n "$GCC"; then
4209 dnl First, check whether -Werror can be added to the command line, or
4210 dnl whether it leads to an error because of some other option that the
4211 dnl user has put into $CC $CFLAGS $CPPFLAGS.
4212 AC_MSG_CHECKING([whether the -Werror option is usable])
4213 AC_CACHE_VAL([gl_cv_cc_vis_werror], [
4214 gl_save_CFLAGS="$CFLAGS"
4215 CFLAGS="$CFLAGS -Werror"
4217 [AC_LANG_PROGRAM([[]], [[]])],
4218 [gl_cv_cc_vis_werror=yes],
4219 [gl_cv_cc_vis_werror=no])
4220 CFLAGS="$gl_save_CFLAGS"])
4221 AC_MSG_RESULT([$gl_cv_cc_vis_werror])
4222 dnl Now check whether visibility declarations are supported.
4223 AC_MSG_CHECKING([for simple visibility declarations])
4224 AC_CACHE_VAL([gl_cv_cc_visibility], [
4225 gl_save_CFLAGS="$CFLAGS"
4226 CFLAGS="$CFLAGS -fvisibility=hidden"
4227 dnl We use the option -Werror and a function dummyfunc, because on some
4228 dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
4229 dnl "visibility attribute not supported in this configuration; ignored"
4230 dnl at the first function definition in every compilation unit, and we
4231 dnl don't want to use the option in this case.
4232 if test $gl_cv_cc_vis_werror = yes; then
4233 CFLAGS="$CFLAGS -Werror"
4237 [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
4238 extern __attribute__((__visibility__("default"))) int exportedvar;
4239 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
4240 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
4241 void dummyfunc (void) {}
4244 [gl_cv_cc_visibility=yes],
4245 [gl_cv_cc_visibility=no])
4246 CFLAGS="$gl_save_CFLAGS"])
4247 AC_MSG_RESULT([$gl_cv_cc_visibility])
4248 if test $gl_cv_cc_visibility = yes; then
4249 CFLAG_VISIBILITY="-fvisibility=hidden"
4253 AC_SUBST([CFLAG_VISIBILITY])
4254 AC_SUBST([HAVE_VISIBILITY])
4255 AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
4256 [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
4259 # wchar_t.m4 serial 4 (gettext-0.18.2)
4260 dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc.
4261 dnl This file is free software; the Free Software Foundation
4262 dnl gives unlimited permission to copy and/or distribute it,
4263 dnl with or without modifications, as long as this notice is preserved.
4265 dnl From Bruno Haible.
4266 dnl Test whether <stddef.h> has the 'wchar_t' type.
4267 dnl Prerequisite: AC_PROG_CC
4269 AC_DEFUN([gt_TYPE_WCHAR_T],
4271 AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
4274 [[#include <stddef.h>
4275 wchar_t foo = (wchar_t)'\0';]],
4277 [gt_cv_c_wchar_t=yes],
4278 [gt_cv_c_wchar_t=no])])
4279 if test $gt_cv_c_wchar_t = yes; then
4280 AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
4284 # wint_t.m4 serial 5 (gettext-0.18.2)
4285 dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
4286 dnl This file is free software; the Free Software Foundation
4287 dnl gives unlimited permission to copy and/or distribute it,
4288 dnl with or without modifications, as long as this notice is preserved.
4290 dnl From Bruno Haible.
4291 dnl Test whether <wchar.h> has the 'wint_t' type.
4292 dnl Prerequisite: AC_PROG_CC
4294 AC_DEFUN([gt_TYPE_WINT_T],
4296 AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
4300 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
4302 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
4303 before <wchar.h>. */
4308 wint_t foo = (wchar_t)'\0';]],
4310 [gt_cv_c_wint_t=yes],
4311 [gt_cv_c_wint_t=no])])
4312 if test $gt_cv_c_wint_t = yes; then
4313 AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
4318 dnl Copyright (C) 2003-2004, 2008-2013 Free Software Foundation, Inc.
4319 dnl This file is free software; the Free Software Foundation
4320 dnl gives unlimited permission to copy and/or distribute it,
4321 dnl with or without modifications, as long as this notice is preserved.
4323 AC_DEFUN([gl_XSIZE],
4325 dnl Prerequisites of lib/xsize.h.
4326 AC_REQUIRE([gl_SIZE_MAX])
4327 AC_CHECK_HEADERS([stdint.h])
4330 m4_include([acinclude.m4])