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
=== modified file 'docs/include.am'
--- docs/include.am 2013-01-02 07:47:09 +0000
+++ docs/include.am 2013-07-06 19:13:27 +0000
@@ -2,6 +2,9 @@
2# included from Top Level Makefile.am2# included from Top Level Makefile.am
3# All paths should be given relative to the root3# All paths should be given relative to the root
44
5# Makefile for Sphinx documentation
6#
7
5EXTRA_DIST+= \8EXTRA_DIST+= \
6 ${top_srcdir}/docs/_static \9 ${top_srcdir}/docs/_static \
7 ${top_srcdir}/docs/conf.py \10 ${top_srcdir}/docs/conf.py \
@@ -18,49 +21,27 @@
18 ${top_srcdir}/docs/*/*.rst \21 ${top_srcdir}/docs/*/*.rst \
19 ${top_srcdir}/docs/*/*/*.rst22 ${top_srcdir}/docs/*/*/*.rst
2023
21# Makefile for Sphinx documentation
22#
23
24SPHINXOPTS = ${SPHINX_WARNINGS} -q24SPHINXOPTS = ${SPHINX_WARNINGS} -q
25PAPER =25PAPER =
26SPHINX_BUILDDIR = ${abs_top_builddir}/docs26SPHINX_BUILDDIR = ${abs_srcdir}/docs
2727
28# Internal variables.28# Internal variables.
29PAPEROPT_a4 = -D latex_paper_size=a429PAPEROPT_a4 = -D latex_paper_size=a4
30PAPEROPT_letter = -D latex_paper_size=letter30PAPEROPT_letter = -D latex_paper_size=letter
31ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SPHINX_BUILDDIR)31ALLSPHINXOPTS = -c $(top_builddir)/docs $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SPHINX_BUILDDIR)
3232
33.PHONY: clean-docs-check33.PHONY: clean-docs-check
34clean-docs-check:34clean-docs-check:
35 -rm -rf docs/_build docs/doctrees man/.doctrees/35 -rm -rf docs/_build docs/doctrees man/.doctrees
3636
37.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest37.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
38if HAVE_SPHINX38
3939man: docs/conf.py
40sphinx-help:40 @PYTHONPATH=$(SPHINX_BUILDDIR)/docs $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) ${top_builddir}/man
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
58doc_dirs:
59 @$(mkdir_p) $(SPHINX_BUILDDIR)/_static
6041
61install-html-local: html-local42install-html-local: html-local
62 @rm -rf $(htmldir)/html43 @$(MKDIR_P) $(htmldir)/html
63 @cp -r ${top_builddir}/html/ $(htmldir)44 @cp -r ${top_builddir}/html $(htmldir)/
6445
65html-local: docs/conf.py46html-local: docs/conf.py
66 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ${top_builddir}/html47 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ${top_builddir}/html
@@ -105,16 +86,6 @@
105text: docs/conf.py86text: docs/conf.py
106 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/text87 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/text
10788
108if HAVE_RECENT_SPHINX
109man:
110 @PYTHONPATH=$(SPHINX_BUILDDIR)/docs $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) ${top_builddir}/man
111
112else
113
114man:
115
116endif
117
118changes: docs/conf.py89changes: docs/conf.py
119 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/changes90 @PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/changes
12091
@@ -125,9 +96,3 @@
125 PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/doctest96 PYTHONPATH=${top_srcdir}/docs $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(SPHINX_BUILDDIR)/doctest
126 @echo "Testing of doctests in the sources finished, look at the " \97 @echo "Testing of doctests in the sources finished, look at the " \
127 "results in $(SPHINX_BUILDDIR)/doctest/output.txt."98 "results in $(SPHINX_BUILDDIR)/doctest/output.txt."
128
129else
130
131man:
132
133endif
13499
=== modified file 'm4/ax_prog_sphinx_build.m4'
--- m4/ax_prog_sphinx_build.m4 2012-12-28 23:09:22 +0000
+++ m4/ax_prog_sphinx_build.m4 2013-07-06 19:13:27 +0000
@@ -4,42 +4,45 @@
4#4#
5# SYNOPSIS5# SYNOPSIS
6#6#
7# AX_PROG_SPHINX_BUILD()7# AX_PROG_SPHINX_BUILD([ACTION-IF-FOUND], [ACTION-IF-NOT_FOUND])
8#8#
9# DESCRIPTION9# DESCRIPTION
10#10#
11# Look for sphinx-build11# Look for sphinx-build and make sure it is a recent version of it.
12#12#
13# LICENSE13# LICENSE
14#14#
15# Copyright (c) 2012 Brian Aker <brian@tangent.org>15# Copyright (c) 2012-2013 Brian Aker <brian@tangent.org>
16#16#
17# Copying and distribution of this file, with or without modification, are17# Copying and distribution of this file, with or without modification, are
18# permitted in any medium without royalty provided the copyright notice18# permitted in any medium without royalty provided the copyright notice
19# and this notice are preserved. This file is offered as-is, without any19# and this notice are preserved. This file is offered as-is, without any
20# warranty.20# warranty.
2121
22#serial 222#serial 5
2323
24AC_DEFUN([AX_PROG_SPHINX_BUILD],24AC_DEFUN([AX_PROG_SPHINX_BUILD],
25 [AC_PREREQ([2.63])dnl25 [AX_WITH_PROG([SPHINXBUILD],[sphinx-build],[:])
26 AC_CHECK_PROGS([PERL], [perl])26 AS_IF([test x"SPHINXBUILD" = x":"],
27 AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:])27 [SPHINXBUILD=],
28 AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found])28 [AS_IF([test -x "$SPHINXBUILD"],
29 AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found])29 [AC_MSG_CHECKING([Checking to see if $SPHINXBUILD is recent])
3030 junk=`$SPHINXBUILD --version &> version_file`
31 AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])31 AS_IF([test $? -eq 0],
32 AS_IF([test "x${SPHINXBUILD}" != "x:"],[32 [ax_sphinx_build_version=`head -1 version_file`],
33 AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[33 [junk=`$SPHINXBUILD &> version_file`
3434 ax_sphinx_build_version=`head -1 version_file`
35 ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&135 rm version_file
36 AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes],36 AC_MSG_RESULT([$SPHINXBUILD is version "$ax_sphinx_build_version"])
37 [ac_cv_recent_sphinx=no])37 $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
38 rm -rf conftest.d38 AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
39 ])39 rm -rf conftest.d ])
40 ])40 ])
4141 rm -f version_file
42 AM_CONDITIONAL([HAVE_DPKG_GENSYMBOLS],[test "x${DPKG_GENSYMBOLS}" != "x:"])42 ])
43 AM_CONDITIONAL([HAVE_SPHINX],[test "x${SPHINXBUILD}" != "x:"])43
44 AM_CONDITIONAL([HAVE_RECENT_SPHINX],[test "x${ac_cv_recent_sphinx}" = "xyes"])44 AS_IF([test -n "${SPHINXBUILD}"],
45])45 [AC_SUBST([SPHINXBUILD])
46 ifelse([$1], , :, [$1])],
47 [ifelse([$2], , :, [$2])])
48 ])
4649
=== added file 'm4/ax_with_prog.m4'
--- m4/ax_with_prog.m4 1970-01-01 00:00:00 +0000
+++ m4/ax_with_prog.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,70 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_with_prog.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH])
8#
9# DESCRIPTION
10#
11# Locates an installed program binary, placing the result in the precious
12# variable VARIABLE. Accepts a present VARIABLE, then --with-program, and
13# failing that searches for program in the given path (which defaults to
14# the system path). If program is found, VARIABLE is set to the full path
15# of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND
16# if provided, unchanged otherwise.
17#
18# A typical example could be the following one:
19#
20# AX_WITH_PROG(PERL,perl)
21#
22# NOTE: This macro is based upon the original AX_WITH_PYTHON macro from
23# Dustin J. Mitchell <dustin@cs.uchicago.edu>.
24#
25# LICENSE
26#
27# Copyright (c) 2008 Francesco Salvestrini <salvestrini@users.sourceforge.net>
28# Copyright (c) 2008 Dustin J. Mitchell <dustin@cs.uchicago.edu>
29#
30# Copying and distribution of this file, with or without modification, are
31# permitted in any medium without royalty provided the copyright notice
32# and this notice are preserved. This file is offered as-is, without any
33# warranty.
34
35#serial 16
36
37AC_DEFUN([AX_WITH_PROG],[
38 AC_PREREQ([2.61])
39
40 pushdef([VARIABLE],$1)
41 pushdef([EXECUTABLE],$2)
42 pushdef([VALUE_IF_NOT_FOUND],$3)
43 pushdef([PATH_PROG],$4)
44
45 AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable)
46
47 AS_IF(test -z "$VARIABLE",[
48 AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided)
49 AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[PATH]]]],absolute path to EXECUTABLE executable), [
50 AS_IF([test "$withval" != yes && test "$withval" != no],[
51 VARIABLE="$withval"
52 AC_MSG_RESULT($VARIABLE)
53 ],[
54 VARIABLE=""
55 AC_MSG_RESULT([no])
56 AS_IF([test "$withval" != no], [
57 AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[])
58 ])
59 ])
60 ],[
61 AC_MSG_RESULT([no])
62 AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[])
63 ])
64 ])
65
66 popdef([PATH_PROG])
67 popdef([VALUE_IF_NOT_FOUND])
68 popdef([EXECUTABLE])
69 popdef([VARIABLE])
70])
071
=== added file 'm4/codeset.m4'
--- m4/codeset.m4 1970-01-01 00:00:00 +0000
+++ m4/codeset.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,21 @@
1# codeset.m4 serial 4 (gettext-0.18)
2dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_DEFUN([AM_LANGINFO_CODESET],
10[
11 AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
12 [AC_TRY_LINK([#include <langinfo.h>],
13 [char* cs = nl_langinfo(CODESET); return !cs;],
14 [am_cv_langinfo_codeset=yes],
15 [am_cv_langinfo_codeset=no])
16 ])
17 if test $am_cv_langinfo_codeset = yes; then
18 AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
19 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
20 fi
21])
022
=== added file 'm4/fcntl-o.m4'
--- m4/fcntl-o.m4 1970-01-01 00:00:00 +0000
+++ m4/fcntl-o.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,81 @@
1# fcntl-o.m4 serial 1
2dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Written by Paul Eggert.
8
9# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
10# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
11# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
12AC_DEFUN([gl_FCNTL_O_FLAGS],
13[
14 dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
15 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
16 AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
17 [AC_RUN_IFELSE(
18 [AC_LANG_PROGRAM(
19 [[#include <sys/types.h>
20 #include <sys/stat.h>
21 #include <unistd.h>
22 #include <fcntl.h>
23 #ifndef O_NOATIME
24 #define O_NOATIME 0
25 #endif
26 #ifndef O_NOFOLLOW
27 #define O_NOFOLLOW 0
28 #endif
29 static int const constants[] =
30 {
31 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
32 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
33 };
34 ]],
35 [[
36 int status = !constants;
37 {
38 static char const sym[] = "conftest.sym";
39 if (symlink (".", sym) != 0
40 || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
41 status |= 32;
42 unlink (sym);
43 }
44 {
45 static char const file[] = "confdefs.h";
46 int fd = open (file, O_RDONLY | O_NOATIME);
47 char c;
48 struct stat st0, st1;
49 if (fd < 0
50 || fstat (fd, &st0) != 0
51 || sleep (1) != 0
52 || read (fd, &c, 1) != 1
53 || close (fd) != 0
54 || stat (file, &st1) != 0
55 || st0.st_atime != st1.st_atime)
56 status |= 64;
57 }
58 return status;]])],
59 [gl_cv_header_working_fcntl_h=yes],
60 [case $? in #(
61 32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
62 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
63 96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
64 *) gl_cv_header_working_fcntl_h='no';;
65 esac],
66 [gl_cv_header_working_fcntl_h=cross-compiling])])
67
68 case $gl_cv_header_working_fcntl_h in #(
69 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
70 *) ac_val=1;;
71 esac
72 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
73 [Define to 1 if O_NOATIME works.])
74
75 case $gl_cv_header_working_fcntl_h in #(
76 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
77 *) ac_val=1;;
78 esac
79 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
80 [Define to 1 if O_NOFOLLOW works.])
81])
082
=== added file 'm4/gettext.m4'
--- m4/gettext.m4 1970-01-01 00:00:00 +0000
+++ m4/gettext.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,383 @@
1# gettext.m4 serial 63 (gettext-0.18)
2dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
7dnl This file can can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public
9dnl License but which still want to provide support for the GNU gettext
10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain.
15
16dnl Authors:
17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
19
20dnl Macro to add for using GNU gettext.
21
22dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
23dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
24dnl default (if it is not specified or empty) is 'no-libtool'.
25dnl INTLSYMBOL should be 'external' for packages with no intl directory,
26dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
27dnl If INTLSYMBOL is 'use-libtool', then a libtool library
28dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
29dnl depending on --{enable,disable}-{shared,static} and on the presence of
30dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
31dnl $(top_builddir)/intl/libintl.a will be created.
32dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
33dnl implementations (in libc or libintl) without the ngettext() function
34dnl will be ignored. If NEEDSYMBOL is specified and is
35dnl 'need-formatstring-macros', then GNU gettext implementations that don't
36dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
37dnl INTLDIR is used to find the intl libraries. If empty,
38dnl the value `$(top_builddir)/intl/' is used.
39dnl
40dnl The result of the configuration is one of three cases:
41dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
42dnl and used.
43dnl Catalog format: GNU --> install in $(datadir)
44dnl Catalog extension: .mo after installation, .gmo in source tree
45dnl 2) GNU gettext has been found in the system's C library.
46dnl Catalog format: GNU --> install in $(datadir)
47dnl Catalog extension: .mo after installation, .gmo in source tree
48dnl 3) No internationalization, always use English msgid.
49dnl Catalog format: none
50dnl Catalog extension: none
51dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
52dnl The use of .gmo is historical (it was needed to avoid overwriting the
53dnl GNU format catalogs when building on a platform with an X/Open gettext),
54dnl but we keep it in order not to force irrelevant filename changes on the
55dnl maintainers.
56dnl
57AC_DEFUN([AM_GNU_GETTEXT],
58[
59 dnl Argument checking.
60 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
61 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
62])])])])])
63 ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
64 [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
65 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
66 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
67])])])])
68 define([gt_included_intl],
69 ifelse([$1], [external],
70 ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
71 [yes]))
72 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
73 gt_NEEDS_INIT
74 AM_GNU_GETTEXT_NEED([$2])
75
76 AC_REQUIRE([AM_PO_SUBDIRS])dnl
77 ifelse(gt_included_intl, yes, [
78 AC_REQUIRE([AM_INTL_SUBDIR])dnl
79 ])
80
81 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
82 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
83 AC_REQUIRE([AC_LIB_RPATH])
84
85 dnl Sometimes libintl requires libiconv, so first search for libiconv.
86 dnl Ideally we would do this search only after the
87 dnl if test "$USE_NLS" = "yes"; then
88 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
89 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
90 dnl the configure script would need to contain the same shell code
91 dnl again, outside any 'if'. There are two solutions:
92 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
93 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
94 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
95 dnl documented, we avoid it.
96 ifelse(gt_included_intl, yes, , [
97 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
98 ])
99
100 dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
101 gt_INTL_MACOSX
102
103 dnl Set USE_NLS.
104 AC_REQUIRE([AM_NLS])
105
106 ifelse(gt_included_intl, yes, [
107 BUILD_INCLUDED_LIBINTL=no
108 USE_INCLUDED_LIBINTL=no
109 ])
110 LIBINTL=
111 LTLIBINTL=
112 POSUB=
113
114 dnl Add a version number to the cache macros.
115 case " $gt_needs " in
116 *" need-formatstring-macros "*) gt_api_version=3 ;;
117 *" need-ngettext "*) gt_api_version=2 ;;
118 *) gt_api_version=1 ;;
119 esac
120 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
121 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
122
123 dnl If we use NLS figure out what method
124 if test "$USE_NLS" = "yes"; then
125 gt_use_preinstalled_gnugettext=no
126 ifelse(gt_included_intl, yes, [
127 AC_MSG_CHECKING([whether included gettext is requested])
128 AC_ARG_WITH([included-gettext],
129 [ --with-included-gettext use the GNU gettext library included here],
130 nls_cv_force_use_gnu_gettext=$withval,
131 nls_cv_force_use_gnu_gettext=no)
132 AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
133
134 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
135 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
136 ])
137 dnl User does not insist on using GNU NLS library. Figure out what
138 dnl to use. If GNU gettext is available we use this. Else we have
139 dnl to fall back to GNU NLS library.
140
141 if test $gt_api_version -ge 3; then
142 gt_revision_test_code='
143#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
144#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
145#endif
146changequote(,)dnl
147typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
148changequote([,])dnl
149'
150 else
151 gt_revision_test_code=
152 fi
153 if test $gt_api_version -ge 2; then
154 gt_expression_test_code=' + * ngettext ("", "", 0)'
155 else
156 gt_expression_test_code=
157 fi
158
159 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
160 [AC_TRY_LINK([#include <libintl.h>
161$gt_revision_test_code
162extern int _nl_msg_cat_cntr;
163extern int *_nl_domain_bindings;],
164 [bindtextdomain ("", "");
165return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
166 [eval "$gt_func_gnugettext_libc=yes"],
167 [eval "$gt_func_gnugettext_libc=no"])])
168
169 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
170 dnl Sometimes libintl requires libiconv, so first search for libiconv.
171 ifelse(gt_included_intl, yes, , [
172 AM_ICONV_LINK
173 ])
174 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
175 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
176 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
177 dnl even if libiconv doesn't exist.
178 AC_LIB_LINKFLAGS_BODY([intl])
179 AC_CACHE_CHECK([for GNU gettext in libintl],
180 [$gt_func_gnugettext_libintl],
181 [gt_save_CPPFLAGS="$CPPFLAGS"
182 CPPFLAGS="$CPPFLAGS $INCINTL"
183 gt_save_LIBS="$LIBS"
184 LIBS="$LIBS $LIBINTL"
185 dnl Now see whether libintl exists and does not depend on libiconv.
186 AC_TRY_LINK([#include <libintl.h>
187$gt_revision_test_code
188extern int _nl_msg_cat_cntr;
189extern
190#ifdef __cplusplus
191"C"
192#endif
193const char *_nl_expand_alias (const char *);],
194 [bindtextdomain ("", "");
195return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
196 [eval "$gt_func_gnugettext_libintl=yes"],
197 [eval "$gt_func_gnugettext_libintl=no"])
198 dnl Now see whether libintl exists and depends on libiconv.
199 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
200 LIBS="$LIBS $LIBICONV"
201 AC_TRY_LINK([#include <libintl.h>
202$gt_revision_test_code
203extern int _nl_msg_cat_cntr;
204extern
205#ifdef __cplusplus
206"C"
207#endif
208const char *_nl_expand_alias (const char *);],
209 [bindtextdomain ("", "");
210return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
211 [LIBINTL="$LIBINTL $LIBICONV"
212 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
213 eval "$gt_func_gnugettext_libintl=yes"
214 ])
215 fi
216 CPPFLAGS="$gt_save_CPPFLAGS"
217 LIBS="$gt_save_LIBS"])
218 fi
219
220 dnl If an already present or preinstalled GNU gettext() is found,
221 dnl use it. But if this macro is used in GNU gettext, and GNU
222 dnl gettext is already preinstalled in libintl, we update this
223 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
224 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
225 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
226 && test "$PACKAGE" != gettext-runtime \
227 && test "$PACKAGE" != gettext-tools; }; then
228 gt_use_preinstalled_gnugettext=yes
229 else
230 dnl Reset the values set by searching for libintl.
231 LIBINTL=
232 LTLIBINTL=
233 INCINTL=
234 fi
235
236 ifelse(gt_included_intl, yes, [
237 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
238 dnl GNU gettext is not found in the C library.
239 dnl Fall back on included GNU gettext library.
240 nls_cv_use_gnu_gettext=yes
241 fi
242 fi
243
244 if test "$nls_cv_use_gnu_gettext" = "yes"; then
245 dnl Mark actions used to generate GNU NLS library.
246 BUILD_INCLUDED_LIBINTL=yes
247 USE_INCLUDED_LIBINTL=yes
248 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
249 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
250 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
251 fi
252
253 CATOBJEXT=
254 if test "$gt_use_preinstalled_gnugettext" = "yes" \
255 || test "$nls_cv_use_gnu_gettext" = "yes"; then
256 dnl Mark actions to use GNU gettext tools.
257 CATOBJEXT=.gmo
258 fi
259 ])
260
261 if test -n "$INTL_MACOSX_LIBS"; then
262 if test "$gt_use_preinstalled_gnugettext" = "yes" \
263 || test "$nls_cv_use_gnu_gettext" = "yes"; then
264 dnl Some extra flags are needed during linking.
265 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
266 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
267 fi
268 fi
269
270 if test "$gt_use_preinstalled_gnugettext" = "yes" \
271 || test "$nls_cv_use_gnu_gettext" = "yes"; then
272 AC_DEFINE([ENABLE_NLS], [1],
273 [Define to 1 if translation of program messages to the user's native language
274 is requested.])
275 else
276 USE_NLS=no
277 fi
278 fi
279
280 AC_MSG_CHECKING([whether to use NLS])
281 AC_MSG_RESULT([$USE_NLS])
282 if test "$USE_NLS" = "yes"; then
283 AC_MSG_CHECKING([where the gettext function comes from])
284 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
285 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
286 gt_source="external libintl"
287 else
288 gt_source="libc"
289 fi
290 else
291 gt_source="included intl directory"
292 fi
293 AC_MSG_RESULT([$gt_source])
294 fi
295
296 if test "$USE_NLS" = "yes"; then
297
298 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
299 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
300 AC_MSG_CHECKING([how to link with libintl])
301 AC_MSG_RESULT([$LIBINTL])
302 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
303 fi
304
305 dnl For backward compatibility. Some packages may be using this.
306 AC_DEFINE([HAVE_GETTEXT], [1],
307 [Define if the GNU gettext() function is already present or preinstalled.])
308 AC_DEFINE([HAVE_DCGETTEXT], [1],
309 [Define if the GNU dcgettext() function is already present or preinstalled.])
310 fi
311
312 dnl We need to process the po/ directory.
313 POSUB=po
314 fi
315
316 ifelse(gt_included_intl, yes, [
317 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
318 dnl to 'yes' because some of the testsuite requires it.
319 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
320 BUILD_INCLUDED_LIBINTL=yes
321 fi
322
323 dnl Make all variables we use known to autoconf.
324 AC_SUBST([BUILD_INCLUDED_LIBINTL])
325 AC_SUBST([USE_INCLUDED_LIBINTL])
326 AC_SUBST([CATOBJEXT])
327
328 dnl For backward compatibility. Some configure.ins may be using this.
329 nls_cv_header_intl=
330 nls_cv_header_libgt=
331
332 dnl For backward compatibility. Some Makefiles may be using this.
333 DATADIRNAME=share
334 AC_SUBST([DATADIRNAME])
335
336 dnl For backward compatibility. Some Makefiles may be using this.
337 INSTOBJEXT=.mo
338 AC_SUBST([INSTOBJEXT])
339
340 dnl For backward compatibility. Some Makefiles may be using this.
341 GENCAT=gencat
342 AC_SUBST([GENCAT])
343
344 dnl For backward compatibility. Some Makefiles may be using this.
345 INTLOBJS=
346 if test "$USE_INCLUDED_LIBINTL" = yes; then
347 INTLOBJS="\$(GETTOBJS)"
348 fi
349 AC_SUBST([INTLOBJS])
350
351 dnl Enable libtool support if the surrounding package wishes it.
352 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
353 AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
354 ])
355
356 dnl For backward compatibility. Some Makefiles may be using this.
357 INTLLIBS="$LIBINTL"
358 AC_SUBST([INTLLIBS])
359
360 dnl Make all documented variables known to autoconf.
361 AC_SUBST([LIBINTL])
362 AC_SUBST([LTLIBINTL])
363 AC_SUBST([POSUB])
364])
365
366
367dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
368m4_define([gt_NEEDS_INIT],
369[
370 m4_divert_text([DEFAULTS], [gt_needs=])
371 m4_define([gt_NEEDS_INIT], [])
372])
373
374
375dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
376AC_DEFUN([AM_GNU_GETTEXT_NEED],
377[
378 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
379])
380
381
382dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
383AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
0384
=== added file 'm4/glibc2.m4'
--- m4/glibc2.m4 1970-01-01 00:00:00 +0000
+++ m4/glibc2.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,30 @@
1# glibc2.m4 serial 2
2dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7# Test for the GNU C Library, version 2.0 or newer.
8# From Bruno Haible.
9
10AC_DEFUN([gt_GLIBC2],
11 [
12 AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
13 [ac_cv_gnu_library_2],
14 [AC_EGREP_CPP([Lucky GNU user],
15 [
16#include <features.h>
17#ifdef __GNU_LIBRARY__
18 #if (__GLIBC__ >= 2)
19 Lucky GNU user
20 #endif
21#endif
22 ],
23 [ac_cv_gnu_library_2=yes],
24 [ac_cv_gnu_library_2=no])
25 ]
26 )
27 AC_SUBST([GLIBC2])
28 GLIBC2="$ac_cv_gnu_library_2"
29 ]
30)
031
=== added file 'm4/glibc21.m4'
--- m4/glibc21.m4 1970-01-01 00:00:00 +0000
+++ m4/glibc21.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,30 @@
1# glibc21.m4 serial 4
2dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7# Test for the GNU C Library, version 2.1 or newer.
8# From Bruno Haible.
9
10AC_DEFUN([gl_GLIBC21],
11 [
12 AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
13 [ac_cv_gnu_library_2_1],
14 [AC_EGREP_CPP([Lucky GNU user],
15 [
16#include <features.h>
17#ifdef __GNU_LIBRARY__
18 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
19 Lucky GNU user
20 #endif
21#endif
22 ],
23 [ac_cv_gnu_library_2_1=yes],
24 [ac_cv_gnu_library_2_1=no])
25 ]
26 )
27 AC_SUBST([GLIBC21])
28 GLIBC21="$ac_cv_gnu_library_2_1"
29 ]
30)
031
=== added file 'm4/intdiv0.m4'
--- m4/intdiv0.m4 1970-01-01 00:00:00 +0000
+++ m4/intdiv0.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,84 @@
1# intdiv0.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_DEFUN([gt_INTDIV0],
10[
11 AC_REQUIRE([AC_PROG_CC])dnl
12 AC_REQUIRE([AC_CANONICAL_HOST])dnl
13
14 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
15 gt_cv_int_divbyzero_sigfpe,
16 [
17 gt_cv_int_divbyzero_sigfpe=
18changequote(,)dnl
19 case "$host_os" in
20 macos* | darwin[6-9]* | darwin[1-9][0-9]*)
21 # On MacOS X 10.2 or newer, just assume the same as when cross-
22 # compiling. If we were to perform the real test, 1 Crash Report
23 # dialog window would pop up.
24 case "$host_cpu" in
25 i[34567]86 | x86_64)
26 gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
27 esac
28 ;;
29 esac
30changequote([,])dnl
31 if test -z "$gt_cv_int_divbyzero_sigfpe"; then
32 AC_TRY_RUN([
33#include <stdlib.h>
34#include <signal.h>
35
36static void
37sigfpe_handler (int sig)
38{
39 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
40 exit (sig != SIGFPE);
41}
42
43int x = 1;
44int y = 0;
45int z;
46int nan;
47
48int main ()
49{
50 signal (SIGFPE, sigfpe_handler);
51/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
52#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
53 signal (SIGTRAP, sigfpe_handler);
54#endif
55/* Linux/SPARC yields signal SIGILL. */
56#if defined (__sparc__) && defined (__linux__)
57 signal (SIGILL, sigfpe_handler);
58#endif
59
60 z = x / y;
61 nan = y / y;
62 exit (1);
63}
64], [gt_cv_int_divbyzero_sigfpe=yes], [gt_cv_int_divbyzero_sigfpe=no],
65 [
66 # Guess based on the CPU.
67changequote(,)dnl
68 case "$host_cpu" in
69 alpha* | i[34567]86 | x86_64 | m68k | s390*)
70 gt_cv_int_divbyzero_sigfpe="guessing yes";;
71 *)
72 gt_cv_int_divbyzero_sigfpe="guessing no";;
73 esac
74changequote([,])dnl
75 ])
76 fi
77 ])
78 case "$gt_cv_int_divbyzero_sigfpe" in
79 *yes) value=1;;
80 *) value=0;;
81 esac
82 AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
83 [Define if integer division by zero raises signal SIGFPE.])
84])
085
=== added file 'm4/intl.m4'
--- m4/intl.m4 1970-01-01 00:00:00 +0000
+++ m4/intl.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,294 @@
1# intl.m4 serial 17 (gettext-0.18)
2dnl Copyright (C) 1995-2009 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
7dnl This file can can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public
9dnl License but which still want to provide support for the GNU gettext
10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain.
15
16dnl Authors:
17dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
19
20AC_PREREQ([2.52])
21
22dnl Checks for all prerequisites of the intl subdirectory,
23dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
24dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
25AC_DEFUN([AM_INTL_SUBDIR],
26[
27 AC_REQUIRE([AC_PROG_INSTALL])dnl
28 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
29 AC_REQUIRE([AC_PROG_CC])dnl
30 AC_REQUIRE([AC_CANONICAL_HOST])dnl
31 AC_REQUIRE([gt_GLIBC2])dnl
32 AC_REQUIRE([AC_PROG_RANLIB])dnl
33 AC_REQUIRE([gl_VISIBILITY])dnl
34 AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
35 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
36 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
37 AC_REQUIRE([gt_TYPE_WINT_T])dnl
38 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
39 AC_REQUIRE([gt_TYPE_INTMAX_T])
40 AC_REQUIRE([gt_PRINTF_POSIX])
41 AC_REQUIRE([gl_GLIBC21])dnl
42 AC_REQUIRE([gl_XSIZE])dnl
43 AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
44 AC_REQUIRE([gt_INTL_MACOSX])dnl
45
46 dnl Support for automake's --enable-silent-rules.
47 case "$enable_silent_rules" in
48 yes) INTL_DEFAULT_VERBOSITY=0;;
49 no) INTL_DEFAULT_VERBOSITY=1;;
50 *) INTL_DEFAULT_VERBOSITY=1;;
51 esac
52 AC_SUBST([INTL_DEFAULT_VERBOSITY])
53
54 AC_CHECK_TYPE([ptrdiff_t], ,
55 [AC_DEFINE([ptrdiff_t], [long],
56 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
57 ])
58 AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
59 AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
60 snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
61
62 dnl Use the _snprintf function only if it is declared (because on NetBSD it
63 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
64 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
65 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
66
67 dnl Use the *_unlocked functions only if they are declared.
68 dnl (because some of them were defined without being declared in Solaris
69 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
70 dnl on Solaris 2.5.1 to run on Solaris 2.6).
71 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
72 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
73
74 case $gt_cv_func_printf_posix in
75 *yes) HAVE_POSIX_PRINTF=1 ;;
76 *) HAVE_POSIX_PRINTF=0 ;;
77 esac
78 AC_SUBST([HAVE_POSIX_PRINTF])
79 if test "$ac_cv_func_asprintf" = yes; then
80 HAVE_ASPRINTF=1
81 else
82 HAVE_ASPRINTF=0
83 fi
84 AC_SUBST([HAVE_ASPRINTF])
85 if test "$ac_cv_func_snprintf" = yes; then
86 HAVE_SNPRINTF=1
87 else
88 HAVE_SNPRINTF=0
89 fi
90 AC_SUBST([HAVE_SNPRINTF])
91 if test "$ac_cv_func_newlocale" = yes; then
92 HAVE_NEWLOCALE=1
93 else
94 HAVE_NEWLOCALE=0
95 fi
96 AC_SUBST([HAVE_NEWLOCALE])
97 if test "$ac_cv_func_wprintf" = yes; then
98 HAVE_WPRINTF=1
99 else
100 HAVE_WPRINTF=0
101 fi
102 AC_SUBST([HAVE_WPRINTF])
103
104 AM_LANGINFO_CODESET
105 gt_LC_MESSAGES
106
107 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
108 dnl 1. when we install a shared library, we must arrange to export
109 dnl auxiliary pointer variables for every exported variable,
110 dnl 2. when we install a shared library and a static library simultaneously,
111 dnl the include file specifies __declspec(dllimport) and therefore we
112 dnl must arrange to define the auxiliary pointer variables for the
113 dnl exported variables _also_ in the static library.
114 if test "$enable_shared" = yes; then
115 case "$host_os" in
116 mingw* | cygwin*) is_woe32dll=yes ;;
117 *) is_woe32dll=no ;;
118 esac
119 else
120 is_woe32dll=no
121 fi
122 WOE32DLL=$is_woe32dll
123 AC_SUBST([WOE32DLL])
124
125 dnl On mingw and Cygwin, we can activate special Makefile rules which add
126 dnl version information to the shared libraries and executables.
127 case "$host_os" in
128 mingw* | cygwin*) is_woe32=yes ;;
129 *) is_woe32=no ;;
130 esac
131 WOE32=$is_woe32
132 AC_SUBST([WOE32])
133 if test $WOE32 = yes; then
134 dnl Check for a program that compiles Windows resource files.
135 AC_CHECK_TOOL([WINDRES], [windres])
136 fi
137
138 dnl Determine whether when creating a library, "-lc" should be passed to
139 dnl libtool or not. On many platforms, it is required for the libtool option
140 dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
141 dnl in the *.la files - makes it impossible to create multithreaded programs,
142 dnl because libtool also reorders the -lc to come before the -pthread, and
143 dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
144 case "$host_os" in
145 hpux*) LTLIBC="" ;;
146 *) LTLIBC="-lc" ;;
147 esac
148 AC_SUBST([LTLIBC])
149
150 dnl Rename some macros and functions used for locking.
151 AH_BOTTOM([
152#define __libc_lock_t gl_lock_t
153#define __libc_lock_define gl_lock_define
154#define __libc_lock_define_initialized gl_lock_define_initialized
155#define __libc_lock_init gl_lock_init
156#define __libc_lock_lock gl_lock_lock
157#define __libc_lock_unlock gl_lock_unlock
158#define __libc_lock_recursive_t gl_recursive_lock_t
159#define __libc_lock_define_recursive gl_recursive_lock_define
160#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
161#define __libc_lock_init_recursive gl_recursive_lock_init
162#define __libc_lock_lock_recursive gl_recursive_lock_lock
163#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
164#define glthread_in_use libintl_thread_in_use
165#define glthread_lock_init_func libintl_lock_init_func
166#define glthread_lock_lock_func libintl_lock_lock_func
167#define glthread_lock_unlock_func libintl_lock_unlock_func
168#define glthread_lock_destroy_func libintl_lock_destroy_func
169#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
170#define glthread_rwlock_init_func libintl_rwlock_init_func
171#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
172#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
173#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
174#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
175#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
176#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
177#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
178#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
179#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
180#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
181#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
182#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
183#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
184#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
185#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
186#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
187#define glthread_once_func libintl_once_func
188#define glthread_once_singlethreaded libintl_once_singlethreaded
189#define glthread_once_multithreaded libintl_once_multithreaded
190])
191])
192
193
194dnl Checks for the core files of the intl subdirectory:
195dnl dcigettext.c
196dnl eval-plural.h
197dnl explodename.c
198dnl finddomain.c
199dnl gettextP.h
200dnl gmo.h
201dnl hash-string.h hash-string.c
202dnl l10nflist.c
203dnl libgnuintl.h.in (except the *printf stuff)
204dnl loadinfo.h
205dnl loadmsgcat.c
206dnl localealias.c
207dnl log.c
208dnl plural-exp.h plural-exp.c
209dnl plural.y
210dnl Used by libglocale.
211AC_DEFUN([gt_INTL_SUBDIR_CORE],
212[
213 AC_REQUIRE([AC_C_INLINE])dnl
214 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
215 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
216 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
217 AC_REQUIRE([AC_FUNC_MMAP])dnl
218 AC_REQUIRE([gt_INTDIV0])dnl
219 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
220 AC_REQUIRE([gt_INTTYPES_PRI])dnl
221 AC_REQUIRE([gl_LOCK])dnl
222
223 AC_TRY_LINK(
224 [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
225 [],
226 [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
227 [Define to 1 if the compiler understands __builtin_expect.])])
228
229 AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
230 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
231 stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
232 argz_stringify argz_next __fsetlocking])
233
234 dnl Use the *_unlocked functions only if they are declared.
235 dnl (because some of them were defined without being declared in Solaris
236 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
237 dnl on Solaris 2.5.1 to run on Solaris 2.6).
238 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
239 gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
240 gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
241
242 AM_ICONV
243
244 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
245 dnl because plural.y uses bison specific features. It requires at least
246 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
247 dnl compile.
248 dnl bison is only needed for the maintainer (who touches plural.y). But in
249 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
250 dnl the rule in general Makefile. Now, some people carelessly touch the
251 dnl files or have a broken "make" program, hence the plural.c rule will
252 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
253 dnl present or too old.
254 AC_CHECK_PROGS([INTLBISON], [bison])
255 if test -z "$INTLBISON"; then
256 ac_verc_fail=yes
257 else
258 dnl Found it, now check the version.
259 AC_MSG_CHECKING([version of bison])
260changequote(<<,>>)dnl
261 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
262 case $ac_prog_version in
263 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
264 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
265changequote([,])dnl
266 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
267 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
268 esac
269 AC_MSG_RESULT([$ac_prog_version])
270 fi
271 if test $ac_verc_fail = yes; then
272 INTLBISON=:
273 fi
274])
275
276
277dnl gt_CHECK_DECL(FUNC, INCLUDES)
278dnl Check whether a function is declared.
279AC_DEFUN([gt_CHECK_DECL],
280[
281 AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
282 [AC_TRY_COMPILE([$2], [
283#ifndef $1
284 char *p = (char *) $1;
285#endif
286], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
287 if test $ac_cv_have_decl_$1 = yes; then
288 gt_value=1
289 else
290 gt_value=0
291 fi
292 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
293 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
294])
0295
=== added file 'm4/intldir.m4'
--- m4/intldir.m4 1970-01-01 00:00:00 +0000
+++ m4/intldir.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,19 @@
1# intldir.m4 serial 2 (gettext-0.18)
2dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
7dnl This file can can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public
9dnl License but which still want to provide support for the GNU gettext
10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain.
15
16AC_PREREQ([2.52])
17
18dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
19AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
020
=== added file 'm4/intlmacosx.m4'
--- m4/intlmacosx.m4 1970-01-01 00:00:00 +0000
+++ m4/intlmacosx.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,51 @@
1# intlmacosx.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
7dnl This file can can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public
9dnl License but which still want to provide support for the GNU gettext
10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License.
14dnl They are *not* in the public domain.
15
16dnl Checks for special options needed on MacOS X.
17dnl Defines INTL_MACOSX_LIBS.
18AC_DEFUN([gt_INTL_MACOSX],
19[
20 dnl Check for API introduced in MacOS X 10.2.
21 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
22 [gt_cv_func_CFPreferencesCopyAppValue],
23 [gt_save_LIBS="$LIBS"
24 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
25 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
26 [CFPreferencesCopyAppValue(NULL, NULL)],
27 [gt_cv_func_CFPreferencesCopyAppValue=yes],
28 [gt_cv_func_CFPreferencesCopyAppValue=no])
29 LIBS="$gt_save_LIBS"])
30 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
31 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
32 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
33 fi
34 dnl Check for API introduced in MacOS X 10.3.
35 AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
36 [gt_save_LIBS="$LIBS"
37 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
38 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
39 [gt_cv_func_CFLocaleCopyCurrent=yes],
40 [gt_cv_func_CFLocaleCopyCurrent=no])
41 LIBS="$gt_save_LIBS"])
42 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
43 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
44 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
45 fi
46 INTL_MACOSX_LIBS=
47 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
48 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
49 fi
50 AC_SUBST([INTL_MACOSX_LIBS])
51])
052
=== added file 'm4/intmax.m4'
--- m4/intmax.m4 1970-01-01 00:00:00 +0000
+++ m4/intmax.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,33 @@
1# intmax.m4 serial 5 (gettext-0.18)
2dnl Copyright (C) 2002-2005, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8dnl Test whether the system has the 'intmax_t' type, but don't attempt to
9dnl find a replacement if it is lacking.
10
11AC_DEFUN([gt_TYPE_INTMAX_T],
12[
13 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
14 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
15 AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
16 [AC_TRY_COMPILE([
17#include <stddef.h>
18#include <stdlib.h>
19#if HAVE_STDINT_H_WITH_UINTMAX
20#include <stdint.h>
21#endif
22#if HAVE_INTTYPES_H_WITH_UINTMAX
23#include <inttypes.h>
24#endif
25], [intmax_t x = -1;
26 return !x;],
27 [gt_cv_c_intmax_t=yes],
28 [gt_cv_c_intmax_t=no])])
29 if test $gt_cv_c_intmax_t = yes; then
30 AC_DEFINE([HAVE_INTMAX_T], [1],
31 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
32 fi
33])
034
=== added file 'm4/inttypes-pri.m4'
--- m4/inttypes-pri.m4 1970-01-01 00:00:00 +0000
+++ m4/inttypes-pri.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,36 @@
1# inttypes-pri.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 1997-2002, 2006, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_PREREQ([2.52])
10
11# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
12# macros to non-string values. This is the case on AIX 4.3.3.
13
14AC_DEFUN([gt_INTTYPES_PRI],
15[
16 AC_CHECK_HEADERS([inttypes.h])
17 if test $ac_cv_header_inttypes_h = yes; then
18 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
19 [gt_cv_inttypes_pri_broken],
20 [
21 AC_TRY_COMPILE([#include <inttypes.h>
22#ifdef PRId32
23char *p = PRId32;
24#endif
25], [], [gt_cv_inttypes_pri_broken=no], [gt_cv_inttypes_pri_broken=yes])
26 ])
27 fi
28 if test "$gt_cv_inttypes_pri_broken" = yes; then
29 AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
30 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
31 PRI_MACROS_BROKEN=1
32 else
33 PRI_MACROS_BROKEN=0
34 fi
35 AC_SUBST([PRI_MACROS_BROKEN])
36])
037
=== added file 'm4/inttypes_h.m4'
--- m4/inttypes_h.m4 1970-01-01 00:00:00 +0000
+++ m4/inttypes_h.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,26 @@
1# inttypes_h.m4 serial 9
2dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Paul Eggert.
8
9# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
10# doesn't clash with <sys/types.h>, and declares uintmax_t.
11
12AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
13[
14 AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
15 [AC_TRY_COMPILE(
16 [#include <sys/types.h>
17#include <inttypes.h>],
18 [uintmax_t i = (uintmax_t) -1; return !i;],
19 [gl_cv_header_inttypes_h=yes],
20 [gl_cv_header_inttypes_h=no])])
21 if test $gl_cv_header_inttypes_h = yes; then
22 AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
23 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
24 and declares uintmax_t. ])
25 fi
26])
027
=== added file 'm4/lcmessage.m4'
--- m4/lcmessage.m4 1970-01-01 00:00:00 +0000
+++ m4/lcmessage.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,31 @@
1# lcmessage.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 1995-2002, 2004-2005, 2008-2010 Free Software Foundation,
3dnl Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7dnl
8dnl This file can can be used in projects which are not available under
9dnl the GNU General Public License or the GNU Library General Public
10dnl License but which still want to provide support for the GNU gettext
11dnl functionality.
12dnl Please note that the actual code of the GNU gettext library is covered
13dnl by the GNU Library General Public License, and the rest of the GNU
14dnl gettext package package is covered by the GNU General Public License.
15dnl They are *not* in the public domain.
16
17dnl Authors:
18dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
19
20# Check whether LC_MESSAGES is available in <locale.h>.
21
22AC_DEFUN([gt_LC_MESSAGES],
23[
24 AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
25 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
26 [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])])
27 if test $gt_cv_val_LC_MESSAGES = yes; then
28 AC_DEFINE([HAVE_LC_MESSAGES], [1],
29 [Define if your <locale.h> file defines LC_MESSAGES.])
30 fi
31])
032
=== added file 'm4/lock.m4'
--- m4/lock.m4 1970-01-01 00:00:00 +0000
+++ m4/lock.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,37 @@
1# lock.m4 serial 10 (gettext-0.18)
2dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_DEFUN([gl_LOCK],
10[
11 AC_REQUIRE([gl_THREADLIB])
12 if test "$gl_threads_api" = posix; then
13 # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
14 # pthread_rwlock_* functions.
15 AC_CHECK_TYPE([pthread_rwlock_t],
16 [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
17 [Define if the POSIX multithreading library has read/write locks.])],
18 [],
19 [#include <pthread.h>])
20 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
21 AC_TRY_COMPILE([#include <pthread.h>],
22 [#if __FreeBSD__ == 4
23error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
24#else
25int x = (int)PTHREAD_MUTEX_RECURSIVE;
26return !x;
27#endif],
28 [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
29 [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
30 fi
31 gl_PREREQ_LOCK
32])
33
34# Prerequisites of lib/lock.c.
35AC_DEFUN([gl_PREREQ_LOCK], [
36 AC_REQUIRE([AC_C_INLINE])
37])
038
=== added file 'm4/longlong.m4'
--- m4/longlong.m4 1970-01-01 00:00:00 +0000
+++ m4/longlong.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,106 @@
1# longlong.m4 serial 14
2dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Paul Eggert.
8
9# Define HAVE_LONG_LONG_INT if 'long long int' works.
10# This fixes a bug in Autoconf 2.61, but can be removed once we
11# assume 2.62 everywhere.
12
13# Note: If the type 'long long int' exists but is only 32 bits large
14# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
15# defined. In this case you can treat 'long long int' like 'long int'.
16
17AC_DEFUN([AC_TYPE_LONG_LONG_INT],
18[
19 AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
20 [AC_LINK_IFELSE(
21 [_AC_TYPE_LONG_LONG_SNIPPET],
22 [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
23 dnl If cross compiling, assume the bug isn't important, since
24 dnl nobody cross compiles for this platform as far as we know.
25 AC_RUN_IFELSE(
26 [AC_LANG_PROGRAM(
27 [[@%:@include <limits.h>
28 @%:@ifndef LLONG_MAX
29 @%:@ define HALF \
30 (1LL << (sizeof (long long int) * CHAR_BIT - 2))
31 @%:@ define LLONG_MAX (HALF - 1 + HALF)
32 @%:@endif]],
33 [[long long int n = 1;
34 int i;
35 for (i = 0; ; i++)
36 {
37 long long int m = n << i;
38 if (m >> i != n)
39 return 1;
40 if (LLONG_MAX / 2 < m)
41 break;
42 }
43 return 0;]])],
44 [ac_cv_type_long_long_int=yes],
45 [ac_cv_type_long_long_int=no],
46 [ac_cv_type_long_long_int=yes])],
47 [ac_cv_type_long_long_int=no])])
48 if test $ac_cv_type_long_long_int = yes; then
49 AC_DEFINE([HAVE_LONG_LONG_INT], [1],
50 [Define to 1 if the system has the type `long long int'.])
51 fi
52])
53
54# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
55# This fixes a bug in Autoconf 2.61, but can be removed once we
56# assume 2.62 everywhere.
57
58# Note: If the type 'unsigned long long int' exists but is only 32 bits
59# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
60# will not be defined. In this case you can treat 'unsigned long long int'
61# like 'unsigned long int'.
62
63AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
64[
65 AC_CACHE_CHECK([for unsigned long long int],
66 [ac_cv_type_unsigned_long_long_int],
67 [AC_LINK_IFELSE(
68 [_AC_TYPE_LONG_LONG_SNIPPET],
69 [ac_cv_type_unsigned_long_long_int=yes],
70 [ac_cv_type_unsigned_long_long_int=no])])
71 if test $ac_cv_type_unsigned_long_long_int = yes; then
72 AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
73 [Define to 1 if the system has the type `unsigned long long int'.])
74 fi
75])
76
77# Expands to a C program that can be used to test for simultaneous support
78# of 'long long' and 'unsigned long long'. We don't want to say that
79# 'long long' is available if 'unsigned long long' is not, or vice versa,
80# because too many programs rely on the symmetry between signed and unsigned
81# integer types (excluding 'bool').
82AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
83[
84 AC_LANG_PROGRAM(
85 [[/* For now, do not test the preprocessor; as of 2007 there are too many
86 implementations with broken preprocessors. Perhaps this can
87 be revisited in 2012. In the meantime, code should not expect
88 #if to work with literals wider than 32 bits. */
89 /* Test literals. */
90 long long int ll = 9223372036854775807ll;
91 long long int nll = -9223372036854775807LL;
92 unsigned long long int ull = 18446744073709551615ULL;
93 /* Test constant expressions. */
94 typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
95 ? 1 : -1)];
96 typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
97 ? 1 : -1)];
98 int i = 63;]],
99 [[/* Test availability of runtime routines for shift and division. */
100 long long int llmax = 9223372036854775807ll;
101 unsigned long long int ullmax = 18446744073709551615ull;
102 return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
103 | (llmax / ll) | (llmax % ll)
104 | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
105 | (ullmax / ull) | (ullmax % ull));]])
106])
0107
=== added file 'm4/printf-posix.m4'
--- m4/printf-posix.m4 1970-01-01 00:00:00 +0000
+++ m4/printf-posix.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,45 @@
1# printf-posix.m4 serial 5 (gettext-0.18)
2dnl Copyright (C) 2003, 2007, 2009-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8dnl Test whether the printf() function supports POSIX/XSI format strings with
9dnl positions.
10
11AC_DEFUN([gt_PRINTF_POSIX],
12[
13 AC_REQUIRE([AC_PROG_CC])
14 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
15 gt_cv_func_printf_posix,
16 [
17 AC_TRY_RUN([
18#include <stdio.h>
19#include <string.h>
20/* The string "%2$d %1$d", with dollar characters protected from the shell's
21 dollar expansion (possibly an autoconf bug). */
22static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
23static char buf[100];
24int main ()
25{
26 sprintf (buf, format, 33, 55);
27 return (strcmp (buf, "55 33") != 0);
28}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
29 [
30 AC_EGREP_CPP([notposix], [
31#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
32 notposix
33#endif
34 ],
35 [gt_cv_func_printf_posix="guessing no"],
36 [gt_cv_func_printf_posix="guessing yes"])
37 ])
38 ])
39 case $gt_cv_func_printf_posix in
40 *yes)
41 AC_DEFINE([HAVE_POSIX_PRINTF], [1],
42 [Define if your printf() function supports format strings with positions.])
43 ;;
44 esac
45])
046
=== added file 'm4/size_max.m4'
--- m4/size_max.m4 1970-01-01 00:00:00 +0000
+++ m4/size_max.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,75 @@
1# size_max.m4 serial 9
2dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_DEFUN([gl_SIZE_MAX],
10[
11 AC_CHECK_HEADERS([stdint.h])
12 dnl First test whether the system already has SIZE_MAX.
13 AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
14 gl_cv_size_max=
15 AC_EGREP_CPP([Found it], [
16#include <limits.h>
17#if HAVE_STDINT_H
18#include <stdint.h>
19#endif
20#ifdef SIZE_MAX
21Found it
22#endif
23], [gl_cv_size_max=yes])
24 if test -z "$gl_cv_size_max"; then
25 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
26 dnl than the type 'unsigned long'. Try hard to find a definition that can
27 dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
28 AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
29 [#include <stddef.h>
30#include <limits.h>], [size_t_bits_minus_1=])
31 AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
32 [#include <stddef.h>], [fits_in_uint=])
33 if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
34 if test $fits_in_uint = 1; then
35 dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
36 dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
37 AC_TRY_COMPILE([#include <stddef.h>
38 extern size_t foo;
39 extern unsigned long foo;
40 ], [], [fits_in_uint=0])
41 fi
42 dnl We cannot use 'expr' to simplify this expression, because 'expr'
43 dnl works only with 'long' integers in the host environment, while we
44 dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
45 if test $fits_in_uint = 1; then
46 gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
47 else
48 gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
49 fi
50 else
51 dnl Shouldn't happen, but who knows...
52 gl_cv_size_max='((size_t)~(size_t)0)'
53 fi
54 fi
55 ])
56 if test "$gl_cv_size_max" != yes; then
57 AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
58 [Define as the maximum value of type 'size_t', if the system doesn't define it.])
59 fi
60 dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
61 dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
62 dnl #define by AC_DEFINE_UNQUOTED.
63 AH_VERBATIM([SIZE_MAX],
64[/* Define as the maximum value of type 'size_t', if the system doesn't define
65 it. */
66#ifndef SIZE_MAX
67# undef SIZE_MAX
68#endif])
69])
70
71dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
72dnl Remove this when we can assume autoconf >= 2.61.
73m4_ifdef([AC_COMPUTE_INT], [], [
74 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
75])
076
=== added file 'm4/stdint_h.m4'
--- m4/stdint_h.m4 1970-01-01 00:00:00 +0000
+++ m4/stdint_h.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,26 @@
1# stdint_h.m4 serial 8
2dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Paul Eggert.
8
9# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
10# doesn't clash with <sys/types.h>, and declares uintmax_t.
11
12AC_DEFUN([gl_AC_HEADER_STDINT_H],
13[
14 AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
15 [AC_TRY_COMPILE(
16 [#include <sys/types.h>
17#include <stdint.h>],
18 [uintmax_t i = (uintmax_t) -1; return !i;],
19 [gl_cv_header_stdint_h=yes],
20 [gl_cv_header_stdint_h=no])])
21 if test $gl_cv_header_stdint_h = yes; then
22 AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
23 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
24 and declares uintmax_t. ])
25 fi
26])
027
=== added file 'm4/threadlib.m4'
--- m4/threadlib.m4 1970-01-01 00:00:00 +0000
+++ m4/threadlib.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,347 @@
1# threadlib.m4 serial 5 (gettext-0.18)
2dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9dnl gl_THREADLIB
10dnl ------------
11dnl Tests for a multithreading library to be used.
12dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
13dnl USE_PTH_THREADS, USE_WIN32_THREADS
14dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
15dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
16dnl libtool).
17dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
18dnl programs that really need multithread functionality. The difference
19dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
20dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
21dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
22dnl multithread-safe programs.
23
24AC_DEFUN([gl_THREADLIB_EARLY],
25[
26 AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
27])
28
29dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
30
31AC_DEFUN([gl_THREADLIB_EARLY_BODY],
32[
33 dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
34 dnl influences the result of the autoconf tests that test for *_unlocked
35 dnl declarations, on AIX 5 at least. Therefore it must come early.
36 AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
37 AC_BEFORE([$0], [gl_ARGP])dnl
38
39 AC_REQUIRE([AC_CANONICAL_HOST])
40 dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
41 dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
42 dnl AC_GNU_SOURCE.
43 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
44 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
45 [AC_REQUIRE([AC_GNU_SOURCE])])
46 dnl Check for multithreading.
47 m4_divert_text([DEFAULTS], [gl_use_threads_default=])
48 AC_ARG_ENABLE([threads],
49AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
50AC_HELP_STRING([--disable-threads], [build without multithread safety]),
51 [gl_use_threads=$enableval],
52 [if test -n "$gl_use_threads_default"; then
53 gl_use_threads="$gl_use_threads_default"
54 else
55changequote(,)dnl
56 case "$host_os" in
57 dnl Disable multithreading by default on OSF/1, because it interferes
58 dnl with fork()/exec(): When msgexec is linked with -lpthread, its
59 dnl child process gets an endless segmentation fault inside execvp().
60 dnl Disable multithreading by default on Cygwin 1.5.x, because it has
61 dnl bugs that lead to endless loops or crashes. See
62 dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
63 osf*) gl_use_threads=no ;;
64 cygwin*)
65 case `uname -r` in
66 1.[0-5].*) gl_use_threads=no ;;
67 *) gl_use_threads=yes ;;
68 esac
69 ;;
70 *) gl_use_threads=yes ;;
71 esac
72changequote([,])dnl
73 fi
74 ])
75 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
76 # For using <pthread.h>:
77 case "$host_os" in
78 osf*)
79 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
80 # groks <pthread.h>. cc also understands the flag -pthread, but
81 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
82 # 2. putting a flag into CPPFLAGS that has an effect on the linker
83 # causes the AC_TRY_LINK test below to succeed unexpectedly,
84 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
85 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
86 ;;
87 esac
88 # Some systems optimize for single-threaded programs by default, and
89 # need special flags to disable these optimizations. For example, the
90 # definition of 'errno' in <errno.h>.
91 case "$host_os" in
92 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
93 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
94 esac
95 fi
96])
97
98dnl The guts of gl_THREADLIB. Needs to be expanded only once.
99
100AC_DEFUN([gl_THREADLIB_BODY],
101[
102 AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
103 gl_threads_api=none
104 LIBTHREAD=
105 LTLIBTHREAD=
106 LIBMULTITHREAD=
107 LTLIBMULTITHREAD=
108 if test "$gl_use_threads" != no; then
109 dnl Check whether the compiler and linker support weak declarations.
110 AC_CACHE_CHECK([whether imported symbols can be declared weak],
111 [gl_cv_have_weak],
112 [gl_cv_have_weak=no
113 dnl First, test whether the compiler accepts it syntactically.
114 AC_TRY_LINK([extern void xyzzy ();
115#pragma weak xyzzy], [xyzzy();], [gl_cv_have_weak=maybe])
116 if test $gl_cv_have_weak = maybe; then
117 dnl Second, test whether it actually works. On Cygwin 1.7.2, with
118 dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
119 AC_TRY_RUN([
120#include <stdio.h>
121#pragma weak fputs
122int main ()
123{
124 return (fputs == NULL);
125}], [gl_cv_have_weak=yes], [gl_cv_have_weak=no],
126 [dnl When cross-compiling, assume that only ELF platforms support
127 dnl weak symbols.
128 AC_EGREP_CPP([Extensible Linking Format],
129 [#ifdef __ELF__
130 Extensible Linking Format
131 #endif
132 ],
133 [gl_cv_have_weak="guessing yes"],
134 [gl_cv_have_weak="guessing no"])
135 ])
136 fi
137 ])
138 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
139 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
140 # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
141 AC_CHECK_HEADER([pthread.h],
142 [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
143 if test "$gl_have_pthread_h" = yes; then
144 # Other possible tests:
145 # -lpthreads (FSU threads, PCthreads)
146 # -lgthreads
147 gl_have_pthread=
148 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
149 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
150 # the second one only in libpthread, and lock.c needs it.
151 AC_TRY_LINK([#include <pthread.h>],
152 [pthread_mutex_lock((pthread_mutex_t*)0);
153 pthread_mutexattr_init((pthread_mutexattr_t*)0);],
154 [gl_have_pthread=yes])
155 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
156 # since it is defined as a macro on OSF/1.)
157 if test -n "$gl_have_pthread"; then
158 # The program links fine without libpthread. But it may actually
159 # need to link with libpthread in order to create multiple threads.
160 AC_CHECK_LIB([pthread], [pthread_kill],
161 [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
162 # On Solaris and HP-UX, most pthread functions exist also in libc.
163 # Therefore pthread_in_use() needs to actually try to create a
164 # thread: pthread_create from libc will fail, whereas
165 # pthread_create will actually create a thread.
166 case "$host_os" in
167 solaris* | hpux*)
168 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
169 [Define if the pthread_in_use() detection is hard.])
170 esac
171 ])
172 else
173 # Some library is needed. Try libpthread and libc_r.
174 AC_CHECK_LIB([pthread], [pthread_kill],
175 [gl_have_pthread=yes
176 LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
177 LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
178 if test -z "$gl_have_pthread"; then
179 # For FreeBSD 4.
180 AC_CHECK_LIB([c_r], [pthread_kill],
181 [gl_have_pthread=yes
182 LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
183 LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
184 fi
185 fi
186 if test -n "$gl_have_pthread"; then
187 gl_threads_api=posix
188 AC_DEFINE([USE_POSIX_THREADS], [1],
189 [Define if the POSIX multithreading library can be used.])
190 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
191 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
192 AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
193 [Define if references to the POSIX multithreading library should be made weak.])
194 LIBTHREAD=
195 LTLIBTHREAD=
196 fi
197 fi
198 fi
199 fi
200 fi
201 if test -z "$gl_have_pthread"; then
202 if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
203 gl_have_solaristhread=
204 gl_save_LIBS="$LIBS"
205 LIBS="$LIBS -lthread"
206 AC_TRY_LINK([#include <thread.h>
207#include <synch.h>],
208 [thr_self();],
209 [gl_have_solaristhread=yes])
210 LIBS="$gl_save_LIBS"
211 if test -n "$gl_have_solaristhread"; then
212 gl_threads_api=solaris
213 LIBTHREAD=-lthread
214 LTLIBTHREAD=-lthread
215 LIBMULTITHREAD="$LIBTHREAD"
216 LTLIBMULTITHREAD="$LTLIBTHREAD"
217 AC_DEFINE([USE_SOLARIS_THREADS], [1],
218 [Define if the old Solaris multithreading library can be used.])
219 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
220 AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
221 [Define if references to the old Solaris multithreading library should be made weak.])
222 LIBTHREAD=
223 LTLIBTHREAD=
224 fi
225 fi
226 fi
227 fi
228 if test "$gl_use_threads" = pth; then
229 gl_save_CPPFLAGS="$CPPFLAGS"
230 AC_LIB_LINKFLAGS([pth])
231 gl_have_pth=
232 gl_save_LIBS="$LIBS"
233 LIBS="$LIBS -lpth"
234 AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes])
235 LIBS="$gl_save_LIBS"
236 if test -n "$gl_have_pth"; then
237 gl_threads_api=pth
238 LIBTHREAD="$LIBPTH"
239 LTLIBTHREAD="$LTLIBPTH"
240 LIBMULTITHREAD="$LIBTHREAD"
241 LTLIBMULTITHREAD="$LTLIBTHREAD"
242 AC_DEFINE([USE_PTH_THREADS], [1],
243 [Define if the GNU Pth multithreading library can be used.])
244 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
245 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
246 AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
247 [Define if references to the GNU Pth multithreading library should be made weak.])
248 LIBTHREAD=
249 LTLIBTHREAD=
250 fi
251 fi
252 else
253 CPPFLAGS="$gl_save_CPPFLAGS"
254 fi
255 fi
256 if test -z "$gl_have_pthread"; then
257 if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
258 if { case "$host_os" in
259 mingw*) true;;
260 *) false;;
261 esac
262 }; then
263 gl_threads_api=win32
264 AC_DEFINE([USE_WIN32_THREADS], [1],
265 [Define if the Win32 multithreading API can be used.])
266 fi
267 fi
268 fi
269 fi
270 AC_MSG_CHECKING([for multithread API to use])
271 AC_MSG_RESULT([$gl_threads_api])
272 AC_SUBST([LIBTHREAD])
273 AC_SUBST([LTLIBTHREAD])
274 AC_SUBST([LIBMULTITHREAD])
275 AC_SUBST([LTLIBMULTITHREAD])
276])
277
278AC_DEFUN([gl_THREADLIB],
279[
280 AC_REQUIRE([gl_THREADLIB_EARLY])
281 AC_REQUIRE([gl_THREADLIB_BODY])
282])
283
284
285dnl gl_DISABLE_THREADS
286dnl ------------------
287dnl Sets the gl_THREADLIB default so that threads are not used by default.
288dnl The user can still override it at installation time, by using the
289dnl configure option '--enable-threads'.
290
291AC_DEFUN([gl_DISABLE_THREADS], [
292 m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
293])
294
295
296dnl Survey of platforms:
297dnl
298dnl Platform Available Compiler Supports test-lock
299dnl flavours option weak result
300dnl --------------- --------- --------- -------- ---------
301dnl Linux 2.4/glibc posix -lpthread Y OK
302dnl
303dnl GNU Hurd/glibc posix
304dnl
305dnl FreeBSD 5.3 posix -lc_r Y
306dnl posix -lkse ? Y
307dnl posix -lpthread ? Y
308dnl posix -lthr Y
309dnl
310dnl FreeBSD 5.2 posix -lc_r Y
311dnl posix -lkse Y
312dnl posix -lthr Y
313dnl
314dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
315dnl
316dnl NetBSD 1.6 --
317dnl
318dnl OpenBSD 3.4 posix -lpthread Y OK
319dnl
320dnl MacOS X 10.[123] posix -lpthread Y OK
321dnl
322dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
323dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
324dnl
325dnl HP-UX 11 posix -lpthread N (cc) OK
326dnl Y (gcc)
327dnl
328dnl IRIX 6.5 posix -lpthread Y 0.5
329dnl
330dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
331dnl
332dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
333dnl -lpthread (gcc) Y
334dnl
335dnl Cygwin posix -lpthread Y OK
336dnl
337dnl Any of the above pth -lpth 0.0
338dnl
339dnl Mingw win32 N OK
340dnl
341dnl BeOS 5 --
342dnl
343dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
344dnl turned off:
345dnl OK if all three tests terminate OK,
346dnl 0.5 if the first test terminates OK but the second one loops endlessly,
347dnl 0.0 if the first test already loops endlessly.
0348
=== added file 'm4/uintmax_t.m4'
--- m4/uintmax_t.m4 1970-01-01 00:00:00 +0000
+++ m4/uintmax_t.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,30 @@
1# uintmax_t.m4 serial 12
2dnl Copyright (C) 1997-2004, 2007-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Paul Eggert.
8
9AC_PREREQ([2.13])
10
11# Define uintmax_t to 'unsigned long' or 'unsigned long long'
12# if it is not already defined in <stdint.h> or <inttypes.h>.
13
14AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
15[
16 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
17 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
18 if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
19 AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
20 test $ac_cv_type_unsigned_long_long_int = yes \
21 && ac_type='unsigned long long' \
22 || ac_type='unsigned long'
23 AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
24 [Define to unsigned long or unsigned long long
25 if <stdint.h> and <inttypes.h> don't define.])
26 else
27 AC_DEFINE([HAVE_UINTMAX_T], [1],
28 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
29 fi
30])
031
=== added file 'm4/wchar_t.m4'
--- m4/wchar_t.m4 1970-01-01 00:00:00 +0000
+++ m4/wchar_t.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,20 @@
1# wchar_t.m4 serial 3 (gettext-0.18)
2dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8dnl Test whether <stddef.h> has the 'wchar_t' type.
9dnl Prerequisite: AC_PROG_CC
10
11AC_DEFUN([gt_TYPE_WCHAR_T],
12[
13 AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
14 [AC_TRY_COMPILE([#include <stddef.h>
15 wchar_t foo = (wchar_t)'\0';], ,
16 [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])])
17 if test $gt_cv_c_wchar_t = yes; then
18 AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
19 fi
20])
021
=== added file 'm4/wint_t.m4'
--- m4/wint_t.m4 1970-01-01 00:00:00 +0000
+++ m4/wint_t.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,28 @@
1# wint_t.m4 serial 4 (gettext-0.18)
2dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8dnl Test whether <wchar.h> has the 'wint_t' type.
9dnl Prerequisite: AC_PROG_CC
10
11AC_DEFUN([gt_TYPE_WINT_T],
12[
13 AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
14 [AC_TRY_COMPILE([
15/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
16 <wchar.h>.
17 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
18 before <wchar.h>. */
19#include <stddef.h>
20#include <stdio.h>
21#include <time.h>
22#include <wchar.h>
23 wint_t foo = (wchar_t)'\0';], ,
24 [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])])
25 if test $gt_cv_c_wint_t = yes; then
26 AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
27 fi
28])
029
=== added file 'm4/xsize.m4'
--- m4/xsize.m4 1970-01-01 00:00:00 +0000
+++ m4/xsize.m4 2013-07-06 19:13:27 +0000
@@ -0,0 +1,13 @@
1# xsize.m4 serial 4
2dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_XSIZE],
8[
9 dnl Prerequisites of lib/xsize.h.
10 AC_REQUIRE([gl_SIZE_MAX])
11 AC_REQUIRE([AC_C_INLINE])
12 AC_CHECK_HEADERS([stdint.h])
13])

Subscribers

People subscribed via source and target branches

to all changes: