Merge lp:~brianaker/drizzle/m4-july into lp:drizzle

Proposed by Brian Aker
Status: Merged
Merged at revision: 2637
Proposed branch: lp:~brianaker/drizzle/m4-july
Merge into: lp:drizzle
Diff against target: 2209 lines (+1955/-71)
26 files modified
docs/include.am (+11/-46)
m4/ax_prog_sphinx_build.m4 (+28/-25)
m4/ax_with_prog.m4 (+70/-0)
m4/codeset.m4 (+21/-0)
m4/fcntl-o.m4 (+81/-0)
m4/gettext.m4 (+383/-0)
m4/glibc2.m4 (+30/-0)
m4/glibc21.m4 (+30/-0)
m4/intdiv0.m4 (+84/-0)
m4/intl.m4 (+294/-0)
m4/intldir.m4 (+19/-0)
m4/intlmacosx.m4 (+51/-0)
m4/intmax.m4 (+33/-0)
m4/inttypes-pri.m4 (+36/-0)
m4/inttypes_h.m4 (+26/-0)
m4/lcmessage.m4 (+31/-0)
m4/lock.m4 (+37/-0)
m4/longlong.m4 (+106/-0)
m4/printf-posix.m4 (+45/-0)
m4/size_max.m4 (+75/-0)
m4/stdint_h.m4 (+26/-0)
m4/threadlib.m4 (+347/-0)
m4/uintmax_t.m4 (+30/-0)
m4/wchar_t.m4 (+20/-0)
m4/wint_t.m4 (+28/-0)
m4/xsize.m4 (+13/-0)
To merge this branch: bzr merge lp:~brianaker/drizzle/m4-july
Reviewer Review Type Date Requested Status
Drizzle Trunk Pending
Review via email: mp+173324@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/include.am'
2--- docs/include.am 2013-01-02 07:47:09 +0000
3+++ docs/include.am 2013-07-06 19:13:27 +0000
4@@ -2,6 +2,9 @@
5 # included from Top Level Makefile.am
6 # All paths should be given relative to the root
7
8+# Makefile for Sphinx documentation
9+#
10+
11 EXTRA_DIST+= \
12 ${top_srcdir}/docs/_static \
13 ${top_srcdir}/docs/conf.py \
14@@ -18,49 +21,27 @@
15 ${top_srcdir}/docs/*/*.rst \
16 ${top_srcdir}/docs/*/*/*.rst
17
18-# Makefile for Sphinx documentation
19-#
20-
21 SPHINXOPTS = ${SPHINX_WARNINGS} -q
22 PAPER =
23-SPHINX_BUILDDIR = ${abs_top_builddir}/docs
24+SPHINX_BUILDDIR = ${abs_srcdir}/docs
25
26 # Internal variables.
27 PAPEROPT_a4 = -D latex_paper_size=a4
28 PAPEROPT_letter = -D latex_paper_size=letter
29-ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SPHINX_BUILDDIR)
30+ALLSPHINXOPTS = -c $(top_builddir)/docs $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SPHINX_BUILDDIR)
31
32 .PHONY: clean-docs-check
33 clean-docs-check:
34- -rm -rf docs/_build docs/doctrees man/.doctrees/
35+ -rm -rf docs/_build docs/doctrees man/.doctrees
36
37 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
38-if HAVE_SPHINX
39-
40-sphinx-help:
41- @echo "Please use \`make <target>' where <target> is one of"
42- @echo " html to make standalone HTML files"
43- @echo " singlehtml to make a single large HTML file"
44- @echo " pickle to make pickle files"
45- @echo " json to make JSON files"
46- @echo " htmlhelp to make HTML files and a HTML help project"
47- @echo " qthelp to make HTML files and a qthelp project"
48- @echo " devhelp to make HTML files and a Devhelp project"
49- @echo " epub to make an epub"
50- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
51- @echo " latexpdf to make LaTeX files and run them through pdflatex"
52- @echo " text to make text files"
53- @echo " man to make manual pages"
54- @echo " changes to make an overview of all changed/added/deprecated items"
55- @echo " linkcheck to check all external links for integrity"
56- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
57-
58-doc_dirs:
59- @$(mkdir_p) $(SPHINX_BUILDDIR)/_static
60+
61+man: docs/conf.py
62+ @PYTHONPATH=$(SPHINX_BUILDDIR)/docs $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) ${top_builddir}/man
63
64 install-html-local: html-local
65- @rm -rf $(htmldir)/html
66- @cp -r ${top_builddir}/html/ $(htmldir)
67+ @$(MKDIR_P) $(htmldir)/html
68+ @cp -r ${top_builddir}/html $(htmldir)/
69
70 html-local: docs/conf.py
71 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ${top_builddir}/html
72@@ -105,16 +86,6 @@
73 text: docs/conf.py
74 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/text
75
76-if HAVE_RECENT_SPHINX
77-man:
78- @PYTHONPATH=$(SPHINX_BUILDDIR)/docs $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) ${top_builddir}/man
79-
80-else
81-
82-man:
83-
84-endif
85-
86 changes: docs/conf.py
87 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/changes
88
89@@ -125,9 +96,3 @@
90 PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/doctest
91 @echo "Testing of doctests in the sources finished, look at the " \
92 "results in $(SPHINX_BUILDDIR)/doctest/output.txt."
93-
94-else
95-
96-man:
97-
98-endif
99
100=== modified file 'm4/ax_prog_sphinx_build.m4'
101--- m4/ax_prog_sphinx_build.m4 2012-12-28 23:09:22 +0000
102+++ m4/ax_prog_sphinx_build.m4 2013-07-06 19:13:27 +0000
103@@ -4,42 +4,45 @@
104 #
105 # SYNOPSIS
106 #
107-# AX_PROG_SPHINX_BUILD()
108+# AX_PROG_SPHINX_BUILD([ACTION-IF-FOUND], [ACTION-IF-NOT_FOUND])
109 #
110 # DESCRIPTION
111 #
112-# Look for sphinx-build
113+# Look for sphinx-build and make sure it is a recent version of it.
114 #
115 # LICENSE
116 #
117-# Copyright (c) 2012 Brian Aker <brian@tangent.org>
118+# Copyright (c) 2012-2013 Brian Aker <brian@tangent.org>
119 #
120 # Copying and distribution of this file, with or without modification, are
121 # permitted in any medium without royalty provided the copyright notice
122 # and this notice are preserved. This file is offered as-is, without any
123 # warranty.
124
125-#serial 2
126+#serial 5
127
128 AC_DEFUN([AX_PROG_SPHINX_BUILD],
129- [AC_PREREQ([2.63])dnl
130- AC_CHECK_PROGS([PERL], [perl])
131- AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:])
132- AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found])
133- AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found])
134-
135- AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])
136- AS_IF([test "x${SPHINXBUILD}" != "x:"],[
137- AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[
138-
139- ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1
140- AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes],
141- [ac_cv_recent_sphinx=no])
142- rm -rf conftest.d
143- ])
144- ])
145-
146- AM_CONDITIONAL([HAVE_DPKG_GENSYMBOLS],[test "x${DPKG_GENSYMBOLS}" != "x:"])
147- AM_CONDITIONAL([HAVE_SPHINX],[test "x${SPHINXBUILD}" != "x:"])
148- AM_CONDITIONAL([HAVE_RECENT_SPHINX],[test "x${ac_cv_recent_sphinx}" = "xyes"])
149-])
150+ [AX_WITH_PROG([SPHINXBUILD],[sphinx-build],[:])
151+ AS_IF([test x"SPHINXBUILD" = x":"],
152+ [SPHINXBUILD=],
153+ [AS_IF([test -x "$SPHINXBUILD"],
154+ [AC_MSG_CHECKING([Checking to see if $SPHINXBUILD is recent])
155+ junk=`$SPHINXBUILD --version &> version_file`
156+ AS_IF([test $? -eq 0],
157+ [ax_sphinx_build_version=`head -1 version_file`],
158+ [junk=`$SPHINXBUILD &> version_file`
159+ ax_sphinx_build_version=`head -1 version_file`
160+ rm version_file
161+ AC_MSG_RESULT([$SPHINXBUILD is version "$ax_sphinx_build_version"])
162+ $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
163+ AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
164+ rm -rf conftest.d ])
165+ ])
166+ rm -f version_file
167+ ])
168+
169+ AS_IF([test -n "${SPHINXBUILD}"],
170+ [AC_SUBST([SPHINXBUILD])
171+ ifelse([$1], , :, [$1])],
172+ [ifelse([$2], , :, [$2])])
173+ ])
174
175=== added file 'm4/ax_with_prog.m4'
176--- m4/ax_with_prog.m4 1970-01-01 00:00:00 +0000
177+++ m4/ax_with_prog.m4 2013-07-06 19:13:27 +0000
178@@ -0,0 +1,70 @@
179+# ===========================================================================
180+# http://www.gnu.org/software/autoconf-archive/ax_with_prog.html
181+# ===========================================================================
182+#
183+# SYNOPSIS
184+#
185+# AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH])
186+#
187+# DESCRIPTION
188+#
189+# Locates an installed program binary, placing the result in the precious
190+# variable VARIABLE. Accepts a present VARIABLE, then --with-program, and
191+# failing that searches for program in the given path (which defaults to
192+# the system path). If program is found, VARIABLE is set to the full path
193+# of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND
194+# if provided, unchanged otherwise.
195+#
196+# A typical example could be the following one:
197+#
198+# AX_WITH_PROG(PERL,perl)
199+#
200+# NOTE: This macro is based upon the original AX_WITH_PYTHON macro from
201+# Dustin J. Mitchell <dustin@cs.uchicago.edu>.
202+#
203+# LICENSE
204+#
205+# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
206+# Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
207+#
208+# Copying and distribution of this file, with or without modification, are
209+# permitted in any medium without royalty provided the copyright notice
210+# and this notice are preserved. This file is offered as-is, without any
211+# warranty.
212+
213+#serial 16
214+
215+AC_DEFUN([AX_WITH_PROG],[
216+ AC_PREREQ([2.61])
217+
218+ pushdef([VARIABLE],$1)
219+ pushdef([EXECUTABLE],$2)
220+ pushdef([VALUE_IF_NOT_FOUND],$3)
221+ pushdef([PATH_PROG],$4)
222+
223+ AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable)
224+
225+ AS_IF(test -z "$VARIABLE",[
226+ AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided)
227+ AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[PATH]]]],absolute path to EXECUTABLE executable), [
228+ AS_IF([test "$withval" != yes && test "$withval" != no],[
229+ VARIABLE="$withval"
230+ AC_MSG_RESULT($VARIABLE)
231+ ],[
232+ VARIABLE=""
233+ AC_MSG_RESULT([no])
234+ AS_IF([test "$withval" != no], [
235+ AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[])
236+ ])
237+ ])
238+ ],[
239+ AC_MSG_RESULT([no])
240+ AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[])
241+ ])
242+ ])
243+
244+ popdef([PATH_PROG])
245+ popdef([VALUE_IF_NOT_FOUND])
246+ popdef([EXECUTABLE])
247+ popdef([VARIABLE])
248+])
249
250=== added file 'm4/codeset.m4'
251--- m4/codeset.m4 1970-01-01 00:00:00 +0000
252+++ m4/codeset.m4 2013-07-06 19:13:27 +0000
253@@ -0,0 +1,21 @@
254+# codeset.m4 serial 4 (gettext-0.18)
255+dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
256+dnl This file is free software; the Free Software Foundation
257+dnl gives unlimited permission to copy and/or distribute it,
258+dnl with or without modifications, as long as this notice is preserved.
259+
260+dnl From Bruno Haible.
261+
262+AC_DEFUN([AM_LANGINFO_CODESET],
263+[
264+ AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
265+ [AC_TRY_LINK([#include <langinfo.h>],
266+ [char* cs = nl_langinfo(CODESET); return !cs;],
267+ [am_cv_langinfo_codeset=yes],
268+ [am_cv_langinfo_codeset=no])
269+ ])
270+ if test $am_cv_langinfo_codeset = yes; then
271+ AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
272+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
273+ fi
274+])
275
276=== added file 'm4/fcntl-o.m4'
277--- m4/fcntl-o.m4 1970-01-01 00:00:00 +0000
278+++ m4/fcntl-o.m4 2013-07-06 19:13:27 +0000
279@@ -0,0 +1,81 @@
280+# fcntl-o.m4 serial 1
281+dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
282+dnl This file is free software; the Free Software Foundation
283+dnl gives unlimited permission to copy and/or distribute it,
284+dnl with or without modifications, as long as this notice is preserved.
285+
286+dnl Written by Paul Eggert.
287+
288+# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
289+# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
290+# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
291+AC_DEFUN([gl_FCNTL_O_FLAGS],
292+[
293+ dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
294+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
295+ AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
296+ [AC_RUN_IFELSE(
297+ [AC_LANG_PROGRAM(
298+ [[#include <sys/types.h>
299+ #include <sys/stat.h>
300+ #include <unistd.h>
301+ #include <fcntl.h>
302+ #ifndef O_NOATIME
303+ #define O_NOATIME 0
304+ #endif
305+ #ifndef O_NOFOLLOW
306+ #define O_NOFOLLOW 0
307+ #endif
308+ static int const constants[] =
309+ {
310+ O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
311+ O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
312+ };
313+ ]],
314+ [[
315+ int status = !constants;
316+ {
317+ static char const sym[] = "conftest.sym";
318+ if (symlink (".", sym) != 0
319+ || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
320+ status |= 32;
321+ unlink (sym);
322+ }
323+ {
324+ static char const file[] = "confdefs.h";
325+ int fd = open (file, O_RDONLY | O_NOATIME);
326+ char c;
327+ struct stat st0, st1;
328+ if (fd < 0
329+ || fstat (fd, &st0) != 0
330+ || sleep (1) != 0
331+ || read (fd, &c, 1) != 1
332+ || close (fd) != 0
333+ || stat (file, &st1) != 0
334+ || st0.st_atime != st1.st_atime)
335+ status |= 64;
336+ }
337+ return status;]])],
338+ [gl_cv_header_working_fcntl_h=yes],
339+ [case $? in #(
340+ 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
341+ 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
342+ 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
343+ *) gl_cv_header_working_fcntl_h='no';;
344+ esac],
345+ [gl_cv_header_working_fcntl_h=cross-compiling])])
346+
347+ case $gl_cv_header_working_fcntl_h in #(
348+ *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
349+ *) ac_val=1;;
350+ esac
351+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
352+ [Define to 1 if O_NOATIME works.])
353+
354+ case $gl_cv_header_working_fcntl_h in #(
355+ *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
356+ *) ac_val=1;;
357+ esac
358+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
359+ [Define to 1 if O_NOFOLLOW works.])
360+])
361
362=== added file 'm4/gettext.m4'
363--- m4/gettext.m4 1970-01-01 00:00:00 +0000
364+++ m4/gettext.m4 2013-07-06 19:13:27 +0000
365@@ -0,0 +1,383 @@
366+# gettext.m4 serial 63 (gettext-0.18)
367+dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
368+dnl This file is free software; the Free Software Foundation
369+dnl gives unlimited permission to copy and/or distribute it,
370+dnl with or without modifications, as long as this notice is preserved.
371+dnl
372+dnl This file can can be used in projects which are not available under
373+dnl the GNU General Public License or the GNU Library General Public
374+dnl License but which still want to provide support for the GNU gettext
375+dnl functionality.
376+dnl Please note that the actual code of the GNU gettext library is covered
377+dnl by the GNU Library General Public License, and the rest of the GNU
378+dnl gettext package package is covered by the GNU General Public License.
379+dnl They are *not* in the public domain.
380+
381+dnl Authors:
382+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
383+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
384+
385+dnl Macro to add for using GNU gettext.
386+
387+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
388+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
389+dnl default (if it is not specified or empty) is 'no-libtool'.
390+dnl INTLSYMBOL should be 'external' for packages with no intl directory,
391+dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
392+dnl If INTLSYMBOL is 'use-libtool', then a libtool library
393+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
394+dnl depending on --{enable,disable}-{shared,static} and on the presence of
395+dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
396+dnl $(top_builddir)/intl/libintl.a will be created.
397+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
398+dnl implementations (in libc or libintl) without the ngettext() function
399+dnl will be ignored. If NEEDSYMBOL is specified and is
400+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
401+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
402+dnl INTLDIR is used to find the intl libraries. If empty,
403+dnl the value `$(top_builddir)/intl/' is used.
404+dnl
405+dnl The result of the configuration is one of three cases:
406+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
407+dnl and used.
408+dnl Catalog format: GNU --> install in $(datadir)
409+dnl Catalog extension: .mo after installation, .gmo in source tree
410+dnl 2) GNU gettext has been found in the system's C library.
411+dnl Catalog format: GNU --> install in $(datadir)
412+dnl Catalog extension: .mo after installation, .gmo in source tree
413+dnl 3) No internationalization, always use English msgid.
414+dnl Catalog format: none
415+dnl Catalog extension: none
416+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
417+dnl The use of .gmo is historical (it was needed to avoid overwriting the
418+dnl GNU format catalogs when building on a platform with an X/Open gettext),
419+dnl but we keep it in order not to force irrelevant filename changes on the
420+dnl maintainers.
421+dnl
422+AC_DEFUN([AM_GNU_GETTEXT],
423+[
424+ dnl Argument checking.
425+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
426+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
427+])])])])])
428+ ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
429+ [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
430+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
431+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
432+])])])])
433+ define([gt_included_intl],
434+ ifelse([$1], [external],
435+ ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
436+ [yes]))
437+ define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
438+ gt_NEEDS_INIT
439+ AM_GNU_GETTEXT_NEED([$2])
440+
441+ AC_REQUIRE([AM_PO_SUBDIRS])dnl
442+ ifelse(gt_included_intl, yes, [
443+ AC_REQUIRE([AM_INTL_SUBDIR])dnl
444+ ])
445+
446+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
447+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
448+ AC_REQUIRE([AC_LIB_RPATH])
449+
450+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
451+ dnl Ideally we would do this search only after the
452+ dnl if test "$USE_NLS" = "yes"; then
453+ dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
454+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
455+ dnl the configure script would need to contain the same shell code
456+ dnl again, outside any 'if'. There are two solutions:
457+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
458+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
459+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
460+ dnl documented, we avoid it.
461+ ifelse(gt_included_intl, yes, , [
462+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
463+ ])
464+
465+ dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
466+ gt_INTL_MACOSX
467+
468+ dnl Set USE_NLS.
469+ AC_REQUIRE([AM_NLS])
470+
471+ ifelse(gt_included_intl, yes, [
472+ BUILD_INCLUDED_LIBINTL=no
473+ USE_INCLUDED_LIBINTL=no
474+ ])
475+ LIBINTL=
476+ LTLIBINTL=
477+ POSUB=
478+
479+ dnl Add a version number to the cache macros.
480+ case " $gt_needs " in
481+ *" need-formatstring-macros "*) gt_api_version=3 ;;
482+ *" need-ngettext "*) gt_api_version=2 ;;
483+ *) gt_api_version=1 ;;
484+ esac
485+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
486+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
487+
488+ dnl If we use NLS figure out what method
489+ if test "$USE_NLS" = "yes"; then
490+ gt_use_preinstalled_gnugettext=no
491+ ifelse(gt_included_intl, yes, [
492+ AC_MSG_CHECKING([whether included gettext is requested])
493+ AC_ARG_WITH([included-gettext],
494+ [ --with-included-gettext use the GNU gettext library included here],
495+ nls_cv_force_use_gnu_gettext=$withval,
496+ nls_cv_force_use_gnu_gettext=no)
497+ AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
498+
499+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
500+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
501+ ])
502+ dnl User does not insist on using GNU NLS library. Figure out what
503+ dnl to use. If GNU gettext is available we use this. Else we have
504+ dnl to fall back to GNU NLS library.
505+
506+ if test $gt_api_version -ge 3; then
507+ gt_revision_test_code='
508+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
509+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
510+#endif
511+changequote(,)dnl
512+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
513+changequote([,])dnl
514+'
515+ else
516+ gt_revision_test_code=
517+ fi
518+ if test $gt_api_version -ge 2; then
519+ gt_expression_test_code=' + * ngettext ("", "", 0)'
520+ else
521+ gt_expression_test_code=
522+ fi
523+
524+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
525+ [AC_TRY_LINK([#include <libintl.h>
526+$gt_revision_test_code
527+extern int _nl_msg_cat_cntr;
528+extern int *_nl_domain_bindings;],
529+ [bindtextdomain ("", "");
530+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
531+ [eval "$gt_func_gnugettext_libc=yes"],
532+ [eval "$gt_func_gnugettext_libc=no"])])
533+
534+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
535+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
536+ ifelse(gt_included_intl, yes, , [
537+ AM_ICONV_LINK
538+ ])
539+ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
540+ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
541+ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
542+ dnl even if libiconv doesn't exist.
543+ AC_LIB_LINKFLAGS_BODY([intl])
544+ AC_CACHE_CHECK([for GNU gettext in libintl],
545+ [$gt_func_gnugettext_libintl],
546+ [gt_save_CPPFLAGS="$CPPFLAGS"
547+ CPPFLAGS="$CPPFLAGS $INCINTL"
548+ gt_save_LIBS="$LIBS"
549+ LIBS="$LIBS $LIBINTL"
550+ dnl Now see whether libintl exists and does not depend on libiconv.
551+ AC_TRY_LINK([#include <libintl.h>
552+$gt_revision_test_code
553+extern int _nl_msg_cat_cntr;
554+extern
555+#ifdef __cplusplus
556+"C"
557+#endif
558+const char *_nl_expand_alias (const char *);],
559+ [bindtextdomain ("", "");
560+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
561+ [eval "$gt_func_gnugettext_libintl=yes"],
562+ [eval "$gt_func_gnugettext_libintl=no"])
563+ dnl Now see whether libintl exists and depends on libiconv.
564+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
565+ LIBS="$LIBS $LIBICONV"
566+ AC_TRY_LINK([#include <libintl.h>
567+$gt_revision_test_code
568+extern int _nl_msg_cat_cntr;
569+extern
570+#ifdef __cplusplus
571+"C"
572+#endif
573+const char *_nl_expand_alias (const char *);],
574+ [bindtextdomain ("", "");
575+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
576+ [LIBINTL="$LIBINTL $LIBICONV"
577+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
578+ eval "$gt_func_gnugettext_libintl=yes"
579+ ])
580+ fi
581+ CPPFLAGS="$gt_save_CPPFLAGS"
582+ LIBS="$gt_save_LIBS"])
583+ fi
584+
585+ dnl If an already present or preinstalled GNU gettext() is found,
586+ dnl use it. But if this macro is used in GNU gettext, and GNU
587+ dnl gettext is already preinstalled in libintl, we update this
588+ dnl libintl. (Cf. the install rule in intl/Makefile.in.)
589+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
590+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
591+ && test "$PACKAGE" != gettext-runtime \
592+ && test "$PACKAGE" != gettext-tools; }; then
593+ gt_use_preinstalled_gnugettext=yes
594+ else
595+ dnl Reset the values set by searching for libintl.
596+ LIBINTL=
597+ LTLIBINTL=
598+ INCINTL=
599+ fi
600+
601+ ifelse(gt_included_intl, yes, [
602+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
603+ dnl GNU gettext is not found in the C library.
604+ dnl Fall back on included GNU gettext library.
605+ nls_cv_use_gnu_gettext=yes
606+ fi
607+ fi
608+
609+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
610+ dnl Mark actions used to generate GNU NLS library.
611+ BUILD_INCLUDED_LIBINTL=yes
612+ USE_INCLUDED_LIBINTL=yes
613+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
614+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
615+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
616+ fi
617+
618+ CATOBJEXT=
619+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
620+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
621+ dnl Mark actions to use GNU gettext tools.
622+ CATOBJEXT=.gmo
623+ fi
624+ ])
625+
626+ if test -n "$INTL_MACOSX_LIBS"; then
627+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
628+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
629+ dnl Some extra flags are needed during linking.
630+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
631+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
632+ fi
633+ fi
634+
635+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
636+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
637+ AC_DEFINE([ENABLE_NLS], [1],
638+ [Define to 1 if translation of program messages to the user's native language
639+ is requested.])
640+ else
641+ USE_NLS=no
642+ fi
643+ fi
644+
645+ AC_MSG_CHECKING([whether to use NLS])
646+ AC_MSG_RESULT([$USE_NLS])
647+ if test "$USE_NLS" = "yes"; then
648+ AC_MSG_CHECKING([where the gettext function comes from])
649+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
650+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
651+ gt_source="external libintl"
652+ else
653+ gt_source="libc"
654+ fi
655+ else
656+ gt_source="included intl directory"
657+ fi
658+ AC_MSG_RESULT([$gt_source])
659+ fi
660+
661+ if test "$USE_NLS" = "yes"; then
662+
663+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
664+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
665+ AC_MSG_CHECKING([how to link with libintl])
666+ AC_MSG_RESULT([$LIBINTL])
667+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
668+ fi
669+
670+ dnl For backward compatibility. Some packages may be using this.
671+ AC_DEFINE([HAVE_GETTEXT], [1],
672+ [Define if the GNU gettext() function is already present or preinstalled.])
673+ AC_DEFINE([HAVE_DCGETTEXT], [1],
674+ [Define if the GNU dcgettext() function is already present or preinstalled.])
675+ fi
676+
677+ dnl We need to process the po/ directory.
678+ POSUB=po
679+ fi
680+
681+ ifelse(gt_included_intl, yes, [
682+ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
683+ dnl to 'yes' because some of the testsuite requires it.
684+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
685+ BUILD_INCLUDED_LIBINTL=yes
686+ fi
687+
688+ dnl Make all variables we use known to autoconf.
689+ AC_SUBST([BUILD_INCLUDED_LIBINTL])
690+ AC_SUBST([USE_INCLUDED_LIBINTL])
691+ AC_SUBST([CATOBJEXT])
692+
693+ dnl For backward compatibility. Some configure.ins may be using this.
694+ nls_cv_header_intl=
695+ nls_cv_header_libgt=
696+
697+ dnl For backward compatibility. Some Makefiles may be using this.
698+ DATADIRNAME=share
699+ AC_SUBST([DATADIRNAME])
700+
701+ dnl For backward compatibility. Some Makefiles may be using this.
702+ INSTOBJEXT=.mo
703+ AC_SUBST([INSTOBJEXT])
704+
705+ dnl For backward compatibility. Some Makefiles may be using this.
706+ GENCAT=gencat
707+ AC_SUBST([GENCAT])
708+
709+ dnl For backward compatibility. Some Makefiles may be using this.
710+ INTLOBJS=
711+ if test "$USE_INCLUDED_LIBINTL" = yes; then
712+ INTLOBJS="\$(GETTOBJS)"
713+ fi
714+ AC_SUBST([INTLOBJS])
715+
716+ dnl Enable libtool support if the surrounding package wishes it.
717+ INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
718+ AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
719+ ])
720+
721+ dnl For backward compatibility. Some Makefiles may be using this.
722+ INTLLIBS="$LIBINTL"
723+ AC_SUBST([INTLLIBS])
724+
725+ dnl Make all documented variables known to autoconf.
726+ AC_SUBST([LIBINTL])
727+ AC_SUBST([LTLIBINTL])
728+ AC_SUBST([POSUB])
729+])
730+
731+
732+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
733+m4_define([gt_NEEDS_INIT],
734+[
735+ m4_divert_text([DEFAULTS], [gt_needs=])
736+ m4_define([gt_NEEDS_INIT], [])
737+])
738+
739+
740+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
741+AC_DEFUN([AM_GNU_GETTEXT_NEED],
742+[
743+ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
744+])
745+
746+
747+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
748+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
749
750=== added file 'm4/glibc2.m4'
751--- m4/glibc2.m4 1970-01-01 00:00:00 +0000
752+++ m4/glibc2.m4 2013-07-06 19:13:27 +0000
753@@ -0,0 +1,30 @@
754+# glibc2.m4 serial 2
755+dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
756+dnl This file is free software; the Free Software Foundation
757+dnl gives unlimited permission to copy and/or distribute it,
758+dnl with or without modifications, as long as this notice is preserved.
759+
760+# Test for the GNU C Library, version 2.0 or newer.
761+# From Bruno Haible.
762+
763+AC_DEFUN([gt_GLIBC2],
764+ [
765+ AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
766+ [ac_cv_gnu_library_2],
767+ [AC_EGREP_CPP([Lucky GNU user],
768+ [
769+#include <features.h>
770+#ifdef __GNU_LIBRARY__
771+ #if (__GLIBC__ >= 2)
772+ Lucky GNU user
773+ #endif
774+#endif
775+ ],
776+ [ac_cv_gnu_library_2=yes],
777+ [ac_cv_gnu_library_2=no])
778+ ]
779+ )
780+ AC_SUBST([GLIBC2])
781+ GLIBC2="$ac_cv_gnu_library_2"
782+ ]
783+)
784
785=== added file 'm4/glibc21.m4'
786--- m4/glibc21.m4 1970-01-01 00:00:00 +0000
787+++ m4/glibc21.m4 2013-07-06 19:13:27 +0000
788@@ -0,0 +1,30 @@
789+# glibc21.m4 serial 4
790+dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
791+dnl This file is free software; the Free Software Foundation
792+dnl gives unlimited permission to copy and/or distribute it,
793+dnl with or without modifications, as long as this notice is preserved.
794+
795+# Test for the GNU C Library, version 2.1 or newer.
796+# From Bruno Haible.
797+
798+AC_DEFUN([gl_GLIBC21],
799+ [
800+ AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
801+ [ac_cv_gnu_library_2_1],
802+ [AC_EGREP_CPP([Lucky GNU user],
803+ [
804+#include <features.h>
805+#ifdef __GNU_LIBRARY__
806+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
807+ Lucky GNU user
808+ #endif
809+#endif
810+ ],
811+ [ac_cv_gnu_library_2_1=yes],
812+ [ac_cv_gnu_library_2_1=no])
813+ ]
814+ )
815+ AC_SUBST([GLIBC21])
816+ GLIBC21="$ac_cv_gnu_library_2_1"
817+ ]
818+)
819
820=== added file 'm4/intdiv0.m4'
821--- m4/intdiv0.m4 1970-01-01 00:00:00 +0000
822+++ m4/intdiv0.m4 2013-07-06 19:13:27 +0000
823@@ -0,0 +1,84 @@
824+# intdiv0.m4 serial 3 (gettext-0.18)
825+dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc.
826+dnl This file is free software; the Free Software Foundation
827+dnl gives unlimited permission to copy and/or distribute it,
828+dnl with or without modifications, as long as this notice is preserved.
829+
830+dnl From Bruno Haible.
831+
832+AC_DEFUN([gt_INTDIV0],
833+[
834+ AC_REQUIRE([AC_PROG_CC])dnl
835+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
836+
837+ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
838+ gt_cv_int_divbyzero_sigfpe,
839+ [
840+ gt_cv_int_divbyzero_sigfpe=
841+changequote(,)dnl
842+ case "$host_os" in
843+ macos* | darwin[6-9]* | darwin[1-9][0-9]*)
844+ # On MacOS X 10.2 or newer, just assume the same as when cross-
845+ # compiling. If we were to perform the real test, 1 Crash Report
846+ # dialog window would pop up.
847+ case "$host_cpu" in
848+ i[34567]86 | x86_64)
849+ gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
850+ esac
851+ ;;
852+ esac
853+changequote([,])dnl
854+ if test -z "$gt_cv_int_divbyzero_sigfpe"; then
855+ AC_TRY_RUN([
856+#include <stdlib.h>
857+#include <signal.h>
858+
859+static void
860+sigfpe_handler (int sig)
861+{
862+ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
863+ exit (sig != SIGFPE);
864+}
865+
866+int x = 1;
867+int y = 0;
868+int z;
869+int nan;
870+
871+int main ()
872+{
873+ signal (SIGFPE, sigfpe_handler);
874+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
875+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
876+ signal (SIGTRAP, sigfpe_handler);
877+#endif
878+/* Linux/SPARC yields signal SIGILL. */
879+#if defined (__sparc__) && defined (__linux__)
880+ signal (SIGILL, sigfpe_handler);
881+#endif
882+
883+ z = x / y;
884+ nan = y / y;
885+ exit (1);
886+}
887+], [gt_cv_int_divbyzero_sigfpe=yes], [gt_cv_int_divbyzero_sigfpe=no],
888+ [
889+ # Guess based on the CPU.
890+changequote(,)dnl
891+ case "$host_cpu" in
892+ alpha* | i[34567]86 | x86_64 | m68k | s390*)
893+ gt_cv_int_divbyzero_sigfpe="guessing yes";;
894+ *)
895+ gt_cv_int_divbyzero_sigfpe="guessing no";;
896+ esac
897+changequote([,])dnl
898+ ])
899+ fi
900+ ])
901+ case "$gt_cv_int_divbyzero_sigfpe" in
902+ *yes) value=1;;
903+ *) value=0;;
904+ esac
905+ AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
906+ [Define if integer division by zero raises signal SIGFPE.])
907+])
908
909=== added file 'm4/intl.m4'
910--- m4/intl.m4 1970-01-01 00:00:00 +0000
911+++ m4/intl.m4 2013-07-06 19:13:27 +0000
912@@ -0,0 +1,294 @@
913+# intl.m4 serial 17 (gettext-0.18)
914+dnl Copyright (C) 1995-2009 Free Software Foundation, Inc.
915+dnl This file is free software; the Free Software Foundation
916+dnl gives unlimited permission to copy and/or distribute it,
917+dnl with or without modifications, as long as this notice is preserved.
918+dnl
919+dnl This file can can be used in projects which are not available under
920+dnl the GNU General Public License or the GNU Library General Public
921+dnl License but which still want to provide support for the GNU gettext
922+dnl functionality.
923+dnl Please note that the actual code of the GNU gettext library is covered
924+dnl by the GNU Library General Public License, and the rest of the GNU
925+dnl gettext package package is covered by the GNU General Public License.
926+dnl They are *not* in the public domain.
927+
928+dnl Authors:
929+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
930+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
931+
932+AC_PREREQ([2.52])
933+
934+dnl Checks for all prerequisites of the intl subdirectory,
935+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
936+dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
937+AC_DEFUN([AM_INTL_SUBDIR],
938+[
939+ AC_REQUIRE([AC_PROG_INSTALL])dnl
940+ AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
941+ AC_REQUIRE([AC_PROG_CC])dnl
942+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
943+ AC_REQUIRE([gt_GLIBC2])dnl
944+ AC_REQUIRE([AC_PROG_RANLIB])dnl
945+ AC_REQUIRE([gl_VISIBILITY])dnl
946+ AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
947+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
948+ AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
949+ AC_REQUIRE([gt_TYPE_WINT_T])dnl
950+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
951+ AC_REQUIRE([gt_TYPE_INTMAX_T])
952+ AC_REQUIRE([gt_PRINTF_POSIX])
953+ AC_REQUIRE([gl_GLIBC21])dnl
954+ AC_REQUIRE([gl_XSIZE])dnl
955+ AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
956+ AC_REQUIRE([gt_INTL_MACOSX])dnl
957+
958+ dnl Support for automake's --enable-silent-rules.
959+ case "$enable_silent_rules" in
960+ yes) INTL_DEFAULT_VERBOSITY=0;;
961+ no) INTL_DEFAULT_VERBOSITY=1;;
962+ *) INTL_DEFAULT_VERBOSITY=1;;
963+ esac
964+ AC_SUBST([INTL_DEFAULT_VERBOSITY])
965+
966+ AC_CHECK_TYPE([ptrdiff_t], ,
967+ [AC_DEFINE([ptrdiff_t], [long],
968+ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
969+ ])
970+ AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
971+ AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
972+ snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
973+
974+ dnl Use the _snprintf function only if it is declared (because on NetBSD it
975+ dnl is defined as a weak alias of snprintf; we prefer to use the latter).
976+ gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
977+ gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
978+
979+ dnl Use the *_unlocked functions only if they are declared.
980+ dnl (because some of them were defined without being declared in Solaris
981+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
982+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
983+ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
984+ gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
985+
986+ case $gt_cv_func_printf_posix in
987+ *yes) HAVE_POSIX_PRINTF=1 ;;
988+ *) HAVE_POSIX_PRINTF=0 ;;
989+ esac
990+ AC_SUBST([HAVE_POSIX_PRINTF])
991+ if test "$ac_cv_func_asprintf" = yes; then
992+ HAVE_ASPRINTF=1
993+ else
994+ HAVE_ASPRINTF=0
995+ fi
996+ AC_SUBST([HAVE_ASPRINTF])
997+ if test "$ac_cv_func_snprintf" = yes; then
998+ HAVE_SNPRINTF=1
999+ else
1000+ HAVE_SNPRINTF=0
1001+ fi
1002+ AC_SUBST([HAVE_SNPRINTF])
1003+ if test "$ac_cv_func_newlocale" = yes; then
1004+ HAVE_NEWLOCALE=1
1005+ else
1006+ HAVE_NEWLOCALE=0
1007+ fi
1008+ AC_SUBST([HAVE_NEWLOCALE])
1009+ if test "$ac_cv_func_wprintf" = yes; then
1010+ HAVE_WPRINTF=1
1011+ else
1012+ HAVE_WPRINTF=0
1013+ fi
1014+ AC_SUBST([HAVE_WPRINTF])
1015+
1016+ AM_LANGINFO_CODESET
1017+ gt_LC_MESSAGES
1018+
1019+ dnl Compilation on mingw and Cygwin needs special Makefile rules, because
1020+ dnl 1. when we install a shared library, we must arrange to export
1021+ dnl auxiliary pointer variables for every exported variable,
1022+ dnl 2. when we install a shared library and a static library simultaneously,
1023+ dnl the include file specifies __declspec(dllimport) and therefore we
1024+ dnl must arrange to define the auxiliary pointer variables for the
1025+ dnl exported variables _also_ in the static library.
1026+ if test "$enable_shared" = yes; then
1027+ case "$host_os" in
1028+ mingw* | cygwin*) is_woe32dll=yes ;;
1029+ *) is_woe32dll=no ;;
1030+ esac
1031+ else
1032+ is_woe32dll=no
1033+ fi
1034+ WOE32DLL=$is_woe32dll
1035+ AC_SUBST([WOE32DLL])
1036+
1037+ dnl On mingw and Cygwin, we can activate special Makefile rules which add
1038+ dnl version information to the shared libraries and executables.
1039+ case "$host_os" in
1040+ mingw* | cygwin*) is_woe32=yes ;;
1041+ *) is_woe32=no ;;
1042+ esac
1043+ WOE32=$is_woe32
1044+ AC_SUBST([WOE32])
1045+ if test $WOE32 = yes; then
1046+ dnl Check for a program that compiles Windows resource files.
1047+ AC_CHECK_TOOL([WINDRES], [windres])
1048+ fi
1049+
1050+ dnl Determine whether when creating a library, "-lc" should be passed to
1051+ dnl libtool or not. On many platforms, it is required for the libtool option
1052+ dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
1053+ dnl in the *.la files - makes it impossible to create multithreaded programs,
1054+ dnl because libtool also reorders the -lc to come before the -pthread, and
1055+ dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
1056+ case "$host_os" in
1057+ hpux*) LTLIBC="" ;;
1058+ *) LTLIBC="-lc" ;;
1059+ esac
1060+ AC_SUBST([LTLIBC])
1061+
1062+ dnl Rename some macros and functions used for locking.
1063+ AH_BOTTOM([
1064+#define __libc_lock_t gl_lock_t
1065+#define __libc_lock_define gl_lock_define
1066+#define __libc_lock_define_initialized gl_lock_define_initialized
1067+#define __libc_lock_init gl_lock_init
1068+#define __libc_lock_lock gl_lock_lock
1069+#define __libc_lock_unlock gl_lock_unlock
1070+#define __libc_lock_recursive_t gl_recursive_lock_t
1071+#define __libc_lock_define_recursive gl_recursive_lock_define
1072+#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
1073+#define __libc_lock_init_recursive gl_recursive_lock_init
1074+#define __libc_lock_lock_recursive gl_recursive_lock_lock
1075+#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
1076+#define glthread_in_use libintl_thread_in_use
1077+#define glthread_lock_init_func libintl_lock_init_func
1078+#define glthread_lock_lock_func libintl_lock_lock_func
1079+#define glthread_lock_unlock_func libintl_lock_unlock_func
1080+#define glthread_lock_destroy_func libintl_lock_destroy_func
1081+#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
1082+#define glthread_rwlock_init_func libintl_rwlock_init_func
1083+#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
1084+#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
1085+#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
1086+#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
1087+#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
1088+#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
1089+#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
1090+#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
1091+#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
1092+#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
1093+#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
1094+#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
1095+#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
1096+#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
1097+#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
1098+#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
1099+#define glthread_once_func libintl_once_func
1100+#define glthread_once_singlethreaded libintl_once_singlethreaded
1101+#define glthread_once_multithreaded libintl_once_multithreaded
1102+])
1103+])
1104+
1105+
1106+dnl Checks for the core files of the intl subdirectory:
1107+dnl dcigettext.c
1108+dnl eval-plural.h
1109+dnl explodename.c
1110+dnl finddomain.c
1111+dnl gettextP.h
1112+dnl gmo.h
1113+dnl hash-string.h hash-string.c
1114+dnl l10nflist.c
1115+dnl libgnuintl.h.in (except the *printf stuff)
1116+dnl loadinfo.h
1117+dnl loadmsgcat.c
1118+dnl localealias.c
1119+dnl log.c
1120+dnl plural-exp.h plural-exp.c
1121+dnl plural.y
1122+dnl Used by libglocale.
1123+AC_DEFUN([gt_INTL_SUBDIR_CORE],
1124+[
1125+ AC_REQUIRE([AC_C_INLINE])dnl
1126+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1127+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1128+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1129+ AC_REQUIRE([AC_FUNC_MMAP])dnl
1130+ AC_REQUIRE([gt_INTDIV0])dnl
1131+ AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
1132+ AC_REQUIRE([gt_INTTYPES_PRI])dnl
1133+ AC_REQUIRE([gl_LOCK])dnl
1134+
1135+ AC_TRY_LINK(
1136+ [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
1137+ [],
1138+ [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
1139+ [Define to 1 if the compiler understands __builtin_expect.])])
1140+
1141+ AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
1142+ AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
1143+ stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
1144+ argz_stringify argz_next __fsetlocking])
1145+
1146+ dnl Use the *_unlocked functions only if they are declared.
1147+ dnl (because some of them were defined without being declared in Solaris
1148+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1149+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
1150+ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
1151+ gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
1152+ gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
1153+
1154+ AM_ICONV
1155+
1156+ dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1157+ dnl because plural.y uses bison specific features. It requires at least
1158+ dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1159+ dnl compile.
1160+ dnl bison is only needed for the maintainer (who touches plural.y). But in
1161+ dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1162+ dnl the rule in general Makefile. Now, some people carelessly touch the
1163+ dnl files or have a broken "make" program, hence the plural.c rule will
1164+ dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1165+ dnl present or too old.
1166+ AC_CHECK_PROGS([INTLBISON], [bison])
1167+ if test -z "$INTLBISON"; then
1168+ ac_verc_fail=yes
1169+ else
1170+ dnl Found it, now check the version.
1171+ AC_MSG_CHECKING([version of bison])
1172+changequote(<<,>>)dnl
1173+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1174+ case $ac_prog_version in
1175+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1176+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1177+changequote([,])dnl
1178+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1179+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1180+ esac
1181+ AC_MSG_RESULT([$ac_prog_version])
1182+ fi
1183+ if test $ac_verc_fail = yes; then
1184+ INTLBISON=:
1185+ fi
1186+])
1187+
1188+
1189+dnl gt_CHECK_DECL(FUNC, INCLUDES)
1190+dnl Check whether a function is declared.
1191+AC_DEFUN([gt_CHECK_DECL],
1192+[
1193+ AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
1194+ [AC_TRY_COMPILE([$2], [
1195+#ifndef $1
1196+ char *p = (char *) $1;
1197+#endif
1198+], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
1199+ if test $ac_cv_have_decl_$1 = yes; then
1200+ gt_value=1
1201+ else
1202+ gt_value=0
1203+ fi
1204+ AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
1205+ [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
1206+])
1207
1208=== added file 'm4/intldir.m4'
1209--- m4/intldir.m4 1970-01-01 00:00:00 +0000
1210+++ m4/intldir.m4 2013-07-06 19:13:27 +0000
1211@@ -0,0 +1,19 @@
1212+# intldir.m4 serial 2 (gettext-0.18)
1213+dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
1214+dnl This file is free software; the Free Software Foundation
1215+dnl gives unlimited permission to copy and/or distribute it,
1216+dnl with or without modifications, as long as this notice is preserved.
1217+dnl
1218+dnl This file can can be used in projects which are not available under
1219+dnl the GNU General Public License or the GNU Library General Public
1220+dnl License but which still want to provide support for the GNU gettext
1221+dnl functionality.
1222+dnl Please note that the actual code of the GNU gettext library is covered
1223+dnl by the GNU Library General Public License, and the rest of the GNU
1224+dnl gettext package package is covered by the GNU General Public License.
1225+dnl They are *not* in the public domain.
1226+
1227+AC_PREREQ([2.52])
1228+
1229+dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
1230+AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
1231
1232=== added file 'm4/intlmacosx.m4'
1233--- m4/intlmacosx.m4 1970-01-01 00:00:00 +0000
1234+++ m4/intlmacosx.m4 2013-07-06 19:13:27 +0000
1235@@ -0,0 +1,51 @@
1236+# intlmacosx.m4 serial 3 (gettext-0.18)
1237+dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
1238+dnl This file is free software; the Free Software Foundation
1239+dnl gives unlimited permission to copy and/or distribute it,
1240+dnl with or without modifications, as long as this notice is preserved.
1241+dnl
1242+dnl This file can can be used in projects which are not available under
1243+dnl the GNU General Public License or the GNU Library General Public
1244+dnl License but which still want to provide support for the GNU gettext
1245+dnl functionality.
1246+dnl Please note that the actual code of the GNU gettext library is covered
1247+dnl by the GNU Library General Public License, and the rest of the GNU
1248+dnl gettext package package is covered by the GNU General Public License.
1249+dnl They are *not* in the public domain.
1250+
1251+dnl Checks for special options needed on MacOS X.
1252+dnl Defines INTL_MACOSX_LIBS.
1253+AC_DEFUN([gt_INTL_MACOSX],
1254+[
1255+ dnl Check for API introduced in MacOS X 10.2.
1256+ AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1257+ [gt_cv_func_CFPreferencesCopyAppValue],
1258+ [gt_save_LIBS="$LIBS"
1259+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1260+ AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
1261+ [CFPreferencesCopyAppValue(NULL, NULL)],
1262+ [gt_cv_func_CFPreferencesCopyAppValue=yes],
1263+ [gt_cv_func_CFPreferencesCopyAppValue=no])
1264+ LIBS="$gt_save_LIBS"])
1265+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1266+ AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
1267+ [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1268+ fi
1269+ dnl Check for API introduced in MacOS X 10.3.
1270+ AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
1271+ [gt_save_LIBS="$LIBS"
1272+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1273+ AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
1274+ [gt_cv_func_CFLocaleCopyCurrent=yes],
1275+ [gt_cv_func_CFLocaleCopyCurrent=no])
1276+ LIBS="$gt_save_LIBS"])
1277+ if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1278+ AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
1279+ [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
1280+ fi
1281+ INTL_MACOSX_LIBS=
1282+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1283+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1284+ fi
1285+ AC_SUBST([INTL_MACOSX_LIBS])
1286+])
1287
1288=== added file 'm4/intmax.m4'
1289--- m4/intmax.m4 1970-01-01 00:00:00 +0000
1290+++ m4/intmax.m4 2013-07-06 19:13:27 +0000
1291@@ -0,0 +1,33 @@
1292+# intmax.m4 serial 5 (gettext-0.18)
1293+dnl Copyright (C) 2002-2005, 2008-2010 Free Software Foundation, Inc.
1294+dnl This file is free software; the Free Software Foundation
1295+dnl gives unlimited permission to copy and/or distribute it,
1296+dnl with or without modifications, as long as this notice is preserved.
1297+
1298+dnl From Bruno Haible.
1299+dnl Test whether the system has the 'intmax_t' type, but don't attempt to
1300+dnl find a replacement if it is lacking.
1301+
1302+AC_DEFUN([gt_TYPE_INTMAX_T],
1303+[
1304+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1305+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1306+ AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
1307+ [AC_TRY_COMPILE([
1308+#include <stddef.h>
1309+#include <stdlib.h>
1310+#if HAVE_STDINT_H_WITH_UINTMAX
1311+#include <stdint.h>
1312+#endif
1313+#if HAVE_INTTYPES_H_WITH_UINTMAX
1314+#include <inttypes.h>
1315+#endif
1316+], [intmax_t x = -1;
1317+ return !x;],
1318+ [gt_cv_c_intmax_t=yes],
1319+ [gt_cv_c_intmax_t=no])])
1320+ if test $gt_cv_c_intmax_t = yes; then
1321+ AC_DEFINE([HAVE_INTMAX_T], [1],
1322+ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
1323+ fi
1324+])
1325
1326=== added file 'm4/inttypes-pri.m4'
1327--- m4/inttypes-pri.m4 1970-01-01 00:00:00 +0000
1328+++ m4/inttypes-pri.m4 2013-07-06 19:13:27 +0000
1329@@ -0,0 +1,36 @@
1330+# inttypes-pri.m4 serial 6 (gettext-0.18)
1331+dnl Copyright (C) 1997-2002, 2006, 2008-2010 Free Software Foundation, Inc.
1332+dnl This file is free software; the Free Software Foundation
1333+dnl gives unlimited permission to copy and/or distribute it,
1334+dnl with or without modifications, as long as this notice is preserved.
1335+
1336+dnl From Bruno Haible.
1337+
1338+AC_PREREQ([2.52])
1339+
1340+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
1341+# macros to non-string values. This is the case on AIX 4.3.3.
1342+
1343+AC_DEFUN([gt_INTTYPES_PRI],
1344+[
1345+ AC_CHECK_HEADERS([inttypes.h])
1346+ if test $ac_cv_header_inttypes_h = yes; then
1347+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
1348+ [gt_cv_inttypes_pri_broken],
1349+ [
1350+ AC_TRY_COMPILE([#include <inttypes.h>
1351+#ifdef PRId32
1352+char *p = PRId32;
1353+#endif
1354+], [], [gt_cv_inttypes_pri_broken=no], [gt_cv_inttypes_pri_broken=yes])
1355+ ])
1356+ fi
1357+ if test "$gt_cv_inttypes_pri_broken" = yes; then
1358+ AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
1359+ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
1360+ PRI_MACROS_BROKEN=1
1361+ else
1362+ PRI_MACROS_BROKEN=0
1363+ fi
1364+ AC_SUBST([PRI_MACROS_BROKEN])
1365+])
1366
1367=== added file 'm4/inttypes_h.m4'
1368--- m4/inttypes_h.m4 1970-01-01 00:00:00 +0000
1369+++ m4/inttypes_h.m4 2013-07-06 19:13:27 +0000
1370@@ -0,0 +1,26 @@
1371+# inttypes_h.m4 serial 9
1372+dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
1373+dnl This file is free software; the Free Software Foundation
1374+dnl gives unlimited permission to copy and/or distribute it,
1375+dnl with or without modifications, as long as this notice is preserved.
1376+
1377+dnl From Paul Eggert.
1378+
1379+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1380+# doesn't clash with <sys/types.h>, and declares uintmax_t.
1381+
1382+AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
1383+[
1384+ AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
1385+ [AC_TRY_COMPILE(
1386+ [#include <sys/types.h>
1387+#include <inttypes.h>],
1388+ [uintmax_t i = (uintmax_t) -1; return !i;],
1389+ [gl_cv_header_inttypes_h=yes],
1390+ [gl_cv_header_inttypes_h=no])])
1391+ if test $gl_cv_header_inttypes_h = yes; then
1392+ AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
1393+ [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1394+ and declares uintmax_t. ])
1395+ fi
1396+])
1397
1398=== added file 'm4/lcmessage.m4'
1399--- m4/lcmessage.m4 1970-01-01 00:00:00 +0000
1400+++ m4/lcmessage.m4 2013-07-06 19:13:27 +0000
1401@@ -0,0 +1,31 @@
1402+# lcmessage.m4 serial 6 (gettext-0.18)
1403+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2010 Free Software Foundation,
1404+dnl Inc.
1405+dnl This file is free software; the Free Software Foundation
1406+dnl gives unlimited permission to copy and/or distribute it,
1407+dnl with or without modifications, as long as this notice is preserved.
1408+dnl
1409+dnl This file can can be used in projects which are not available under
1410+dnl the GNU General Public License or the GNU Library General Public
1411+dnl License but which still want to provide support for the GNU gettext
1412+dnl functionality.
1413+dnl Please note that the actual code of the GNU gettext library is covered
1414+dnl by the GNU Library General Public License, and the rest of the GNU
1415+dnl gettext package package is covered by the GNU General Public License.
1416+dnl They are *not* in the public domain.
1417+
1418+dnl Authors:
1419+dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
1420+
1421+# Check whether LC_MESSAGES is available in <locale.h>.
1422+
1423+AC_DEFUN([gt_LC_MESSAGES],
1424+[
1425+ AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
1426+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1427+ [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])])
1428+ if test $gt_cv_val_LC_MESSAGES = yes; then
1429+ AC_DEFINE([HAVE_LC_MESSAGES], [1],
1430+ [Define if your <locale.h> file defines LC_MESSAGES.])
1431+ fi
1432+])
1433
1434=== added file 'm4/lock.m4'
1435--- m4/lock.m4 1970-01-01 00:00:00 +0000
1436+++ m4/lock.m4 2013-07-06 19:13:27 +0000
1437@@ -0,0 +1,37 @@
1438+# lock.m4 serial 10 (gettext-0.18)
1439+dnl Copyright (C) 2005-2010 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.
1443+
1444+dnl From Bruno Haible.
1445+
1446+AC_DEFUN([gl_LOCK],
1447+[
1448+ AC_REQUIRE([gl_THREADLIB])
1449+ if test "$gl_threads_api" = posix; then
1450+ # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
1451+ # pthread_rwlock_* functions.
1452+ AC_CHECK_TYPE([pthread_rwlock_t],
1453+ [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
1454+ [Define if the POSIX multithreading library has read/write locks.])],
1455+ [],
1456+ [#include <pthread.h>])
1457+ # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
1458+ AC_TRY_COMPILE([#include <pthread.h>],
1459+ [#if __FreeBSD__ == 4
1460+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
1461+#else
1462+int x = (int)PTHREAD_MUTEX_RECURSIVE;
1463+return !x;
1464+#endif],
1465+ [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
1466+ [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
1467+ fi
1468+ gl_PREREQ_LOCK
1469+])
1470+
1471+# Prerequisites of lib/lock.c.
1472+AC_DEFUN([gl_PREREQ_LOCK], [
1473+ AC_REQUIRE([AC_C_INLINE])
1474+])
1475
1476=== added file 'm4/longlong.m4'
1477--- m4/longlong.m4 1970-01-01 00:00:00 +0000
1478+++ m4/longlong.m4 2013-07-06 19:13:27 +0000
1479@@ -0,0 +1,106 @@
1480+# longlong.m4 serial 14
1481+dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
1482+dnl This file is free software; the Free Software Foundation
1483+dnl gives unlimited permission to copy and/or distribute it,
1484+dnl with or without modifications, as long as this notice is preserved.
1485+
1486+dnl From Paul Eggert.
1487+
1488+# Define HAVE_LONG_LONG_INT if 'long long int' works.
1489+# This fixes a bug in Autoconf 2.61, but can be removed once we
1490+# assume 2.62 everywhere.
1491+
1492+# Note: If the type 'long long int' exists but is only 32 bits large
1493+# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
1494+# defined. In this case you can treat 'long long int' like 'long int'.
1495+
1496+AC_DEFUN([AC_TYPE_LONG_LONG_INT],
1497+[
1498+ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
1499+ [AC_LINK_IFELSE(
1500+ [_AC_TYPE_LONG_LONG_SNIPPET],
1501+ [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
1502+ dnl If cross compiling, assume the bug isn't important, since
1503+ dnl nobody cross compiles for this platform as far as we know.
1504+ AC_RUN_IFELSE(
1505+ [AC_LANG_PROGRAM(
1506+ [[@%:@include <limits.h>
1507+ @%:@ifndef LLONG_MAX
1508+ @%:@ define HALF \
1509+ (1LL << (sizeof (long long int) * CHAR_BIT - 2))
1510+ @%:@ define LLONG_MAX (HALF - 1 + HALF)
1511+ @%:@endif]],
1512+ [[long long int n = 1;
1513+ int i;
1514+ for (i = 0; ; i++)
1515+ {
1516+ long long int m = n << i;
1517+ if (m >> i != n)
1518+ return 1;
1519+ if (LLONG_MAX / 2 < m)
1520+ break;
1521+ }
1522+ return 0;]])],
1523+ [ac_cv_type_long_long_int=yes],
1524+ [ac_cv_type_long_long_int=no],
1525+ [ac_cv_type_long_long_int=yes])],
1526+ [ac_cv_type_long_long_int=no])])
1527+ if test $ac_cv_type_long_long_int = yes; then
1528+ AC_DEFINE([HAVE_LONG_LONG_INT], [1],
1529+ [Define to 1 if the system has the type `long long int'.])
1530+ fi
1531+])
1532+
1533+# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
1534+# This fixes a bug in Autoconf 2.61, but can be removed once we
1535+# assume 2.62 everywhere.
1536+
1537+# Note: If the type 'unsigned long long int' exists but is only 32 bits
1538+# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
1539+# will not be defined. In this case you can treat 'unsigned long long int'
1540+# like 'unsigned long int'.
1541+
1542+AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
1543+[
1544+ AC_CACHE_CHECK([for unsigned long long int],
1545+ [ac_cv_type_unsigned_long_long_int],
1546+ [AC_LINK_IFELSE(
1547+ [_AC_TYPE_LONG_LONG_SNIPPET],
1548+ [ac_cv_type_unsigned_long_long_int=yes],
1549+ [ac_cv_type_unsigned_long_long_int=no])])
1550+ if test $ac_cv_type_unsigned_long_long_int = yes; then
1551+ AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
1552+ [Define to 1 if the system has the type `unsigned long long int'.])
1553+ fi
1554+])
1555+
1556+# Expands to a C program that can be used to test for simultaneous support
1557+# of 'long long' and 'unsigned long long'. We don't want to say that
1558+# 'long long' is available if 'unsigned long long' is not, or vice versa,
1559+# because too many programs rely on the symmetry between signed and unsigned
1560+# integer types (excluding 'bool').
1561+AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
1562+[
1563+ AC_LANG_PROGRAM(
1564+ [[/* For now, do not test the preprocessor; as of 2007 there are too many
1565+ implementations with broken preprocessors. Perhaps this can
1566+ be revisited in 2012. In the meantime, code should not expect
1567+ #if to work with literals wider than 32 bits. */
1568+ /* Test literals. */
1569+ long long int ll = 9223372036854775807ll;
1570+ long long int nll = -9223372036854775807LL;
1571+ unsigned long long int ull = 18446744073709551615ULL;
1572+ /* Test constant expressions. */
1573+ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
1574+ ? 1 : -1)];
1575+ typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
1576+ ? 1 : -1)];
1577+ int i = 63;]],
1578+ [[/* Test availability of runtime routines for shift and division. */
1579+ long long int llmax = 9223372036854775807ll;
1580+ unsigned long long int ullmax = 18446744073709551615ull;
1581+ return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
1582+ | (llmax / ll) | (llmax % ll)
1583+ | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
1584+ | (ullmax / ull) | (ullmax % ull));]])
1585+])
1586
1587=== added file 'm4/printf-posix.m4'
1588--- m4/printf-posix.m4 1970-01-01 00:00:00 +0000
1589+++ m4/printf-posix.m4 2013-07-06 19:13:27 +0000
1590@@ -0,0 +1,45 @@
1591+# printf-posix.m4 serial 5 (gettext-0.18)
1592+dnl Copyright (C) 2003, 2007, 2009-2010 Free Software Foundation, Inc.
1593+dnl This file is free software; the Free Software Foundation
1594+dnl gives unlimited permission to copy and/or distribute it,
1595+dnl with or without modifications, as long as this notice is preserved.
1596+
1597+dnl From Bruno Haible.
1598+dnl Test whether the printf() function supports POSIX/XSI format strings with
1599+dnl positions.
1600+
1601+AC_DEFUN([gt_PRINTF_POSIX],
1602+[
1603+ AC_REQUIRE([AC_PROG_CC])
1604+ AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
1605+ gt_cv_func_printf_posix,
1606+ [
1607+ AC_TRY_RUN([
1608+#include <stdio.h>
1609+#include <string.h>
1610+/* The string "%2$d %1$d", with dollar characters protected from the shell's
1611+ dollar expansion (possibly an autoconf bug). */
1612+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
1613+static char buf[100];
1614+int main ()
1615+{
1616+ sprintf (buf, format, 33, 55);
1617+ return (strcmp (buf, "55 33") != 0);
1618+}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
1619+ [
1620+ AC_EGREP_CPP([notposix], [
1621+#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
1622+ notposix
1623+#endif
1624+ ],
1625+ [gt_cv_func_printf_posix="guessing no"],
1626+ [gt_cv_func_printf_posix="guessing yes"])
1627+ ])
1628+ ])
1629+ case $gt_cv_func_printf_posix in
1630+ *yes)
1631+ AC_DEFINE([HAVE_POSIX_PRINTF], [1],
1632+ [Define if your printf() function supports format strings with positions.])
1633+ ;;
1634+ esac
1635+])
1636
1637=== added file 'm4/size_max.m4'
1638--- m4/size_max.m4 1970-01-01 00:00:00 +0000
1639+++ m4/size_max.m4 2013-07-06 19:13:27 +0000
1640@@ -0,0 +1,75 @@
1641+# size_max.m4 serial 9
1642+dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
1643+dnl This file is free software; the Free Software Foundation
1644+dnl gives unlimited permission to copy and/or distribute it,
1645+dnl with or without modifications, as long as this notice is preserved.
1646+
1647+dnl From Bruno Haible.
1648+
1649+AC_DEFUN([gl_SIZE_MAX],
1650+[
1651+ AC_CHECK_HEADERS([stdint.h])
1652+ dnl First test whether the system already has SIZE_MAX.
1653+ AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
1654+ gl_cv_size_max=
1655+ AC_EGREP_CPP([Found it], [
1656+#include <limits.h>
1657+#if HAVE_STDINT_H
1658+#include <stdint.h>
1659+#endif
1660+#ifdef SIZE_MAX
1661+Found it
1662+#endif
1663+], [gl_cv_size_max=yes])
1664+ if test -z "$gl_cv_size_max"; then
1665+ dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
1666+ dnl than the type 'unsigned long'. Try hard to find a definition that can
1667+ dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
1668+ AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
1669+ [#include <stddef.h>
1670+#include <limits.h>], [size_t_bits_minus_1=])
1671+ AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
1672+ [#include <stddef.h>], [fits_in_uint=])
1673+ if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
1674+ if test $fits_in_uint = 1; then
1675+ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
1676+ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
1677+ AC_TRY_COMPILE([#include <stddef.h>
1678+ extern size_t foo;
1679+ extern unsigned long foo;
1680+ ], [], [fits_in_uint=0])
1681+ fi
1682+ dnl We cannot use 'expr' to simplify this expression, because 'expr'
1683+ dnl works only with 'long' integers in the host environment, while we
1684+ dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
1685+ if test $fits_in_uint = 1; then
1686+ gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
1687+ else
1688+ gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
1689+ fi
1690+ else
1691+ dnl Shouldn't happen, but who knows...
1692+ gl_cv_size_max='((size_t)~(size_t)0)'
1693+ fi
1694+ fi
1695+ ])
1696+ if test "$gl_cv_size_max" != yes; then
1697+ AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
1698+ [Define as the maximum value of type 'size_t', if the system doesn't define it.])
1699+ fi
1700+ dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
1701+ dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
1702+ dnl #define by AC_DEFINE_UNQUOTED.
1703+ AH_VERBATIM([SIZE_MAX],
1704+[/* Define as the maximum value of type 'size_t', if the system doesn't define
1705+ it. */
1706+#ifndef SIZE_MAX
1707+# undef SIZE_MAX
1708+#endif])
1709+])
1710+
1711+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
1712+dnl Remove this when we can assume autoconf >= 2.61.
1713+m4_ifdef([AC_COMPUTE_INT], [], [
1714+ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
1715+])
1716
1717=== added file 'm4/stdint_h.m4'
1718--- m4/stdint_h.m4 1970-01-01 00:00:00 +0000
1719+++ m4/stdint_h.m4 2013-07-06 19:13:27 +0000
1720@@ -0,0 +1,26 @@
1721+# stdint_h.m4 serial 8
1722+dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
1723+dnl This file is free software; the Free Software Foundation
1724+dnl gives unlimited permission to copy and/or distribute it,
1725+dnl with or without modifications, as long as this notice is preserved.
1726+
1727+dnl From Paul Eggert.
1728+
1729+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
1730+# doesn't clash with <sys/types.h>, and declares uintmax_t.
1731+
1732+AC_DEFUN([gl_AC_HEADER_STDINT_H],
1733+[
1734+ AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
1735+ [AC_TRY_COMPILE(
1736+ [#include <sys/types.h>
1737+#include <stdint.h>],
1738+ [uintmax_t i = (uintmax_t) -1; return !i;],
1739+ [gl_cv_header_stdint_h=yes],
1740+ [gl_cv_header_stdint_h=no])])
1741+ if test $gl_cv_header_stdint_h = yes; then
1742+ AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
1743+ [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
1744+ and declares uintmax_t. ])
1745+ fi
1746+])
1747
1748=== added file 'm4/threadlib.m4'
1749--- m4/threadlib.m4 1970-01-01 00:00:00 +0000
1750+++ m4/threadlib.m4 2013-07-06 19:13:27 +0000
1751@@ -0,0 +1,347 @@
1752+# threadlib.m4 serial 5 (gettext-0.18)
1753+dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
1754+dnl This file is free software; the Free Software Foundation
1755+dnl gives unlimited permission to copy and/or distribute it,
1756+dnl with or without modifications, as long as this notice is preserved.
1757+
1758+dnl From Bruno Haible.
1759+
1760+dnl gl_THREADLIB
1761+dnl ------------
1762+dnl Tests for a multithreading library to be used.
1763+dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
1764+dnl USE_PTH_THREADS, USE_WIN32_THREADS
1765+dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
1766+dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
1767+dnl libtool).
1768+dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
1769+dnl programs that really need multithread functionality. The difference
1770+dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
1771+dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
1772+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
1773+dnl multithread-safe programs.
1774+
1775+AC_DEFUN([gl_THREADLIB_EARLY],
1776+[
1777+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
1778+])
1779+
1780+dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
1781+
1782+AC_DEFUN([gl_THREADLIB_EARLY_BODY],
1783+[
1784+ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
1785+ dnl influences the result of the autoconf tests that test for *_unlocked
1786+ dnl declarations, on AIX 5 at least. Therefore it must come early.
1787+ AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
1788+ AC_BEFORE([$0], [gl_ARGP])dnl
1789+
1790+ AC_REQUIRE([AC_CANONICAL_HOST])
1791+ dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
1792+ dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
1793+ dnl AC_GNU_SOURCE.
1794+ m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
1795+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
1796+ [AC_REQUIRE([AC_GNU_SOURCE])])
1797+ dnl Check for multithreading.
1798+ m4_divert_text([DEFAULTS], [gl_use_threads_default=])
1799+ AC_ARG_ENABLE([threads],
1800+AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
1801+AC_HELP_STRING([--disable-threads], [build without multithread safety]),
1802+ [gl_use_threads=$enableval],
1803+ [if test -n "$gl_use_threads_default"; then
1804+ gl_use_threads="$gl_use_threads_default"
1805+ else
1806+changequote(,)dnl
1807+ case "$host_os" in
1808+ dnl Disable multithreading by default on OSF/1, because it interferes
1809+ dnl with fork()/exec(): When msgexec is linked with -lpthread, its
1810+ dnl child process gets an endless segmentation fault inside execvp().
1811+ dnl Disable multithreading by default on Cygwin 1.5.x, because it has
1812+ dnl bugs that lead to endless loops or crashes. See
1813+ dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
1814+ osf*) gl_use_threads=no ;;
1815+ cygwin*)
1816+ case `uname -r` in
1817+ 1.[0-5].*) gl_use_threads=no ;;
1818+ *) gl_use_threads=yes ;;
1819+ esac
1820+ ;;
1821+ *) gl_use_threads=yes ;;
1822+ esac
1823+changequote([,])dnl
1824+ fi
1825+ ])
1826+ if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
1827+ # For using <pthread.h>:
1828+ case "$host_os" in
1829+ osf*)
1830+ # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
1831+ # groks <pthread.h>. cc also understands the flag -pthread, but
1832+ # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
1833+ # 2. putting a flag into CPPFLAGS that has an effect on the linker
1834+ # causes the AC_TRY_LINK test below to succeed unexpectedly,
1835+ # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
1836+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
1837+ ;;
1838+ esac
1839+ # Some systems optimize for single-threaded programs by default, and
1840+ # need special flags to disable these optimizations. For example, the
1841+ # definition of 'errno' in <errno.h>.
1842+ case "$host_os" in
1843+ aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
1844+ solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
1845+ esac
1846+ fi
1847+])
1848+
1849+dnl The guts of gl_THREADLIB. Needs to be expanded only once.
1850+
1851+AC_DEFUN([gl_THREADLIB_BODY],
1852+[
1853+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
1854+ gl_threads_api=none
1855+ LIBTHREAD=
1856+ LTLIBTHREAD=
1857+ LIBMULTITHREAD=
1858+ LTLIBMULTITHREAD=
1859+ if test "$gl_use_threads" != no; then
1860+ dnl Check whether the compiler and linker support weak declarations.
1861+ AC_CACHE_CHECK([whether imported symbols can be declared weak],
1862+ [gl_cv_have_weak],
1863+ [gl_cv_have_weak=no
1864+ dnl First, test whether the compiler accepts it syntactically.
1865+ AC_TRY_LINK([extern void xyzzy ();
1866+#pragma weak xyzzy], [xyzzy();], [gl_cv_have_weak=maybe])
1867+ if test $gl_cv_have_weak = maybe; then
1868+ dnl Second, test whether it actually works. On Cygwin 1.7.2, with
1869+ dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
1870+ AC_TRY_RUN([
1871+#include <stdio.h>
1872+#pragma weak fputs
1873+int main ()
1874+{
1875+ return (fputs == NULL);
1876+}], [gl_cv_have_weak=yes], [gl_cv_have_weak=no],
1877+ [dnl When cross-compiling, assume that only ELF platforms support
1878+ dnl weak symbols.
1879+ AC_EGREP_CPP([Extensible Linking Format],
1880+ [#ifdef __ELF__
1881+ Extensible Linking Format
1882+ #endif
1883+ ],
1884+ [gl_cv_have_weak="guessing yes"],
1885+ [gl_cv_have_weak="guessing no"])
1886+ ])
1887+ fi
1888+ ])
1889+ if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
1890+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
1891+ # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
1892+ AC_CHECK_HEADER([pthread.h],
1893+ [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
1894+ if test "$gl_have_pthread_h" = yes; then
1895+ # Other possible tests:
1896+ # -lpthreads (FSU threads, PCthreads)
1897+ # -lgthreads
1898+ gl_have_pthread=
1899+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
1900+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
1901+ # the second one only in libpthread, and lock.c needs it.
1902+ AC_TRY_LINK([#include <pthread.h>],
1903+ [pthread_mutex_lock((pthread_mutex_t*)0);
1904+ pthread_mutexattr_init((pthread_mutexattr_t*)0);],
1905+ [gl_have_pthread=yes])
1906+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
1907+ # since it is defined as a macro on OSF/1.)
1908+ if test -n "$gl_have_pthread"; then
1909+ # The program links fine without libpthread. But it may actually
1910+ # need to link with libpthread in order to create multiple threads.
1911+ AC_CHECK_LIB([pthread], [pthread_kill],
1912+ [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
1913+ # On Solaris and HP-UX, most pthread functions exist also in libc.
1914+ # Therefore pthread_in_use() needs to actually try to create a
1915+ # thread: pthread_create from libc will fail, whereas
1916+ # pthread_create will actually create a thread.
1917+ case "$host_os" in
1918+ solaris* | hpux*)
1919+ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
1920+ [Define if the pthread_in_use() detection is hard.])
1921+ esac
1922+ ])
1923+ else
1924+ # Some library is needed. Try libpthread and libc_r.
1925+ AC_CHECK_LIB([pthread], [pthread_kill],
1926+ [gl_have_pthread=yes
1927+ LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
1928+ LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
1929+ if test -z "$gl_have_pthread"; then
1930+ # For FreeBSD 4.
1931+ AC_CHECK_LIB([c_r], [pthread_kill],
1932+ [gl_have_pthread=yes
1933+ LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
1934+ LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
1935+ fi
1936+ fi
1937+ if test -n "$gl_have_pthread"; then
1938+ gl_threads_api=posix
1939+ AC_DEFINE([USE_POSIX_THREADS], [1],
1940+ [Define if the POSIX multithreading library can be used.])
1941+ if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
1942+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
1943+ AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
1944+ [Define if references to the POSIX multithreading library should be made weak.])
1945+ LIBTHREAD=
1946+ LTLIBTHREAD=
1947+ fi
1948+ fi
1949+ fi
1950+ fi
1951+ fi
1952+ if test -z "$gl_have_pthread"; then
1953+ if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
1954+ gl_have_solaristhread=
1955+ gl_save_LIBS="$LIBS"
1956+ LIBS="$LIBS -lthread"
1957+ AC_TRY_LINK([#include <thread.h>
1958+#include <synch.h>],
1959+ [thr_self();],
1960+ [gl_have_solaristhread=yes])
1961+ LIBS="$gl_save_LIBS"
1962+ if test -n "$gl_have_solaristhread"; then
1963+ gl_threads_api=solaris
1964+ LIBTHREAD=-lthread
1965+ LTLIBTHREAD=-lthread
1966+ LIBMULTITHREAD="$LIBTHREAD"
1967+ LTLIBMULTITHREAD="$LTLIBTHREAD"
1968+ AC_DEFINE([USE_SOLARIS_THREADS], [1],
1969+ [Define if the old Solaris multithreading library can be used.])
1970+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
1971+ AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
1972+ [Define if references to the old Solaris multithreading library should be made weak.])
1973+ LIBTHREAD=
1974+ LTLIBTHREAD=
1975+ fi
1976+ fi
1977+ fi
1978+ fi
1979+ if test "$gl_use_threads" = pth; then
1980+ gl_save_CPPFLAGS="$CPPFLAGS"
1981+ AC_LIB_LINKFLAGS([pth])
1982+ gl_have_pth=
1983+ gl_save_LIBS="$LIBS"
1984+ LIBS="$LIBS -lpth"
1985+ AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes])
1986+ LIBS="$gl_save_LIBS"
1987+ if test -n "$gl_have_pth"; then
1988+ gl_threads_api=pth
1989+ LIBTHREAD="$LIBPTH"
1990+ LTLIBTHREAD="$LTLIBPTH"
1991+ LIBMULTITHREAD="$LIBTHREAD"
1992+ LTLIBMULTITHREAD="$LTLIBTHREAD"
1993+ AC_DEFINE([USE_PTH_THREADS], [1],
1994+ [Define if the GNU Pth multithreading library can be used.])
1995+ if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
1996+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
1997+ AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
1998+ [Define if references to the GNU Pth multithreading library should be made weak.])
1999+ LIBTHREAD=
2000+ LTLIBTHREAD=
2001+ fi
2002+ fi
2003+ else
2004+ CPPFLAGS="$gl_save_CPPFLAGS"
2005+ fi
2006+ fi
2007+ if test -z "$gl_have_pthread"; then
2008+ if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
2009+ if { case "$host_os" in
2010+ mingw*) true;;
2011+ *) false;;
2012+ esac
2013+ }; then
2014+ gl_threads_api=win32
2015+ AC_DEFINE([USE_WIN32_THREADS], [1],
2016+ [Define if the Win32 multithreading API can be used.])
2017+ fi
2018+ fi
2019+ fi
2020+ fi
2021+ AC_MSG_CHECKING([for multithread API to use])
2022+ AC_MSG_RESULT([$gl_threads_api])
2023+ AC_SUBST([LIBTHREAD])
2024+ AC_SUBST([LTLIBTHREAD])
2025+ AC_SUBST([LIBMULTITHREAD])
2026+ AC_SUBST([LTLIBMULTITHREAD])
2027+])
2028+
2029+AC_DEFUN([gl_THREADLIB],
2030+[
2031+ AC_REQUIRE([gl_THREADLIB_EARLY])
2032+ AC_REQUIRE([gl_THREADLIB_BODY])
2033+])
2034+
2035+
2036+dnl gl_DISABLE_THREADS
2037+dnl ------------------
2038+dnl Sets the gl_THREADLIB default so that threads are not used by default.
2039+dnl The user can still override it at installation time, by using the
2040+dnl configure option '--enable-threads'.
2041+
2042+AC_DEFUN([gl_DISABLE_THREADS], [
2043+ m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
2044+])
2045+
2046+
2047+dnl Survey of platforms:
2048+dnl
2049+dnl Platform Available Compiler Supports test-lock
2050+dnl flavours option weak result
2051+dnl --------------- --------- --------- -------- ---------
2052+dnl Linux 2.4/glibc posix -lpthread Y OK
2053+dnl
2054+dnl GNU Hurd/glibc posix
2055+dnl
2056+dnl FreeBSD 5.3 posix -lc_r Y
2057+dnl posix -lkse ? Y
2058+dnl posix -lpthread ? Y
2059+dnl posix -lthr Y
2060+dnl
2061+dnl FreeBSD 5.2 posix -lc_r Y
2062+dnl posix -lkse Y
2063+dnl posix -lthr Y
2064+dnl
2065+dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
2066+dnl
2067+dnl NetBSD 1.6 --
2068+dnl
2069+dnl OpenBSD 3.4 posix -lpthread Y OK
2070+dnl
2071+dnl MacOS X 10.[123] posix -lpthread Y OK
2072+dnl
2073+dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
2074+dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
2075+dnl
2076+dnl HP-UX 11 posix -lpthread N (cc) OK
2077+dnl Y (gcc)
2078+dnl
2079+dnl IRIX 6.5 posix -lpthread Y 0.5
2080+dnl
2081+dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
2082+dnl
2083+dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
2084+dnl -lpthread (gcc) Y
2085+dnl
2086+dnl Cygwin posix -lpthread Y OK
2087+dnl
2088+dnl Any of the above pth -lpth 0.0
2089+dnl
2090+dnl Mingw win32 N OK
2091+dnl
2092+dnl BeOS 5 --
2093+dnl
2094+dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
2095+dnl turned off:
2096+dnl OK if all three tests terminate OK,
2097+dnl 0.5 if the first test terminates OK but the second one loops endlessly,
2098+dnl 0.0 if the first test already loops endlessly.
2099
2100=== added file 'm4/uintmax_t.m4'
2101--- m4/uintmax_t.m4 1970-01-01 00:00:00 +0000
2102+++ m4/uintmax_t.m4 2013-07-06 19:13:27 +0000
2103@@ -0,0 +1,30 @@
2104+# uintmax_t.m4 serial 12
2105+dnl Copyright (C) 1997-2004, 2007-2010 Free Software Foundation, Inc.
2106+dnl This file is free software; the Free Software Foundation
2107+dnl gives unlimited permission to copy and/or distribute it,
2108+dnl with or without modifications, as long as this notice is preserved.
2109+
2110+dnl From Paul Eggert.
2111+
2112+AC_PREREQ([2.13])
2113+
2114+# Define uintmax_t to 'unsigned long' or 'unsigned long long'
2115+# if it is not already defined in <stdint.h> or <inttypes.h>.
2116+
2117+AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
2118+[
2119+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
2120+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
2121+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
2122+ AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
2123+ test $ac_cv_type_unsigned_long_long_int = yes \
2124+ && ac_type='unsigned long long' \
2125+ || ac_type='unsigned long'
2126+ AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
2127+ [Define to unsigned long or unsigned long long
2128+ if <stdint.h> and <inttypes.h> don't define.])
2129+ else
2130+ AC_DEFINE([HAVE_UINTMAX_T], [1],
2131+ [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2132+ fi
2133+])
2134
2135=== added file 'm4/wchar_t.m4'
2136--- m4/wchar_t.m4 1970-01-01 00:00:00 +0000
2137+++ m4/wchar_t.m4 2013-07-06 19:13:27 +0000
2138@@ -0,0 +1,20 @@
2139+# wchar_t.m4 serial 3 (gettext-0.18)
2140+dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
2141+dnl This file is free software; the Free Software Foundation
2142+dnl gives unlimited permission to copy and/or distribute it,
2143+dnl with or without modifications, as long as this notice is preserved.
2144+
2145+dnl From Bruno Haible.
2146+dnl Test whether <stddef.h> has the 'wchar_t' type.
2147+dnl Prerequisite: AC_PROG_CC
2148+
2149+AC_DEFUN([gt_TYPE_WCHAR_T],
2150+[
2151+ AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
2152+ [AC_TRY_COMPILE([#include <stddef.h>
2153+ wchar_t foo = (wchar_t)'\0';], ,
2154+ [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])])
2155+ if test $gt_cv_c_wchar_t = yes; then
2156+ AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
2157+ fi
2158+])
2159
2160=== added file 'm4/wint_t.m4'
2161--- m4/wint_t.m4 1970-01-01 00:00:00 +0000
2162+++ m4/wint_t.m4 2013-07-06 19:13:27 +0000
2163@@ -0,0 +1,28 @@
2164+# wint_t.m4 serial 4 (gettext-0.18)
2165+dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
2166+dnl This file is free software; the Free Software Foundation
2167+dnl gives unlimited permission to copy and/or distribute it,
2168+dnl with or without modifications, as long as this notice is preserved.
2169+
2170+dnl From Bruno Haible.
2171+dnl Test whether <wchar.h> has the 'wint_t' type.
2172+dnl Prerequisite: AC_PROG_CC
2173+
2174+AC_DEFUN([gt_TYPE_WINT_T],
2175+[
2176+ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
2177+ [AC_TRY_COMPILE([
2178+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
2179+ <wchar.h>.
2180+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
2181+ before <wchar.h>. */
2182+#include <stddef.h>
2183+#include <stdio.h>
2184+#include <time.h>
2185+#include <wchar.h>
2186+ wint_t foo = (wchar_t)'\0';], ,
2187+ [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])])
2188+ if test $gt_cv_c_wint_t = yes; then
2189+ AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
2190+ fi
2191+])
2192
2193=== added file 'm4/xsize.m4'
2194--- m4/xsize.m4 1970-01-01 00:00:00 +0000
2195+++ m4/xsize.m4 2013-07-06 19:13:27 +0000
2196@@ -0,0 +1,13 @@
2197+# xsize.m4 serial 4
2198+dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc.
2199+dnl This file is free software; the Free Software Foundation
2200+dnl gives unlimited permission to copy and/or distribute it,
2201+dnl with or without modifications, as long as this notice is preserved.
2202+
2203+AC_DEFUN([gl_XSIZE],
2204+[
2205+ dnl Prerequisites of lib/xsize.h.
2206+ AC_REQUIRE([gl_SIZE_MAX])
2207+ AC_REQUIRE([AC_C_INLINE])
2208+ AC_CHECK_HEADERS([stdint.h])
2209+])

Subscribers

People subscribed via source and target branches

to all changes: