aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore60
-rw-r--r--m4/.gitignore6
-rw-r--r--m4/ChangeLog86
-rw-r--r--m4/Makefile.am0
-rw-r--r--m4/absolute-header.m477
-rw-r--r--m4/align.m432
-rw-r--r--m4/ax_compare_version.m4177
-rw-r--r--m4/ax_lib_postgresql.m4247
-rw-r--r--m4/codeset.m423
-rw-r--r--m4/extensions.m4118
-rw-r--r--m4/extern-inline.m470
-rw-r--r--m4/fcntl-o.m4134
-rw-r--r--m4/freetype2.m4178
-rw-r--r--m4/glib-2.0.m4212
-rw-r--r--m4/glib-gettext.m4380
-rw-r--r--m4/glibc2.m431
-rw-r--r--m4/glibc21.m434
-rw-r--r--m4/gnulib-cache.m435
-rw-r--r--m4/gtk-2.0.m4196
-rw-r--r--m4/intdiv0.m487
-rw-r--r--m4/intl.m4298
-rw-r--r--m4/intldir.m419
-rw-r--r--m4/intlmacosx.m456
-rw-r--r--m4/intmax.m436
-rw-r--r--m4/inttypes-pri.m442
-rw-r--r--m4/inttypes.m427
-rw-r--r--m4/inttypes_h.m429
-rw-r--r--m4/isc-posix.m426
-rw-r--r--m4/lcmessage.m435
-rw-r--r--m4/libcurl.m4251
-rw-r--r--m4/libgcrypt.m4122
-rw-r--r--m4/libgnurl.m4266
-rw-r--r--m4/libunistring.m4150
-rw-r--r--m4/libxml2.m4188
-rw-r--r--m4/lock.m442
-rw-r--r--m4/longdouble.m431
-rw-r--r--m4/longlong.m4113
-rw-r--r--m4/printf-posix.m448
-rw-r--r--m4/signed.m419
-rw-r--r--m4/size_max.m479
-rw-r--r--m4/stdint_h.m427
-rw-r--r--m4/threadlib.m4389
-rw-r--r--m4/uintmax_t.m430
-rw-r--r--m4/ulonglong.m448
-rw-r--r--m4/visibility.m477
-rw-r--r--m4/wint_t.m432
-rw-r--r--m4/xsize.m412
-rw-r--r--pkgconfig/gnunetsocial.pc.in12
48 files changed, 4687 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3465407
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,60 @@
1*~
2\#*\#
3*.bak
4*.a
5*.la
6*.lo
7*.log
8*.o
9*.orig
10*.rej
11*.swp
12*.trs
13*.kdev4
14.deps/
15.libs/
16.svn/
17Makefile
18Makefile.in
19aclocal.m4
20autom4te.cache/
21compile
22config.guess
23config.log
24config.status
25config.sub
26configure
27depcomp
28gnunet_config.h
29gnunet_config.h.in
30install-sh
31libtool
32ltmain.sh
33lynXified.*
34missing
35po/*.gmo
36pkgconfig/*.pc
37src/*/*.conf
38stamp-h1
39test-driver
40INSTALL
41confdefs.h
42confdefs.c
43confdefs.err
44src/namestore/test_namestore_api_zone_to_name
45src/credential/gnunet-credential
46src/credential/gnunet-service-credential
47src/identity-provider/gnunet-idp
48*.patch
49src/namestore/perf_namestore_api_zone_iteration_flat
50src/namestore/perf_namestore_api_zone_iteration_postgres
51src/namestore/perf_namestore_api_zone_iteration_sqlite
52python-lint.log
53flake8.log
54# for pytest created data:
55.cache/
56__pycache__/
57build-aux/
58gnunet_secushare_config.h
59gnunet_secushare_config.h.in
60po/gnunet-secushare.pot
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 0000000..c4c8d29
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1,6 @@
1libtool.m4
2ltoptions.m4
3ltsugar.m4
4ltversion.m4
5lt~obsolete.m4
6wchar_t.m4
diff --git a/m4/ChangeLog b/m4/ChangeLog
new file mode 100644
index 0000000..9e4eb03
--- /dev/null
+++ b/m4/ChangeLog
@@ -0,0 +1,86 @@
12015-06-27 gettextize <bug-gnu-gettext@gnu.org>
2
3 * gettext.m4: Upgrade to gettext-0.18.3.
4 * iconv.m4: Upgrade to gettext-0.18.3.
5 * lib-ld.m4: Upgrade to gettext-0.18.3.
6 * lib-link.m4: Upgrade to gettext-0.18.3.
7 * lib-prefix.m4: Upgrade to gettext-0.18.3.
8 * nls.m4: Upgrade to gettext-0.18.3.
9 * po.m4: Upgrade to gettext-0.18.3.
10 * progtest.m4: Upgrade to gettext-0.18.3.
11
122015-05-18 gettextize <bug-gnu-gettext@gnu.org>
13
14 * iconv.m4: Upgrade to gettext-0.19.3.
15 * lib-ld.m4: Upgrade to gettext-0.19.3.
16 * lib-link.m4: Upgrade to gettext-0.19.3.
17 * lib-prefix.m4: Upgrade to gettext-0.19.3.
18 * nls.m4: Upgrade to gettext-0.19.3.
19 * progtest.m4: Upgrade to gettext-0.19.3.
20
212007-02-08 gettextize <bug-gnu-gettext@gnu.org>
22
23 * gettext.m4: Upgrade to gettext-0.16.1.
24 * iconv.m4: Upgrade to gettext-0.16.1.
25 * lib-ld.m4: Upgrade to gettext-0.16.1.
26 * lib-link.m4: Upgrade to gettext-0.16.1.
27 * lib-prefix.m4: Upgrade to gettext-0.16.1.
28 * nls.m4: Upgrade to gettext-0.16.1.
29 * po.m4: Upgrade to gettext-0.16.1.
30 * progtest.m4: Upgrade to gettext-0.16.1.
31 * codeset.m4: Upgrade to gettext-0.16.1.
32 * glibc2.m4: New file, from gettext-0.16.1.
33 * glibc21.m4: Upgrade to gettext-0.16.1.
34 * intdiv0.m4: Upgrade to gettext-0.16.1.
35 * intl.m4: New file, from gettext-0.16.1.
36 * intldir.m4: New file, from gettext-0.16.1.
37 * intmax.m4: Upgrade to gettext-0.16.1.
38 * inttypes_h.m4: Upgrade to gettext-0.16.1.
39 * inttypes-pri.m4: Upgrade to gettext-0.16.1.
40 * lcmessage.m4: Upgrade to gettext-0.16.1.
41 * lock.m4: New file, from gettext-0.16.1.
42 * longdouble.m4: Upgrade to gettext-0.16.1.
43 * longlong.m4: Upgrade to gettext-0.16.1.
44 * printf-posix.m4: Upgrade to gettext-0.16.1.
45 * size_max.m4: Upgrade to gettext-0.16.1.
46 * stdint_h.m4: Upgrade to gettext-0.16.1.
47 * uintmax_t.m4: Upgrade to gettext-0.16.1.
48 * ulonglong.m4: Upgrade to gettext-0.16.1.
49 * visibility.m4: New file, from gettext-0.16.1.
50 * wchar_t.m4: Upgrade to gettext-0.16.1.
51 * wint_t.m4: Upgrade to gettext-0.16.1.
52 * xsize.m4: Upgrade to gettext-0.16.1.
53 * Makefile.am (EXTRA_DIST): Add the new files.
54
552004-08-21 gettextize <bug-gnu-gettext@gnu.org>
56
57 * codeset.m4: New file, from gettext-0.14.
58 * gettext.m4: New file, from gettext-0.14.
59 * glibc21.m4: New file, from gettext-0.14.
60 * iconv.m4: New file, from gettext-0.14.
61 * intdiv0.m4: New file, from gettext-0.14.
62 * intmax.m4: New file, from gettext-0.14.
63 * inttypes.m4: New file, from gettext-0.14.
64 * inttypes_h.m4: New file, from gettext-0.14.
65 * inttypes-pri.m4: New file, from gettext-0.14.
66 * isc-posix.m4: New file, from gettext-0.14.
67 * lcmessage.m4: New file, from gettext-0.14.
68 * lib-ld.m4: New file, from gettext-0.14.
69 * lib-link.m4: New file, from gettext-0.14.
70 * lib-prefix.m4: New file, from gettext-0.14.
71 * longdouble.m4: New file, from gettext-0.14.
72 * longlong.m4: New file, from gettext-0.14.
73 * nls.m4: New file, from gettext-0.14.
74 * po.m4: New file, from gettext-0.14.
75 * printf-posix.m4: New file, from gettext-0.14.
76 * progtest.m4: New file, from gettext-0.14.
77 * signed.m4: New file, from gettext-0.14.
78 * size_max.m4: New file, from gettext-0.14.
79 * stdint_h.m4: New file, from gettext-0.14.
80 * uintmax_t.m4: New file, from gettext-0.14.
81 * ulonglong.m4: New file, from gettext-0.14.
82 * wchar_t.m4: New file, from gettext-0.14.
83 * wint_t.m4: New file, from gettext-0.14.
84 * xsize.m4: New file, from gettext-0.14.
85 * Makefile.am: New file.
86
diff --git a/m4/Makefile.am b/m4/Makefile.am
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/m4/Makefile.am
diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4
new file mode 100644
index 0000000..f576d34
--- /dev/null
+++ b/m4/absolute-header.m4
@@ -0,0 +1,77 @@
1# absolute-header.m4 serial 12
2dnl Copyright (C) 2006-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 Derek Price.
8
9# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
10# ---------------------------------------
11# Find the absolute name of a header file, testing first if the header exists.
12# If the header were sys/inttypes.h, this macro would define
13# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h
14# in config.h
15# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
16# The three "///" are to pacify Sun C 5.8, which otherwise would say
17# "warning: #include of /usr/include/... may be non-portable".
18# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
19# Note: This macro assumes that the header file is not empty after
20# preprocessing, i.e. it does not only define preprocessor macros but also
21# provides some type/enum definitions or function/variable declarations.
22AC_DEFUN([gl_ABSOLUTE_HEADER],
23[AC_REQUIRE([AC_CANONICAL_HOST])
24AC_LANG_PREPROC_REQUIRE()dnl
25m4_foreach_w([gl_HEADER_NAME], [$1],
26 [AS_VAR_PUSHDEF([gl_absolute_header],
27 [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
28 AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
29 m4_defn([gl_absolute_header]),
30 [AS_VAR_PUSHDEF([ac_header_exists],
31 [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
32 AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
33 if test AS_VAR_GET(ac_header_exists) = yes; then
34 gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
35 fi
36 AS_VAR_POPDEF([ac_header_exists])dnl
37 ])dnl
38 AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
39 ["AS_VAR_GET(gl_absolute_header)"],
40 [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
41 AS_VAR_POPDEF([gl_absolute_header])dnl
42])dnl
43])# gl_ABSOLUTE_HEADER
44
45# gl_ABSOLUTE_HEADER_ONE(HEADER)
46# ------------------------------
47# Like gl_ABSOLUTE_HEADER, except that:
48# - it assumes that the header exists,
49# - it uses the current CPPFLAGS,
50# - it does not cache the result,
51# - it is silent.
52AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
53[
54 AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])])
55 dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
56 dnl that contain only a #include of other header files and no
57 dnl non-comment tokens of their own. This leads to a failure to
58 dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
59 dnl and others. The workaround is to force preservation of comments
60 dnl through option -C. This ensures all necessary #line directives
61 dnl are present. GCC supports option -C as well.
62 case "$host_os" in
63 aix*) gl_absname_cpp="$ac_cpp -C" ;;
64 *) gl_absname_cpp="$ac_cpp" ;;
65 esac
66 dnl eval is necessary to expand gl_absname_cpp.
67 dnl Ultrix and Pyramid sh refuse to redirect output of eval,
68 dnl so use subshell.
69 AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]),
70[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
71sed -n '\#/$1#{
72 s#.*"\(.*/$1\)".*#\1#
73 s#^/[^/]#//&#
74 p
75 q
76}'`])
77])
diff --git a/m4/align.m4 b/m4/align.m4
new file mode 100644
index 0000000..7bcbae8
--- /dev/null
+++ b/m4/align.m4
@@ -0,0 +1,32 @@
1# align.m4
2dnl Copyright (C) 2008 Christian Grothoff
3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License. As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8
9# Define HAVE_UNALIGNED_64_ACCESS if reading a 64-bit value at a 32-bit aligned offset works
10# Note that the program intentionally causes a SIGBUS (so you may
11# see some message along those lines on the console).
12AC_DEFUN([AC_UNALIGNED_64_ACCESS],
13[AC_CACHE_CHECK([whether unaligned 64-bit access works],
14 ac_cv_unaligned_64_access,
15 [
16 AC_RUN_IFELSE([AC_LANG_PROGRAM([[struct S { int a,b,c;};]],
17 [[struct S s = {0,0,0}; long long * p = (long long *) &s.b;
18 void *bp = malloc (50);
19 long long x = *p;
20 long long *be = (long long*) &bp[1];
21 long long y = *be;
22 return (int) x*y;]])],
23 ac_cv_unaligned_64_access=yes,
24 ac_cv_unaligned_64_access=no,
25 ac_cv_unaligned_64_access=no)
26 ])
27 case "$ac_cv_unaligned_64_access" in
28 *yes) value=1;;
29 *) value=0;;
30 esac
31 AC_DEFINE_UNQUOTED([HAVE_UNALIGNED_64_ACCESS], $value, [We can access-64 bit values that are only 32-bit aligned])
32])
diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4
new file mode 100644
index 0000000..ffb4997
--- /dev/null
+++ b/m4/ax_compare_version.m4
@@ -0,0 +1,177 @@
1# ===========================================================================
2# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
8#
9# DESCRIPTION
10#
11# This macro compares two version strings. Due to the various number of
12# minor-version numbers that can exist, and the fact that string
13# comparisons are not compatible with numeric comparisons, this is not
14# necessarily trivial to do in a autoconf script. This macro makes doing
15# these comparisons easy.
16#
17# The six basic comparisons are available, as well as checking equality
18# limited to a certain number of minor-version levels.
19#
20# The operator OP determines what type of comparison to do, and can be one
21# of:
22#
23# eq - equal (test A == B)
24# ne - not equal (test A != B)
25# le - less than or equal (test A <= B)
26# ge - greater than or equal (test A >= B)
27# lt - less than (test A < B)
28# gt - greater than (test A > B)
29#
30# Additionally, the eq and ne operator can have a number after it to limit
31# the test to that number of minor versions.
32#
33# eq0 - equal up to the length of the shorter version
34# ne0 - not equal up to the length of the shorter version
35# eqN - equal up to N sub-version levels
36# neN - not equal up to N sub-version levels
37#
38# When the condition is true, shell commands ACTION-IF-TRUE are run,
39# otherwise shell commands ACTION-IF-FALSE are run. The environment
40# variable 'ax_compare_version' is always set to either 'true' or 'false'
41# as well.
42#
43# Examples:
44#
45# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
46# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
47#
48# would both be true.
49#
50# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
51# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
52#
53# would both be false.
54#
55# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
56#
57# would be true because it is only comparing two minor versions.
58#
59# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
60#
61# would be true because it is only comparing the lesser number of minor
62# versions of the two values.
63#
64# Note: The characters that separate the version numbers do not matter. An
65# empty string is the same as version 0. OP is evaluated by autoconf, not
66# configure, so must be a string, not a variable.
67#
68# The author would like to acknowledge Guido Draheim whose advice about
69# the m4_case and m4_ifvaln functions make this macro only include the
70# portions necessary to perform the specific comparison specified by the
71# OP argument in the final configure script.
72#
73# LICENSE
74#
75# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
76#
77# Copying and distribution of this file, with or without modification, are
78# permitted in any medium without royalty provided the copyright notice
79# and this notice are preserved. This file is offered as-is, without any
80# warranty.
81
82#serial 13
83
84dnl #########################################################################
85AC_DEFUN([AX_COMPARE_VERSION], [
86 AC_REQUIRE([AC_PROG_AWK])
87
88 # Used to indicate true or false condition
89 ax_compare_version=false
90
91 # Convert the two version strings to be compared into a format that
92 # allows a simple string comparison. The end result is that a version
93 # string of the form 1.12.5-r617 will be converted to the form
94 # 0001001200050617. In other words, each number is zero padded to four
95 # digits, and non digits are removed.
96 AS_VAR_PUSHDEF([A],[ax_compare_version_A])
97 A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
98 -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
99 -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
100 -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
101 -e 's/[[^0-9]]//g'`
102
103 AS_VAR_PUSHDEF([B],[ax_compare_version_B])
104 B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
105 -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
106 -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
107 -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
108 -e 's/[[^0-9]]//g'`
109
110 dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
111 dnl # then the first line is used to determine if the condition is true.
112 dnl # The sed right after the echo is to remove any indented white space.
113 m4_case(m4_tolower($2),
114 [lt],[
115 ax_compare_version=`echo "x$A
116x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
117 ],
118 [gt],[
119 ax_compare_version=`echo "x$A
120x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
121 ],
122 [le],[
123 ax_compare_version=`echo "x$A
124x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
125 ],
126 [ge],[
127 ax_compare_version=`echo "x$A
128x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
129 ],[
130 dnl Split the operator from the subversion count if present.
131 m4_bmatch(m4_substr($2,2),
132 [0],[
133 # A count of zero means use the length of the shorter version.
134 # Determine the number of characters in A and B.
135 ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
136 ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
137
138 # Set A to no more than B's length and B to no more than A's length.
139 A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
140 B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
141 ],
142 [[0-9]+],[
143 # A count greater than zero means use only that many subversions
144 A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
145 B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
146 ],
147 [.+],[
148 AC_WARNING(
149 [invalid OP numeric parameter: $2])
150 ],[])
151
152 # Pad zeros at end of numbers to make same length.
153 ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
154 B="$B`echo $A | sed 's/./0/g'`"
155 A="$ax_compare_version_tmp_A"
156
157 # Check for equality or inequality as necessary.
158 m4_case(m4_tolower(m4_substr($2,0,2)),
159 [eq],[
160 test "x$A" = "x$B" && ax_compare_version=true
161 ],
162 [ne],[
163 test "x$A" != "x$B" && ax_compare_version=true
164 ],[
165 AC_WARNING([invalid OP parameter: $2])
166 ])
167 ])
168
169 AS_VAR_POPDEF([A])dnl
170 AS_VAR_POPDEF([B])dnl
171
172 dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
173 if test "$ax_compare_version" = "true" ; then
174 m4_ifvaln([$4],[$4],[:])dnl
175 m4_ifvaln([$5],[else $5])dnl
176 fi
177]) dnl AX_COMPARE_VERSION
diff --git a/m4/ax_lib_postgresql.m4 b/m4/ax_lib_postgresql.m4
new file mode 100644
index 0000000..cc8e750
--- /dev/null
+++ b/m4/ax_lib_postgresql.m4
@@ -0,0 +1,247 @@
1# ===========================================================================
2# https://www.gnu.org/software/autoconf-archive/ax_lib_postgresql.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_LIB_POSTGRESQL([MINIMUM-VERSION],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
8#
9# DESCRIPTION
10#
11# This macro provides tests of availability of PostgreSQL 'libpq' library
12# of particular version or newer.
13#
14# AX_LIB_POSTGRESQL macro takes only one argument which is optional. If
15# there is no required version passed, then macro does not run version
16# test.
17#
18# The --with-postgresql option takes one of three possible values:
19#
20# no - do not check for PostgreSQL client library
21#
22# yes - do check for PostgreSQL library in standard locations (pg_config
23# should be in the PATH)
24#
25# path - complete path to pg_config utility, use this option if pg_config
26# can't be found in the PATH (You could set also PG_CONFIG variable)
27#
28# This macro calls:
29#
30# AC_SUBST(POSTGRESQL_CPPFLAGS)
31# AC_SUBST(POSTGRESQL_LDFLAGS)
32# AC_SUBST(POSTGRESQL_LIBS)
33# AC_SUBST(POSTGRESQL_VERSION)
34#
35# And sets:
36#
37# HAVE_POSTGRESQL
38#
39# It execute if found ACTION-IF-FOUND (empty by default) and
40# ACTION-IF-NOT-FOUND (AC_MSG_FAILURE by default) if not found.
41#
42# LICENSE
43#
44# Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
45# Copyright (c) 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
46# Copyright (c) 2018 Bastien Roucaries <rouca@debian.org>
47#
48# Copying and distribution of this file, with or without modification, are
49# permitted in any medium without royalty provided the copyright notice
50# and this notice are preserved. This file is offered as-is, without any
51# warranty.
52
53#serial 22
54
55AC_DEFUN([_AX_LIB_POSTGRESQL_OLD],[
56 found_postgresql="no"
57 _AX_LIB_POSTGRESQL_OLD_fail="no"
58 while true; do
59 AC_CACHE_CHECK([for the pg_config program], [ac_cv_path_PG_CONFIG],
60 [AC_PATH_PROGS_FEATURE_CHECK([PG_CONFIG], [pg_config],
61 [[ac_cv_path_PG_CONFIG="";$ac_path_PG_CONFIG --includedir > /dev/null \
62 && ac_cv_path_PG_CONFIG=$ac_path_PG_CONFIG ac_path_PG_CONFIG_found=:]],
63 [ac_cv_path_PG_CONFIG=""])])
64 PG_CONFIG=$ac_cv_path_PG_CONFIG
65 AS_IF([test "X$PG_CONFIG" = "X"],[break])
66
67 AC_CACHE_CHECK([for the PostgreSQL libraries CPPFLAGS],[ac_cv_POSTGRESQL_CPPFLAGS],
68 [ac_cv_POSTGRESQL_CPPFLAGS="-I`$PG_CONFIG --includedir`" || _AX_LIB_POSTGRESQL_OLD_fail=yes])
69 AS_IF([test "X$_AX_LIB_POSTGRESQL_OLD_fail" = "Xyes"],[break])
70 POSTGRESQL_CPPFLAGS="$ac_cv_POSTGRESQL_CPPFLAGS"
71
72 AC_CACHE_CHECK([for the PostgreSQL libraries LDFLAGS],[ac_cv_POSTGRESQL_LDFLAGS],
73 [ac_cv_POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir`" || _AX_LIB_POSTGRESQL_OLD_fail=yes])
74 AS_IF([test "X$_AX_LIB_POSTGRESQL_OLD_fail" = "Xyes"],[break])
75 POSTGRESQL_LDFLAGS="$ac_cv_POSTGRESQL_LDFLAGS"
76
77 AC_CACHE_CHECK([for the PostgreSQL libraries LIBS],[ac_cv_POSTGRESQL_LIBS],
78 [ac_cv_POSTGRESQL_LIBS="-lpq"])
79 POSTGRESQL_LIBS="$ac_cv_POSTGRESQL_LIBS"
80
81 AC_CACHE_CHECK([for the PostgreSQL version],[ac_cv_POSTGRESQL_VERSION],
82 [
83 ac_cv_POSTGRESQL_VERSION=`$PG_CONFIG --version | sed "s/^PostgreSQL[[[:space:]]][[[:space:]]]*\([[0-9.]][[0-9.]]*\).*/\1/"` \
84 || _AX_LIB_POSTGRESQL_OLD_fail=yes
85 ])
86 AS_IF([test "X$_AX_LIB_POSTGRESQL_OLD_fail" = "Xyes"],[break])
87 POSTGRESQL_VERSION="$ac_cv_POSTGRESQL_VERSION"
88
89
90 dnl
91 dnl Check if required version of PostgreSQL is available
92 dnl
93 AS_IF([test X"$postgresql_version_req" != "X"],[
94 AC_MSG_CHECKING([if PostgreSQL version $POSTGRESQL_VERSION is >= $postgresql_version_req])
95 AX_COMPARE_VERSION([$POSTGRESQL_VERSION],[ge],[$postgresql_version_req],
96 [found_postgresql_req_version=yes],[found_postgresql_req_version=no])
97 AC_MSG_RESULT([$found_postgresql_req_version])
98 ])
99 AS_IF([test "Xfound_postgresql_req_version" = "Xno"],[break])
100
101 found_postgresql="yes"
102 break
103 done
104])
105
106AC_DEFUN([_AX_LIB_POSTGRESQL_PKG_CONFIG],
107[
108 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
109 found_postgresql=no
110
111 while true; do
112 PKG_PROG_PKG_CONFIG
113 AS_IF([test X$PKG_CONFIG = X],[break])
114
115 _AX_LIB_POSTGRESQL_PKG_CONFIG_fail=no;
116 AS_IF([test "X$postgresql_version_req" = "X"],
117 [PKG_CHECK_EXISTS([libpq],[found_postgresql_pkg_config=yes],[found_postgresql=no])],
118 [PKG_CHECK_EXISTS([libpq >= "$postgresql_version_req"],
119 [found_postgresql=yes],[found_postgresql=no])])
120 AS_IF([test "X$found_postgresql" = "no"],[break])
121
122 AC_CACHE_CHECK([for the PostgreSQL libraries CPPFLAGS],[ac_cv_POSTGRESQL_CPPFLAGS],
123 [ac_cv_POSTGRESQL_CPPFLAGS="`$PKG_CONFIG libpq --cflags-only-I`" || _AX_LIB_POSTGRESQL_PKG_CONFIG_fail=yes])
124 AS_IF([test "X$_AX_LIB_POSTGRESQL_PKG_CONFIG_fail" = "Xyes"],[break])
125 POSTGRESQL_CPPFLAGS="$ac_cv_POSTGRESQL_CPPFLAGS"
126
127
128 AC_CACHE_CHECK([for the PostgreSQL libraries LDFLAGS],[ac_cv_POSTGRESQL_LDFLAGS],
129 [ac_cv_POSTGRESQL_LDFLAGS="`$PKG_CONFIG libpq --libs-only-L --libs-only-other`" || _AX_LIB_POSTGRESQL_PKG_CONFIG_fail=yes])
130 AS_IF([test "X$_AX_LIB_POSTGRESQL_PKG_CONFIG_fail" = "Xyes"],[break])
131 POSTGRESQL_LDFLAGS="$ac_cv_POSTGRESQL_LDFLAGS"
132
133
134 AC_CACHE_CHECK([for the PostgreSQL libraries LIBS],[ac_cv_POSTGRESQL_LIBS],
135 [ac_cv_POSTGRESQL_LIBS="`$PKG_CONFIG libpq --libs-only-l`" || _AX_LIB_POSTGRESQL_PKG_CONFIG_fail=ye])
136 AS_IF([test "X$_AX_LIB_POSTGRESQL_PKG_CONFIG_fail" = "Xyes"],[break])
137 POSTGRESQL_LIBS="$ac_cv_POSTGRESQL_LIBS"
138
139 dnl already checked by exist but need to be recovered
140 AC_CACHE_CHECK([for the PostgreSQL version],[ac_cv_POSTGRESQL_VERSION],
141 [ac_cv_POSTGRESQL_VERSION="`$PKG_CONFIG libpq --modversion`" || _AX_LIB_POSTGRESQL_PKG_CONFIG_fail=yes])
142 AS_IF([test "X$_AX_LIB_POSTGRESQL_PKG_CONFIG_fail" = "Xyes"],[break])
143 POSTGRESQL_VERSION="$ac_cv_POSTGRESQL_VERSION"
144
145 found_postgresql=yes
146 break;
147 done
148
149])
150
151
152
153AC_DEFUN([AX_LIB_POSTGRESQL],
154[
155 AC_ARG_WITH([postgresql],
156 AS_HELP_STRING([--with-postgresql=@<:@ARG@:>@],
157 [use PostgreSQL library @<:@default=yes@:>@, optionally specify path to pg_config]
158 ),
159 [
160 AS_CASE([$withval],
161 [[[nN]][[oO]]],[want_postgresql="no"],
162 [[[yY]][[eE]][[sS]]],[want_postgresql="yes"],
163 [
164 want_postgresql="yes"
165 PG_CONFIG="$withval"
166 ])
167 ],
168 [want_postgresql="yes"]
169 )
170
171 AC_ARG_VAR([POSTGRESQL_CPPFLAGS],[cpp flags for PostgreSQL overriding detected flags])
172 AC_ARG_VAR([POSTGRESQL_LIBFLAGS],[libs for PostgreSQL overriding detected flags])
173 AC_ARG_VAR([POSTGRESQL_LDFLAGS],[linker flags for PostgreSQL overriding detected flags])
174
175 # populate cache
176 AS_IF([test "X$POSTGRESQL_CPPFLAGS" != X],[ac_cv_POSTGRESQL_CPPFLAGS="$POSTGRESQL_CPPFLAGS"])
177 AS_IF([test "X$POSTGRESQL_LDFLAGS" != X],[ac_cv_POSTGRESQL_LDFLAGS="$POSTGRESQL_LDFLAGS"])
178 AS_IF([test "X$POSTGRESQL_LIBS" != X],[ac_cv_POSTGRESQL_LIBS="$POSTGRESQL_LIBS"])
179
180 postgresql_version_req=ifelse([$1], [], [], [$1])
181 found_postgresql="no"
182
183 POSTGRESQL_VERSION=""
184
185 dnl
186 dnl Check PostgreSQL libraries (libpq)
187 dnl
188 AS_IF([test X"$want_postgresql" = "Xyes"],[
189 _AX_LIB_POSTGRESQL_PKG_CONFIG
190
191
192 AS_IF([test X"$found_postgresql" = "Xno"],
193 [_AX_LIB_POSTGRESQL_OLD])
194
195 AS_IF([test X"$found_postgresql" = Xyes],[
196 _AX_LIB_POSTGRESQL_OLD_CPPFLAGS="$CPPFLAGS"
197 CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS"
198 _AX_LIB_POSTGRESQL_OLD_LDFLAGS="$LDFLAGS"
199 LDFLAGS="$LDFLAGS $POSTGRESQL_LDFLAGS"
200 _AX_LIB_POSTGRESQL_OLD_LIBS="$LIBS"
201 LIBS="$LIBS $POSTGRESQL_LIBS"
202 while true; do
203 dnl try to compile
204 AC_CHECK_HEADER([libpq-fe.h],[],[found_postgresql=no])
205 AS_IF([test "X$found_postgresql" = "Xno"],[break])
206 dnl try now to link
207 AC_CACHE_CHECK([for the PostgreSQL library linking is working],[ac_cv_postgresql_found],
208 [
209 AC_LINK_IFELSE([
210 AC_LANG_PROGRAM(
211 [
212 #include <libpq-fe.h>
213 ],
214 [[
215 char conninfo[]="dbname = postgres";
216 PGconn *conn;
217 conn = PQconnectdb(conninfo);
218 ]]
219 )
220 ],[ac_cv_postgresql_found=yes],
221 [ac_cv_postgresql_found=no])
222 ])
223 found_postgresql="$ac_cv_postgresql_found"
224 AS_IF([test "X$found_postgresql" = "Xno"],[break])
225 break
226 done
227 CPPFLAGS="$_AX_LIB_POSTGRESQL_OLD_CPPFLAGS"
228 LDFLAGS="$_AX_LIB_POSTGRESQL_OLD_LDFLAGS"
229 LIBS="$_AX_LIB_POSTGRESQL_OLD_LIBS"
230 ])
231
232
233 AS_IF([test "x$found_postgresql" = "xyes"],[
234 AC_DEFINE([HAVE_POSTGRESQL], [1],
235 [Define to 1 if PostgreSQL libraries are available])])
236 ])
237
238 AC_SUBST([POSTGRESQL_VERSION])
239 AC_SUBST([POSTGRESQL_CPPFLAGS])
240 AC_SUBST([POSTGRESQL_LDFLAGS])
241 AC_SUBST([POSTGRESQL_LIBS])
242
243 AS_IF([test "x$found_postgresql" = "xyes"],
244 [ifelse([$2], , :, [$2])],
245 [ifelse([$3], , AS_IF([test X"$want_postgresql" = "Xyes"],[AC_MSG_ERROR([Library requirements (PostgreSQL) not met.])],[:]), [$3])])
246
247])
diff --git a/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644
index 0000000..d7de8d6
--- /dev/null
+++ b/m4/codeset.m4
@@ -0,0 +1,23 @@
1# codeset.m4 serial 5 (gettext-0.18.2)
2dnl Copyright (C) 2000-2002, 2006, 2008-2014 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_LINK_IFELSE(
13 [AC_LANG_PROGRAM(
14 [[#include <langinfo.h>]],
15 [[char* cs = nl_langinfo(CODESET); return !cs;]])],
16 [am_cv_langinfo_codeset=yes],
17 [am_cv_langinfo_codeset=no])
18 ])
19 if test $am_cv_langinfo_codeset = yes; then
20 AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
21 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
22 fi
23])
diff --git a/m4/extensions.m4 b/m4/extensions.m4
new file mode 100644
index 0000000..1330503
--- /dev/null
+++ b/m4/extensions.m4
@@ -0,0 +1,118 @@
1# serial 9 -*- Autoconf -*-
2# Enable extensions on systems that normally disable them.
3
4# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
10# Autoconf. Perhaps we can remove this once we can assume Autoconf
11# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
12# enough in this area it's likely we'll need to redefine
13# AC_USE_SYSTEM_EXTENSIONS for quite some time.
14
15# If autoconf reports a warning
16# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
17# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
18# the fix is
19# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
20# but always AC_REQUIREd,
21# 2) to ensure that for each occurrence of
22# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
23# or
24# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
25# the corresponding gnulib module description has 'extensions' among
26# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
27# invocation occurs in gl_EARLY, not in gl_INIT.
28
29# AC_USE_SYSTEM_EXTENSIONS
30# ------------------------
31# Enable extensions on systems that normally disable them,
32# typically due to standards-conformance issues.
33# Remember that #undef in AH_VERBATIM gets replaced with #define by
34# AC_DEFINE. The goal here is to define all known feature-enabling
35# macros, then, if reports of conflicts are made, disable macros that
36# cause problems on some platforms (such as __EXTENSIONS__).
37AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
38[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
39AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
40
41 AC_REQUIRE([AC_CANONICAL_HOST])
42
43 AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
44 if test "$MINIX" = yes; then
45 AC_DEFINE([_POSIX_SOURCE], [1],
46 [Define to 1 if you need to in order for `stat' and other
47 things to work.])
48 AC_DEFINE([_POSIX_1_SOURCE], [2],
49 [Define to 2 if the system does not provide POSIX.1 features
50 except with this defined.])
51 AC_DEFINE([_MINIX], [1],
52 [Define to 1 if on MINIX.])
53 fi
54
55 dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
56 dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
57 dnl provided.
58 case "$host_os" in
59 hpux*)
60 AC_DEFINE([_XOPEN_SOURCE], [500],
61 [Define to 500 only on HP-UX.])
62 ;;
63 esac
64
65 AH_VERBATIM([__EXTENSIONS__],
66[/* Enable extensions on AIX 3, Interix. */
67#ifndef _ALL_SOURCE
68# undef _ALL_SOURCE
69#endif
70/* Enable GNU extensions on systems that have them. */
71#ifndef _GNU_SOURCE
72# undef _GNU_SOURCE
73#endif
74/* Enable threading extensions on Solaris. */
75#ifndef _POSIX_PTHREAD_SEMANTICS
76# undef _POSIX_PTHREAD_SEMANTICS
77#endif
78/* Enable extensions on HP NonStop. */
79#ifndef _TANDEM_SOURCE
80# undef _TANDEM_SOURCE
81#endif
82/* Enable general extensions on Solaris. */
83#ifndef __EXTENSIONS__
84# undef __EXTENSIONS__
85#endif
86])
87 AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
88 [ac_cv_safe_to_define___extensions__],
89 [AC_COMPILE_IFELSE(
90 [AC_LANG_PROGRAM([[
91# define __EXTENSIONS__ 1
92 ]AC_INCLUDES_DEFAULT])],
93 [ac_cv_safe_to_define___extensions__=yes],
94 [ac_cv_safe_to_define___extensions__=no])])
95 test $ac_cv_safe_to_define___extensions__ = yes &&
96 AC_DEFINE([__EXTENSIONS__])
97 AC_DEFINE([_ALL_SOURCE])
98 AC_DEFINE([_GNU_SOURCE])
99 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
100 AC_DEFINE([_TANDEM_SOURCE])
101])# AC_USE_SYSTEM_EXTENSIONS
102
103# gl_USE_SYSTEM_EXTENSIONS
104# ------------------------
105# Enable extensions on systems that normally disable them,
106# typically due to standards-conformance issues.
107AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
108[
109 dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
110 dnl gnulib does not need it. But if it gets required by third-party macros
111 dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
112 dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
113 dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
114 dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
115 AC_REQUIRE([AC_GNU_SOURCE])
116
117 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
118])
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
new file mode 100644
index 0000000..c4c5e7f
--- /dev/null
+++ b/m4/extern-inline.m4
@@ -0,0 +1,70 @@
1dnl 'extern inline' a la ISO C99.
2
3dnl Copyright 2012-2013 Free Software Foundation, 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.
7
8AC_DEFUN([gl_EXTERN_INLINE],
9[
10 AH_VERBATIM([extern_inline],
11[/* Please see the Gnulib manual for how to use these macros.
12
13 Suppress extern inline with HP-UX cc, as it appears to be broken; see
14 <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
15
16 Suppress extern inline with Sun C in standards-conformance mode, as it
17 mishandles inline functions that call each other. E.g., for 'inline void f
18 (void) { } inline void g (void) { f (); }', c99 incorrectly complains
19 'reference to static identifier "f" in extern inline function'.
20 This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
21
22 Suppress the use of extern inline on Apple's platforms, as Libc at least
23 through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
24 <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
25 Perhaps Apple will fix this some day. */
26#if ((__GNUC__ \
27 ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
28 : (199901L <= __STDC_VERSION__ \
29 && !defined __HP_cc \
30 && !(defined __SUNPRO_C && __STDC__))) \
31 && !defined __APPLE__)
32# define _GL_INLINE inline
33# define _GL_EXTERN_INLINE extern inline
34#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
35 && !defined __APPLE__)
36# if __GNUC_GNU_INLINE__
37 /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
38# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
39# else
40# define _GL_INLINE extern inline
41# endif
42# define _GL_EXTERN_INLINE extern
43#else
44# define _GL_INLINE static _GL_UNUSED
45# define _GL_EXTERN_INLINE static _GL_UNUSED
46#endif
47
48#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
49# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
50# define _GL_INLINE_HEADER_CONST_PRAGMA
51# else
52# define _GL_INLINE_HEADER_CONST_PRAGMA \
53 _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
54# endif
55 /* Suppress GCC's bogus "no previous prototype for 'FOO'"
56 and "no previous declaration for 'FOO'" diagnostics,
57 when FOO is an inline function in the header; see
58 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */
59# define _GL_INLINE_HEADER_BEGIN \
60 _Pragma ("GCC diagnostic push") \
61 _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
62 _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
63 _GL_INLINE_HEADER_CONST_PRAGMA
64# define _GL_INLINE_HEADER_END \
65 _Pragma ("GCC diagnostic pop")
66#else
67# define _GL_INLINE_HEADER_BEGIN
68# define _GL_INLINE_HEADER_END
69#endif])
70])
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
new file mode 100644
index 0000000..43c9312
--- /dev/null
+++ b/m4/fcntl-o.m4
@@ -0,0 +1,134 @@
1# fcntl-o.m4 serial 4
2dnl Copyright (C) 2006, 2009-2014 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 dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
16 dnl AC_GNU_SOURCE.
17 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
18 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
19 [AC_REQUIRE([AC_GNU_SOURCE])])
20
21 AC_CHECK_HEADERS_ONCE([unistd.h])
22 AC_CHECK_FUNCS_ONCE([symlink])
23 AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
24 [AC_RUN_IFELSE(
25 [AC_LANG_PROGRAM(
26 [[#include <sys/types.h>
27 #include <sys/stat.h>
28 #if HAVE_UNISTD_H
29 # include <unistd.h>
30 #else /* on Windows with MSVC */
31 # include <io.h>
32 # include <stdlib.h>
33 # defined sleep(n) _sleep ((n) * 1000)
34 #endif
35 #include <fcntl.h>
36 #ifndef O_NOATIME
37 #define O_NOATIME 0
38 #endif
39 #ifndef O_NOFOLLOW
40 #define O_NOFOLLOW 0
41 #endif
42 static int const constants[] =
43 {
44 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
45 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
46 };
47 ]],
48 [[
49 int result = !constants;
50 #if HAVE_SYMLINK
51 {
52 static char const sym[] = "conftest.sym";
53 if (symlink ("/dev/null", sym) != 0)
54 result |= 2;
55 else
56 {
57 int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
58 if (fd >= 0)
59 {
60 close (fd);
61 result |= 4;
62 }
63 }
64 if (unlink (sym) != 0 || symlink (".", sym) != 0)
65 result |= 2;
66 else
67 {
68 int fd = open (sym, O_RDONLY | O_NOFOLLOW);
69 if (fd >= 0)
70 {
71 close (fd);
72 result |= 4;
73 }
74 }
75 unlink (sym);
76 }
77 #endif
78 {
79 static char const file[] = "confdefs.h";
80 int fd = open (file, O_RDONLY | O_NOATIME);
81 if (fd < 0)
82 result |= 8;
83 else
84 {
85 struct stat st0;
86 if (fstat (fd, &st0) != 0)
87 result |= 16;
88 else
89 {
90 char c;
91 sleep (1);
92 if (read (fd, &c, 1) != 1)
93 result |= 24;
94 else
95 {
96 if (close (fd) != 0)
97 result |= 32;
98 else
99 {
100 struct stat st1;
101 if (stat (file, &st1) != 0)
102 result |= 40;
103 else
104 if (st0.st_atime != st1.st_atime)
105 result |= 64;
106 }
107 }
108 }
109 }
110 }
111 return result;]])],
112 [gl_cv_header_working_fcntl_h=yes],
113 [case $? in #(
114 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
115 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
116 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
117 *) gl_cv_header_working_fcntl_h='no';;
118 esac],
119 [gl_cv_header_working_fcntl_h=cross-compiling])])
120
121 case $gl_cv_header_working_fcntl_h in #(
122 *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
123 *) ac_val=1;;
124 esac
125 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
126 [Define to 1 if O_NOATIME works.])
127
128 case $gl_cv_header_working_fcntl_h in #(
129 *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
130 *) ac_val=1;;
131 esac
132 AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
133 [Define to 1 if O_NOFOLLOW works.])
134])
diff --git a/m4/freetype2.m4 b/m4/freetype2.m4
new file mode 100644
index 0000000..7424a32
--- /dev/null
+++ b/m4/freetype2.m4
@@ -0,0 +1,178 @@
1# Configure paths for FreeType2
2# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
3#
4# serial 2
5
6# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
7# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
8# MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
9# FreeType 2.0.4).
10#
11AC_DEFUN([AC_CHECK_FT2],
12 [# Get the cflags and libraries from the freetype-config script
13 #
14 AC_ARG_WITH([ft-prefix],
15 dnl don't quote AS_HELP_STRING!
16 AS_HELP_STRING([--with-ft-prefix=PREFIX],
17 [Prefix where FreeType is installed (optional)]),
18 [ft_config_prefix="$withval"],
19 [ft_config_prefix=""])
20
21 AC_ARG_WITH([ft-exec-prefix],
22 dnl don't quote AS_HELP_STRING!
23 AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
24 [Exec prefix where FreeType is installed (optional)]),
25 [ft_config_exec_prefix="$withval"],
26 [ft_config_exec_prefix=""])
27
28 AC_ARG_ENABLE([freetypetest],
29 dnl don't quote AS_HELP_STRING!
30 AS_HELP_STRING([--disable-freetypetest],
31 [Do not try to compile and run a test FreeType program]),
32 [],
33 [enable_fttest=yes])
34
35 if test x$ft_config_exec_prefix != x ; then
36 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
37 if test x${FT2_CONFIG+set} != xset ; then
38 FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
39 fi
40 fi
41
42 if test x$ft_config_prefix != x ; then
43 ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
44 if test x${FT2_CONFIG+set} != xset ; then
45 FT2_CONFIG=$ft_config_prefix/bin/freetype-config
46 fi
47 fi
48
49 AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no])
50
51 min_ft_version=m4_if([$1], [], [7.0.1], [$1])
52 AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version])
53 no_ft=""
54 if test "$FT2_CONFIG" = "no" ; then
55 no_ft=yes
56 else
57 FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
58 FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
59 ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
60 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
61 ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
62 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
63 ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
64 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
65 ft_min_major_version=`echo $min_ft_version | \
66 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
67 ft_min_minor_version=`echo $min_ft_version | \
68 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
69 ft_min_micro_version=`echo $min_ft_version | \
70 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
71 if test x$enable_fttest = xyes ; then
72 ft_config_is_lt=""
73 if test $ft_config_major_version -lt $ft_min_major_version ; then
74 ft_config_is_lt=yes
75 else
76 if test $ft_config_major_version -eq $ft_min_major_version ; then
77 if test $ft_config_minor_version -lt $ft_min_minor_version ; then
78 ft_config_is_lt=yes
79 else
80 if test $ft_config_minor_version -eq $ft_min_minor_version ; then
81 if test $ft_config_micro_version -lt $ft_min_micro_version ; then
82 ft_config_is_lt=yes
83 fi
84 fi
85 fi
86 fi
87 fi
88 if test x$ft_config_is_lt = xyes ; then
89 no_ft=yes
90 else
91 ac_save_CFLAGS="$CFLAGS"
92 ac_save_LIBS="$LIBS"
93 CFLAGS="$CFLAGS $FT2_CFLAGS"
94 LIBS="$FT2_LIBS $LIBS"
95
96 #
97 # Sanity checks for the results of freetype-config to some extent.
98 #
99 AC_RUN_IFELSE([
100 AC_LANG_SOURCE([[
101
102#include <ft2build.h>
103#include FT_FREETYPE_H
104#include <stdio.h>
105#include <stdlib.h>
106
107int
108main()
109{
110 FT_Library library;
111 FT_Error error;
112
113 error = FT_Init_FreeType(&library);
114
115 if (error)
116 return 1;
117 else
118 {
119 FT_Done_FreeType(library);
120 return 0;
121 }
122}
123
124 ]])
125 ],
126 [],
127 [no_ft=yes],
128 [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"])
129
130 CFLAGS="$ac_save_CFLAGS"
131 LIBS="$ac_save_LIBS"
132 fi # test $ft_config_version -lt $ft_min_version
133 fi # test x$enable_fttest = xyes
134 fi # test "$FT2_CONFIG" = "no"
135
136 if test x$no_ft = x ; then
137 AC_MSG_RESULT([yes])
138 m4_if([$2], [], [:], [$2])
139 else
140 AC_MSG_RESULT([no])
141 if test "$FT2_CONFIG" = "no" ; then
142 AC_MSG_WARN([
143
144 The freetype-config script installed by FreeType 2 could not be found.
145 If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in
146 your path, or set the FT2_CONFIG environment variable to the
147 full path to freetype-config.
148 ])
149 else
150 if test x$ft_config_is_lt = xyes ; then
151 AC_MSG_WARN([
152
153 Your installed version of the FreeType 2 library is too old.
154 If you have different versions of FreeType 2, make sure that
155 correct values for --with-ft-prefix or --with-ft-exec-prefix
156 are used, or set the FT2_CONFIG environment variable to the
157 full path to freetype-config.
158 ])
159 else
160 AC_MSG_WARN([
161
162 The FreeType test program failed to run. If your system uses
163 shared libraries and they are installed outside the normal
164 system library path, make sure the variable LD_LIBRARY_PATH
165 (or whatever is appropiate for your system) is correctly set.
166 ])
167 fi
168 fi
169
170 FT2_CFLAGS=""
171 FT2_LIBS=""
172 m4_if([$3], [], [:], [$3])
173 fi
174
175 AC_SUBST([FT2_CFLAGS])
176 AC_SUBST([FT2_LIBS])])
177
178# end of freetype2.m4
diff --git a/m4/glib-2.0.m4 b/m4/glib-2.0.m4
new file mode 100644
index 0000000..13a3ce6
--- /dev/null
+++ b/m4/glib-2.0.m4
@@ -0,0 +1,212 @@
1# Configure paths for GLIB
2# Owen Taylor 1997-2001
3
4dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
5dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
6dnl gthread is specified in MODULES, pass to pkg-config
7dnl
8AC_DEFUN([AM_PATH_GLIB_2_0],
9[dnl
10dnl Get the cflags and libraries from pkg-config
11dnl
12AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
13 , enable_glibtest=yes)
14
15 pkg_config_args=glib-2.0
16 for module in . $4
17 do
18 case "$module" in
19 gmodule)
20 pkg_config_args="$pkg_config_args gmodule-2.0"
21 ;;
22 gobject)
23 pkg_config_args="$pkg_config_args gobject-2.0"
24 ;;
25 gthread)
26 pkg_config_args="$pkg_config_args gthread-2.0"
27 ;;
28 esac
29 done
30
31 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
32
33 no_glib=""
34
35 if test x$PKG_CONFIG != xno ; then
36 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
37 :
38 else
39 echo *** pkg-config too old; version 0.7 or better required.
40 no_glib=yes
41 PKG_CONFIG=no
42 fi
43 else
44 no_glib=yes
45 fi
46
47 min_glib_version=ifelse([$1], ,2.0.0,$1)
48 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
49
50 if test x$PKG_CONFIG != xno ; then
51 ## don't try to run the test against uninstalled libtool libs
52 if $PKG_CONFIG --uninstalled $pkg_config_args; then
53 echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
54 enable_glibtest=no
55 fi
56
57 if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
58 :
59 else
60 no_glib=yes
61 fi
62 fi
63
64 if test x"$no_glib" = x ; then
65 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
66 GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
67 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
68
69 GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
70 GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
71 glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
72 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
73 glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
74 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
75 glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
76 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
77 if test "x$enable_glibtest" = "xyes" ; then
78 ac_save_CFLAGS="$CFLAGS"
79 ac_save_LIBS="$LIBS"
80 CFLAGS="$CFLAGS $GLIB_CFLAGS"
81 LIBS="$GLIB_LIBS $LIBS"
82dnl
83dnl Now check if the installed GLIB is sufficiently new. (Also sanity
84dnl checks the results of pkg-config to some extent)
85dnl
86 rm -f conf.glibtest
87 AC_TRY_RUN([
88#include <glib.h>
89#include <stdio.h>
90#include <stdlib.h>
91
92int
93main ()
94{
95 int major, minor, micro;
96 char *tmp_version;
97
98 system ("touch conf.glibtest");
99
100 /* HP/UX 9 (%@#!) writes to sscanf strings */
101 tmp_version = g_strdup("$min_glib_version");
102 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
103 printf("%s, bad version string\n", "$min_glib_version");
104 exit(1);
105 }
106
107 if ((glib_major_version != $glib_config_major_version) ||
108 (glib_minor_version != $glib_config_minor_version) ||
109 (glib_micro_version != $glib_config_micro_version))
110 {
111 printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
112 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
113 glib_major_version, glib_minor_version, glib_micro_version);
114 printf ("*** was found! If pkg-config was correct, then it is best\n");
115 printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
116 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
117 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
118 printf("*** required on your system.\n");
119 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
120 printf("*** to point to the correct configuration files\n");
121 }
122 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
123 (glib_minor_version != GLIB_MINOR_VERSION) ||
124 (glib_micro_version != GLIB_MICRO_VERSION))
125 {
126 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
127 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
128 printf("*** library (version %d.%d.%d)\n",
129 glib_major_version, glib_minor_version, glib_micro_version);
130 }
131 else
132 {
133 if ((glib_major_version > major) ||
134 ((glib_major_version == major) && (glib_minor_version > minor)) ||
135 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
136 {
137 return 0;
138 }
139 else
140 {
141 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
142 glib_major_version, glib_minor_version, glib_micro_version);
143 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
144 major, minor, micro);
145 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
146 printf("***\n");
147 printf("*** If you have already installed a sufficiently new version, this error\n");
148 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
149 printf("*** being found. The easiest way to fix this is to remove the old version\n");
150 printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
151 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
152 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
153 printf("*** so that the correct libraries are found at run-time))\n");
154 }
155 }
156 return 1;
157}
158],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
159 CFLAGS="$ac_save_CFLAGS"
160 LIBS="$ac_save_LIBS"
161 fi
162 fi
163 if test "x$no_glib" = x ; then
164 AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
165 ifelse([$2], , :, [$2])
166 else
167 AC_MSG_RESULT(no)
168 if test "$PKG_CONFIG" = "no" ; then
169 echo "*** A new enough version of pkg-config was not found."
170 echo "*** See http://www.freedesktop.org/software/pkgconfig/"
171 else
172 if test -f conf.glibtest ; then
173 :
174 else
175 echo "*** Could not run GLIB test program, checking why..."
176 ac_save_CFLAGS="$CFLAGS"
177 ac_save_LIBS="$LIBS"
178 CFLAGS="$CFLAGS $GLIB_CFLAGS"
179 LIBS="$LIBS $GLIB_LIBS"
180 AC_TRY_LINK([
181#include <glib.h>
182#include <stdio.h>
183], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
184 [ echo "*** The test program compiled, but did not run. This usually means"
185 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
186 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
187 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
188 echo "*** to the installed location Also, make sure you have run ldconfig if that"
189 echo "*** is required on your system"
190 echo "***"
191 echo "*** If you have an old version installed, it is best to remove it, although"
192 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
193 [ echo "*** The test program failed to compile or link. See the file config.log for the"
194 echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
195 CFLAGS="$ac_save_CFLAGS"
196 LIBS="$ac_save_LIBS"
197 fi
198 fi
199 GLIB_CFLAGS=""
200 GLIB_LIBS=""
201 GLIB_GENMARSHAL=""
202 GOBJECT_QUERY=""
203 GLIB_MKENUMS=""
204 ifelse([$3], , :, [$3])
205 fi
206 AC_SUBST(GLIB_CFLAGS)
207 AC_SUBST(GLIB_LIBS)
208 AC_SUBST(GLIB_GENMARSHAL)
209 AC_SUBST(GOBJECT_QUERY)
210 AC_SUBST(GLIB_MKENUMS)
211 rm -f conf.glibtest
212])
diff --git a/m4/glib-gettext.m4 b/m4/glib-gettext.m4
new file mode 100644
index 0000000..5a4ef28
--- /dev/null
+++ b/m4/glib-gettext.m4
@@ -0,0 +1,380 @@
1# Copyright (C) 1995-2002 Free Software Foundation, Inc.
2# Copyright (C) 2001-2003 Red Hat, Inc.
3#
4# This file is free software, distributed under the terms of the GNU
5# General Public License. As a special exception to the GNU General
6# Public License, this file may be distributed as part of a program
7# that contains a configuration script generated by Autoconf, under
8# the same distribution terms as the rest of that program.
9#
10# This file can be copied and used freely without restrictions. It can
11# be used in projects which are not available under the GNU Public License
12# but which still want to provide support for the GNU gettext functionality.
13#
14# Macro to add for using GNU gettext.
15# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
16#
17# Modified to never use included libintl.
18# Owen Taylor <otaylor@redhat.com>, 12/15/1998
19#
20# Major rework to remove unused code
21# Owen Taylor <otaylor@redhat.com>, 12/11/2002
22#
23# Added better handling of ALL_LINGUAS from GNU gettext version
24# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
25
26#
27# We need this here as well, since someone might use autoconf-2.5x
28# to configure GLib then an older version to configure a package
29# using AM_GLIB_GNU_GETTEXT
30AC_PREREQ(2.53)
31
32dnl
33dnl We go to great lengths to make sure that aclocal won't
34dnl try to pull in the installed version of these macros
35dnl when running aclocal in the glib directory.
36dnl
37m4_copy([AC_DEFUN],[glib_DEFUN])
38m4_copy([AC_REQUIRE],[glib_REQUIRE])
39dnl
40dnl At the end, if we're not within glib, we'll define the public
41dnl definitions in terms of our private definitions.
42dnl
43
44# GLIB_LC_MESSAGES
45#--------------------
46glib_DEFUN([GLIB_LC_MESSAGES],
47 [AC_CHECK_HEADERS([locale.h])
48 if test $ac_cv_header_locale_h = yes; then
49 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
50 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
51 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
52 if test $am_cv_val_LC_MESSAGES = yes; then
53 AC_DEFINE(HAVE_LC_MESSAGES, 1,
54 [Define if your <locale.h> file defines LC_MESSAGES.])
55 fi
56 fi])
57
58# GLIB_PATH_PROG_WITH_TEST
59#----------------------------
60dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
61dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
62glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
63[# Extract the first word of "$2", so it can be a program name with args.
64set dummy $2; ac_word=[$]2
65AC_MSG_CHECKING([for $ac_word])
66AC_CACHE_VAL(ac_cv_path_$1,
67[case "[$]$1" in
68 /*)
69 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
70 ;;
71 *)
72 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
73 for ac_dir in ifelse([$5], , $PATH, [$5]); do
74 test -z "$ac_dir" && ac_dir=.
75 if test -f $ac_dir/$ac_word; then
76 if [$3]; then
77 ac_cv_path_$1="$ac_dir/$ac_word"
78 break
79 fi
80 fi
81 done
82 IFS="$ac_save_ifs"
83dnl If no 4th arg is given, leave the cache variable unset,
84dnl so AC_PATH_PROGS will keep looking.
85ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
86])dnl
87 ;;
88esac])dnl
89$1="$ac_cv_path_$1"
90if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
91 AC_MSG_RESULT([$]$1)
92else
93 AC_MSG_RESULT(no)
94fi
95AC_SUBST($1)dnl
96])
97
98# GLIB_WITH_NLS
99#-----------------
100glib_DEFUN([GLIB_WITH_NLS],
101 dnl NLS is obligatory
102 [USE_NLS=yes
103 AC_SUBST(USE_NLS)
104
105 gt_cv_have_gettext=no
106
107 CATOBJEXT=NONE
108 XGETTEXT=:
109 INTLLIBS=
110
111 AC_CHECK_HEADER(libintl.h,
112 [gt_cv_func_dgettext_libintl="no"
113 libintl_extra_libs=""
114
115 #
116 # First check in libc
117 #
118 AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
119 [AC_TRY_LINK([
120#include <libintl.h>
121],
122 [return (int) dgettext ("","")],
123 gt_cv_func_dgettext_libc=yes,
124 gt_cv_func_dgettext_libc=no)
125 ])
126
127 if test "$gt_cv_func_dgettext_libc" = "yes" ; then
128 AC_CHECK_FUNCS(bind_textdomain_codeset)
129 fi
130
131 #
132 # If we don't have everything we want, check in libintl
133 #
134 if test "$gt_cv_func_dgettext_libc" != "yes" \
135 || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
136
137 AC_CHECK_LIB(intl, bindtextdomain,
138 [AC_CHECK_LIB(intl, dgettext,
139 gt_cv_func_dgettext_libintl=yes)])
140
141 if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
142 AC_MSG_CHECKING([if -liconv is needed to use gettext])
143 AC_MSG_RESULT([])
144 AC_CHECK_LIB(intl, dcgettext,
145 [gt_cv_func_dgettext_libintl=yes
146 libintl_extra_libs=-liconv],
147 :,-liconv)
148 fi
149
150 #
151 # If we found libintl, then check in it for bind_textdomain_codeset();
152 # we'll prefer libc if neither have bind_textdomain_codeset(),
153 # and both have dgettext
154 #
155 if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
156 glib_save_LIBS="$LIBS"
157 LIBS="$LIBS -lintl $libintl_extra_libs"
158 unset ac_cv_func_bind_textdomain_codeset
159 AC_CHECK_FUNCS(bind_textdomain_codeset)
160 LIBS="$glib_save_LIBS"
161
162 if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
163 gt_cv_func_dgettext_libc=no
164 else
165 if test "$gt_cv_func_dgettext_libc" = "yes"; then
166 gt_cv_func_dgettext_libintl=no
167 fi
168 fi
169 fi
170 fi
171
172 if test "$gt_cv_func_dgettext_libc" = "yes" \
173 || test "$gt_cv_func_dgettext_libintl" = "yes"; then
174 gt_cv_have_gettext=yes
175 fi
176
177 if test "$gt_cv_func_dgettext_libintl" = "yes"; then
178 INTLLIBS="-lintl $libintl_extra_libs"
179 fi
180
181 if test "$gt_cv_have_gettext" = "yes"; then
182 AC_DEFINE(HAVE_GETTEXT,1,
183 [Define if the GNU gettext() function is already present or preinstalled.])
184 GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
185 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
186 if test "$MSGFMT" != "no"; then
187 glib_save_LIBS="$LIBS"
188 LIBS="$LIBS $INTLLIBS"
189 AC_CHECK_FUNCS(dcgettext)
190 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
191 GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
192 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
193 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
194 return _nl_msg_cat_cntr],
195 [CATOBJEXT=.gmo
196 DATADIRNAME=share],
197 [case $host in
198 *-*-solaris*)
199 dnl On Solaris, if bind_textdomain_codeset is in libc,
200 dnl GNU format message catalog is always supported,
201 dnl since both are added to the libc all together.
202 dnl Hence, we'd like to go with DATADIRNAME=share and
203 dnl and CATOBJEXT=.gmo in this case.
204 AC_CHECK_FUNC(bind_textdomain_codeset,
205 [CATOBJEXT=.gmo
206 DATADIRNAME=share],
207 [CATOBJEXT=.mo
208 DATADIRNAME=lib])
209 ;;
210 *)
211 CATOBJEXT=.mo
212 DATADIRNAME=lib
213 ;;
214 esac])
215 LIBS="$glib_save_LIBS"
216 INSTOBJEXT=.mo
217 else
218 gt_cv_have_gettext=no
219 fi
220 fi
221 ])
222
223 if test "$gt_cv_have_gettext" = "yes" ; then
224 AC_DEFINE(ENABLE_NLS, 1,
225 [always defined to indicate that i18n is enabled])
226 fi
227
228 dnl Test whether we really found GNU xgettext.
229 if test "$XGETTEXT" != ":"; then
230 dnl If it is not GNU xgettext we define it as : so that the
231 dnl Makefiles still can work.
232 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
233 : ;
234 else
235 AC_MSG_RESULT(
236 [found xgettext program is not GNU xgettext; ignore it])
237 XGETTEXT=":"
238 fi
239 fi
240
241 # We need to process the po/ directory.
242 POSUB=po
243
244 AC_OUTPUT_COMMANDS(
245 [case "$CONFIG_FILES" in *po/Makefile.in*)
246 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
247 esac])
248
249 dnl These rules are solely for the distribution goal. While doing this
250 dnl we only have to keep exactly one list of the available catalogs
251 dnl in configure.in.
252 for lang in $ALL_LINGUAS; do
253 GMOFILES="$GMOFILES $lang.gmo"
254 POFILES="$POFILES $lang.po"
255 done
256
257 dnl Make all variables we use known to autoconf.
258 AC_SUBST(CATALOGS)
259 AC_SUBST(CATOBJEXT)
260 AC_SUBST(DATADIRNAME)
261 AC_SUBST(GMOFILES)
262 AC_SUBST(INSTOBJEXT)
263 AC_SUBST(INTLLIBS)
264 AC_SUBST(PO_IN_DATADIR_TRUE)
265 AC_SUBST(PO_IN_DATADIR_FALSE)
266 AC_SUBST(POFILES)
267 AC_SUBST(POSUB)
268 ])
269
270# AM_GLIB_GNU_GETTEXT
271# -------------------
272# Do checks necessary for use of gettext. If a suitable implementation
273# of gettext is found in either in libintl or in the C library,
274# it will set INTLLIBS to the libraries needed for use of gettext
275# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
276# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
277# on various variables needed by the Makefile.in.in installed by
278# glib-gettextize.
279dnl
280glib_DEFUN([GLIB_GNU_GETTEXT],
281 [AC_REQUIRE([AC_PROG_CC])dnl
282 AC_REQUIRE([AC_HEADER_STDC])dnl
283
284 GLIB_LC_MESSAGES
285 GLIB_WITH_NLS
286
287 if test "$gt_cv_have_gettext" = "yes"; then
288 if test "x$ALL_LINGUAS" = "x"; then
289 LINGUAS=
290 else
291 AC_MSG_CHECKING(for catalogs to be installed)
292 NEW_LINGUAS=
293 for presentlang in $ALL_LINGUAS; do
294 useit=no
295 if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
296 desiredlanguages="$LINGUAS"
297 else
298 desiredlanguages="$ALL_LINGUAS"
299 fi
300 for desiredlang in $desiredlanguages; do
301 # Use the presentlang catalog if desiredlang is
302 # a. equal to presentlang, or
303 # b. a variant of presentlang (because in this case,
304 # presentlang can be used as a fallback for messages
305 # which are not translated in the desiredlang catalog).
306 case "$desiredlang" in
307 "$presentlang"*) useit=yes;;
308 esac
309 done
310 if test $useit = yes; then
311 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
312 fi
313 done
314 LINGUAS=$NEW_LINGUAS
315 AC_MSG_RESULT($LINGUAS)
316 fi
317
318 dnl Construct list of names of catalog files to be constructed.
319 if test -n "$LINGUAS"; then
320 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
321 fi
322 fi
323
324 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
325 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
326 dnl Try to locate is.
327 MKINSTALLDIRS=
328 if test -n "$ac_aux_dir"; then
329 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
330 fi
331 if test -z "$MKINSTALLDIRS"; then
332 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
333 fi
334 AC_SUBST(MKINSTALLDIRS)
335
336 dnl Generate list of files to be processed by xgettext which will
337 dnl be included in po/Makefile.
338 test -d po || mkdir po
339 if test "x$srcdir" != "x."; then
340 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
341 posrcprefix="$srcdir/"
342 else
343 posrcprefix="../$srcdir/"
344 fi
345 else
346 posrcprefix="../"
347 fi
348 rm -f po/POTFILES
349 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
350 < $srcdir/po/POTFILES.in > po/POTFILES
351 ])
352
353# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
354# -------------------------------
355# Define VARIABLE to the location where catalog files will
356# be installed by po/Makefile.
357glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
358[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
359glib_save_prefix="$prefix"
360glib_save_exec_prefix="$exec_prefix"
361test "x$prefix" = xNONE && prefix=$ac_default_prefix
362test "x$exec_prefix" = xNONE && exec_prefix=$prefix
363if test "x$CATOBJEXT" = "x.mo" ; then
364 localedir=`eval echo "${libdir}/locale"`
365else
366 localedir=`eval echo "${datadir}/locale"`
367fi
368prefix="$glib_save_prefix"
369exec_prefix="$glib_save_exec_prefix"
370AC_DEFINE_UNQUOTED($1, "$localedir",
371 [Define the location where the catalogs will be installed])
372])
373
374dnl
375dnl Now the definitions that aclocal will find
376dnl
377ifdef(glib_configure_in,[],[
378AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
379AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
380])dnl
diff --git a/m4/glibc2.m4 b/m4/glibc2.m4
new file mode 100644
index 0000000..71dd8a1
--- /dev/null
+++ b/m4/glibc2.m4
@@ -0,0 +1,31 @@
1# glibc2.m4 serial 3
2dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 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.
7
8# Test for the GNU C Library, version 2.0 or newer.
9# From Bruno Haible.
10
11AC_DEFUN([gt_GLIBC2],
12 [
13 AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],
14 [ac_cv_gnu_library_2],
15 [AC_EGREP_CPP([Lucky GNU user],
16 [
17#include <features.h>
18#ifdef __GNU_LIBRARY__
19 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
20 Lucky GNU user
21 #endif
22#endif
23 ],
24 [ac_cv_gnu_library_2=yes],
25 [ac_cv_gnu_library_2=no])
26 ]
27 )
28 AC_SUBST([GLIBC2])
29 GLIBC2="$ac_cv_gnu_library_2"
30 ]
31)
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
new file mode 100644
index 0000000..ab58b71
--- /dev/null
+++ b/m4/glibc21.m4
@@ -0,0 +1,34 @@
1# glibc21.m4 serial 5
2dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 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.
7
8# Test for the GNU C Library, version 2.1 or newer, or uClibc.
9# From Bruno Haible.
10
11AC_DEFUN([gl_GLIBC21],
12 [
13 AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
14 [ac_cv_gnu_library_2_1],
15 [AC_EGREP_CPP([Lucky],
16 [
17#include <features.h>
18#ifdef __GNU_LIBRARY__
19 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
20 Lucky GNU user
21 #endif
22#endif
23#ifdef __UCLIBC__
24 Lucky user
25#endif
26 ],
27 [ac_cv_gnu_library_2_1=yes],
28 [ac_cv_gnu_library_2_1=no])
29 ]
30 )
31 AC_SUBST([GLIBC21])
32 GLIBC21="$ac_cv_gnu_library_2_1"
33 ]
34)
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
new file mode 100644
index 0000000..a9ec8f3
--- /dev/null
+++ b/m4/gnulib-cache.m4
@@ -0,0 +1,35 @@
1# Copyright (C) 2002-2011 Free Software Foundation, Inc.
2#
3# This file is free software, distributed under the terms of the GNU
4# General Public License. As a special exception to the GNU General
5# Public License, this file may be distributed as part of a program
6# that contains a configuration script generated by Autoconf, under
7# the same distribution terms as the rest of that program.
8#
9# Generated by gnulib-tool.
10#
11# This file represents the specification of how gnulib-tool is used.
12# It acts as a cache: It is written and read by gnulib-tool.
13# In projects that use version control, this file is meant to be put under
14# version control, like the configure.ac and various Makefile.am files.
15
16
17# Specification in the form of a command-line invocation:
18# gnulib-tool --import --dir=/home/nils/workspace/gnunet --lib=libgnu --source-base=src/util/libgnu --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --libtool --macro-prefix=gl strtok_r
19
20# Specification in the form of a few gnulib-tool.m4 macro invocations:
21gl_LOCAL_DIR([])
22gl_MODULES([
23 strtok_r
24])
25gl_AVOID([])
26gl_SOURCE_BASE([src/util/libgnu])
27gl_M4_BASE([m4])
28gl_PO_BASE([])
29gl_DOC_BASE([doc])
30gl_TESTS_BASE([tests])
31gl_LIB([libgnu])
32gl_MAKEFILE_NAME([])
33gl_LIBTOOL
34gl_MACRO_PREFIX([gl])
35gl_PO_DOMAIN([])
diff --git a/m4/gtk-2.0.m4 b/m4/gtk-2.0.m4
new file mode 100644
index 0000000..3deba01
--- /dev/null
+++ b/m4/gtk-2.0.m4
@@ -0,0 +1,196 @@
1# Configure paths for GTK+
2# Owen Taylor 1997-2001
3
4dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
5dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
6dnl pass to pkg-config
7dnl
8AC_DEFUN([AM_PATH_GTK_2_0],
9[dnl
10dnl Get the cflags and libraries from pkg-config
11dnl
12AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
13 , enable_gtktest=yes)
14
15 pkg_config_args=gtk+-2.0
16 for module in . $4
17 do
18 case "$module" in
19 gthread)
20 pkg_config_args="$pkg_config_args gthread-2.0"
21 ;;
22 esac
23 done
24
25 no_gtk=""
26
27 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
28
29 if test x$PKG_CONFIG != xno ; then
30 if pkg-config --atleast-pkgconfig-version 0.7 ; then
31 :
32 else
33 echo "*** pkg-config too old; version 0.7 or better required."
34 no_gtk=yes
35 PKG_CONFIG=no
36 fi
37 else
38 no_gtk=yes
39 fi
40
41 min_gtk_version=ifelse([$1], ,2.0.0,$1)
42 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
43
44 if test x$PKG_CONFIG != xno ; then
45 ## don't try to run the test against uninstalled libtool libs
46 if $PKG_CONFIG --uninstalled $pkg_config_args; then
47 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
48 enable_gtktest=no
49 fi
50
51 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
52 :
53 else
54 no_gtk=yes
55 fi
56 fi
57
58 if test x"$no_gtk" = x ; then
59 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
60 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
61 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
62 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
63 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
64 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
65 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
66 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
67 if test "x$enable_gtktest" = "xyes" ; then
68 ac_save_CFLAGS="$CFLAGS"
69 ac_save_LIBS="$LIBS"
70 CFLAGS="$CFLAGS $GTK_CFLAGS"
71 LIBS="$GTK_LIBS $LIBS"
72dnl
73dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
74dnl checks the results of pkg-config to some extent)
75dnl
76 rm -f conf.gtktest
77 AC_TRY_RUN([
78#include <gtk/gtk.h>
79#include <stdio.h>
80#include <stdlib.h>
81
82int
83main ()
84{
85 int major, minor, micro;
86 char *tmp_version;
87
88 system ("touch conf.gtktest");
89
90 /* HP/UX 9 (%@#!) writes to sscanf strings */
91 tmp_version = g_strdup("$min_gtk_version");
92 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
93 printf("%s, bad version string\n", "$min_gtk_version");
94 exit(1);
95 }
96
97 if ((gtk_major_version != $gtk_config_major_version) ||
98 (gtk_minor_version != $gtk_config_minor_version) ||
99 (gtk_micro_version != $gtk_config_micro_version))
100 {
101 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
102 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
103 gtk_major_version, gtk_minor_version, gtk_micro_version);
104 printf ("*** was found! If pkg-config was correct, then it is best\n");
105 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
106 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
107 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
108 printf("*** required on your system.\n");
109 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
110 printf("*** to point to the correct configuration files\n");
111 }
112 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
113 (gtk_minor_version != GTK_MINOR_VERSION) ||
114 (gtk_micro_version != GTK_MICRO_VERSION))
115 {
116 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
117 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
118 printf("*** library (version %d.%d.%d)\n",
119 gtk_major_version, gtk_minor_version, gtk_micro_version);
120 }
121 else
122 {
123 if ((gtk_major_version > major) ||
124 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
125 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
126 {
127 return 0;
128 }
129 else
130 {
131 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
132 gtk_major_version, gtk_minor_version, gtk_micro_version);
133 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
134 major, minor, micro);
135 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
136 printf("***\n");
137 printf("*** If you have already installed a sufficiently new version, this error\n");
138 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
139 printf("*** being found. The easiest way to fix this is to remove the old version\n");
140 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
141 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
142 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
143 printf("*** so that the correct libraries are found at run-time))\n");
144 }
145 }
146 return 1;
147}
148],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
149 CFLAGS="$ac_save_CFLAGS"
150 LIBS="$ac_save_LIBS"
151 fi
152 fi
153 if test "x$no_gtk" = x ; then
154 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
155 ifelse([$2], , :, [$2])
156 else
157 AC_MSG_RESULT(no)
158 if test "$PKG_CONFIG" = "no" ; then
159 echo "*** A new enough version of pkg-config was not found."
160 echo "*** See http://pkgconfig.sourceforge.net"
161 else
162 if test -f conf.gtktest ; then
163 :
164 else
165 echo "*** Could not run GTK+ test program, checking why..."
166 ac_save_CFLAGS="$CFLAGS"
167 ac_save_LIBS="$LIBS"
168 CFLAGS="$CFLAGS $GTK_CFLAGS"
169 LIBS="$LIBS $GTK_LIBS"
170 AC_TRY_LINK([
171#include <gtk/gtk.h>
172#include <stdio.h>
173], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
174 [ echo "*** The test program compiled, but did not run. This usually means"
175 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
176 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
177 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
178 echo "*** to the installed location Also, make sure you have run ldconfig if that"
179 echo "*** is required on your system"
180 echo "***"
181 echo "*** If you have an old version installed, it is best to remove it, although"
182 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
183 [ echo "*** The test program failed to compile or link. See the file config.log for the"
184 echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
185 CFLAGS="$ac_save_CFLAGS"
186 LIBS="$ac_save_LIBS"
187 fi
188 fi
189 GTK_CFLAGS=""
190 GTK_LIBS=""
191 ifelse([$3], , :, [$3])
192 fi
193 AC_SUBST(GTK_CFLAGS)
194 AC_SUBST(GTK_LIBS)
195 rm -f conf.gtktest
196])
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
new file mode 100644
index 0000000..afa9acb
--- /dev/null
+++ b/m4/intdiv0.m4
@@ -0,0 +1,87 @@
1# intdiv0.m4 serial 6 (gettext-0.18.2)
2dnl Copyright (C) 2002, 2007-2008, 2010-2014 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 Mac OS 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_RUN_IFELSE(
33 [AC_LANG_SOURCE([[
34#include <stdlib.h>
35#include <signal.h>
36
37static void
38sigfpe_handler (int sig)
39{
40 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
41 exit (sig != SIGFPE);
42}
43
44int x = 1;
45int y = 0;
46int z;
47int nan;
48
49int main ()
50{
51 signal (SIGFPE, sigfpe_handler);
52/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
53#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
54 signal (SIGTRAP, sigfpe_handler);
55#endif
56/* Linux/SPARC yields signal SIGILL. */
57#if defined (__sparc__) && defined (__linux__)
58 signal (SIGILL, sigfpe_handler);
59#endif
60
61 z = x / y;
62 nan = y / y;
63 exit (2);
64}
65]])],
66 [gt_cv_int_divbyzero_sigfpe=yes],
67 [gt_cv_int_divbyzero_sigfpe=no],
68 [
69 # Guess based on the CPU.
70changequote(,)dnl
71 case "$host_cpu" in
72 alpha* | i[34567]86 | x86_64 | m68k | s390*)
73 gt_cv_int_divbyzero_sigfpe="guessing yes";;
74 *)
75 gt_cv_int_divbyzero_sigfpe="guessing no";;
76 esac
77changequote([,])dnl
78 ])
79 fi
80 ])
81 case "$gt_cv_int_divbyzero_sigfpe" in
82 *yes) value=1;;
83 *) value=0;;
84 esac
85 AC_DEFINE_UNQUOTED([INTDIV0_RAISES_SIGFPE], [$value],
86 [Define if integer division by zero raises signal SIGFPE.])
87])
diff --git a/m4/intl.m4 b/m4/intl.m4
new file mode 100644
index 0000000..1747af9
--- /dev/null
+++ b/m4/intl.m4
@@ -0,0 +1,298 @@
1# intl.m4 serial 27 (gettext-0.19)
2dnl Copyright (C) 1995-2014 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.60])
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([AC_PROG_MKDIR_P])dnl
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 AC_REQUIRE([gl_EXTERN_INLINE])dnl
46 AC_REQUIRE([gt_GL_ATTRIBUTE])dnl
47
48 dnl Support for automake's --enable-silent-rules.
49 case "$enable_silent_rules" in
50 yes) INTL_DEFAULT_VERBOSITY=0;;
51 no) INTL_DEFAULT_VERBOSITY=1;;
52 *) INTL_DEFAULT_VERBOSITY=1;;
53 esac
54 AC_SUBST([INTL_DEFAULT_VERBOSITY])
55
56 AC_CHECK_TYPE([ptrdiff_t], ,
57 [AC_DEFINE([ptrdiff_t], [long],
58 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
59 ])
60 AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
61 AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
62 snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
63
64 dnl Use the _snprintf function only if it is declared (because on NetBSD it
65 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
66 AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
67
68 dnl Use the *_unlocked functions only if they are declared.
69 dnl (because some of them were defined without being declared in Solaris
70 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
71 dnl on Solaris 2.5.1 to run on Solaris 2.6).
72 AC_CHECK_DECLS([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_LINK_IFELSE(
224 [AC_LANG_PROGRAM(
225 [[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }]],
226 [[]])],
227 [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
228 [Define to 1 if the compiler understands __builtin_expect.])])
229
230 AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
231 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
232 stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
233 argz_stringify argz_next __fsetlocking])
234
235 dnl Use the *_unlocked functions only if they are declared.
236 dnl (because some of them were defined without being declared in Solaris
237 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
238 dnl on Solaris 2.5.1 to run on Solaris 2.6).
239 AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
240
241 AM_ICONV
242
243 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
244 dnl because plural.y uses bison specific features. It requires at least
245 dnl bison-2.7 for %define api.pure.
246 dnl bison is only needed for the maintainer (who touches plural.y). But in
247 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
248 dnl the rule in general Makefile. Now, some people carelessly touch the
249 dnl files or have a broken "make" program, hence the plural.c rule will
250 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
251 dnl present or too old.
252 AC_CHECK_PROGS([INTLBISON], [bison])
253 if test -z "$INTLBISON"; then
254 ac_verc_fail=yes
255 else
256 dnl Found it, now check the version.
257 AC_MSG_CHECKING([version of bison])
258changequote(<<,>>)dnl
259 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
260 case $ac_prog_version in
261 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
262 2.[7-9]* | [3-9].*)
263changequote([,])dnl
264 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
265 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
266 esac
267 AC_MSG_RESULT([$ac_prog_version])
268 fi
269 if test $ac_verc_fail = yes; then
270 INTLBISON=:
271 fi
272])
273
274dnl Copies _GL_UNUSED and _GL_ATTRIBUTE_PURE definitions from
275dnl gnulib-common.m4 as a fallback, if the project isn't using Gnulib.
276AC_DEFUN([gt_GL_ATTRIBUTE], [
277 m4_ifndef([gl_[]COMMON],
278 AH_VERBATIM([gt_gl_attribute],
279[/* Define as a marker that can be attached to declarations that might not
280 be used. This helps to reduce warnings, such as from
281 GCC -Wunused-parameter. */
282#ifndef _GL_UNUSED
283# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
284# define _GL_UNUSED __attribute__ ((__unused__))
285# else
286# define _GL_UNUSED
287# endif
288#endif
289
290/* The __pure__ attribute was added in gcc 2.96. */
291#ifndef _GL_ATTRIBUTE_PURE
292# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
293# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
294# else
295# define _GL_ATTRIBUTE_PURE /* empty */
296# endif
297#endif
298]))])
diff --git a/m4/intldir.m4 b/m4/intldir.m4
new file mode 100644
index 0000000..73b672a
--- /dev/null
+++ b/m4/intldir.m4
@@ -0,0 +1,19 @@
1# intldir.m4 serial 2 (gettext-0.18)
2dnl Copyright (C) 2006, 2009-2014 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], [])
diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4
new file mode 100644
index 0000000..8a045f6
--- /dev/null
+++ b/m4/intlmacosx.m4
@@ -0,0 +1,56 @@
1# intlmacosx.m4 serial 5 (gettext-0.18.2)
2dnl Copyright (C) 2004-2014 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 Mac OS X.
17dnl Defines INTL_MACOSX_LIBS.
18AC_DEFUN([gt_INTL_MACOSX],
19[
20 dnl Check for API introduced in Mac OS 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_LINK_IFELSE(
26 [AC_LANG_PROGRAM(
27 [[#include <CoreFoundation/CFPreferences.h>]],
28 [[CFPreferencesCopyAppValue(NULL, NULL)]])],
29 [gt_cv_func_CFPreferencesCopyAppValue=yes],
30 [gt_cv_func_CFPreferencesCopyAppValue=no])
31 LIBS="$gt_save_LIBS"])
32 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
33 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
34 [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
35 fi
36 dnl Check for API introduced in Mac OS X 10.3.
37 AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
38 [gt_save_LIBS="$LIBS"
39 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
40 AC_LINK_IFELSE(
41 [AC_LANG_PROGRAM(
42 [[#include <CoreFoundation/CFLocale.h>]],
43 [[CFLocaleCopyCurrent();]])],
44 [gt_cv_func_CFLocaleCopyCurrent=yes],
45 [gt_cv_func_CFLocaleCopyCurrent=no])
46 LIBS="$gt_save_LIBS"])
47 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
48 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
49 [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
50 fi
51 INTL_MACOSX_LIBS=
52 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
53 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
54 fi
55 AC_SUBST([INTL_MACOSX_LIBS])
56])
diff --git a/m4/intmax.m4 b/m4/intmax.m4
new file mode 100644
index 0000000..f70ceee
--- /dev/null
+++ b/m4/intmax.m4
@@ -0,0 +1,36 @@
1# intmax.m4 serial 6 (gettext-0.18.2)
2dnl Copyright (C) 2002-2005, 2008-2014 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_COMPILE_IFELSE(
17 [AC_LANG_PROGRAM(
18 [[
19#include <stddef.h>
20#include <stdlib.h>
21#if HAVE_STDINT_H_WITH_UINTMAX
22#include <stdint.h>
23#endif
24#if HAVE_INTTYPES_H_WITH_UINTMAX
25#include <inttypes.h>
26#endif
27 ]],
28 [[intmax_t x = -1;
29 return !x;]])],
30 [gt_cv_c_intmax_t=yes],
31 [gt_cv_c_intmax_t=no])])
32 if test $gt_cv_c_intmax_t = yes; then
33 AC_DEFINE([HAVE_INTMAX_T], [1],
34 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
35 fi
36])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
new file mode 100644
index 0000000..00251e1
--- /dev/null
+++ b/m4/inttypes-pri.m4
@@ -0,0 +1,42 @@
1# inttypes-pri.m4 serial 7 (gettext-0.18.2)
2dnl Copyright (C) 1997-2002, 2006, 2008-2014 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.53])
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_COMPILE_IFELSE(
22 [AC_LANG_PROGRAM(
23 [[
24#include <inttypes.h>
25#ifdef PRId32
26char *p = PRId32;
27#endif
28 ]],
29 [[]])],
30 [gt_cv_inttypes_pri_broken=no],
31 [gt_cv_inttypes_pri_broken=yes])
32 ])
33 fi
34 if test "$gt_cv_inttypes_pri_broken" = yes; then
35 AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
36 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
37 PRI_MACROS_BROKEN=1
38 else
39 PRI_MACROS_BROKEN=0
40 fi
41 AC_SUBST([PRI_MACROS_BROKEN])
42])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
new file mode 100644
index 0000000..ab370ff
--- /dev/null
+++ b/m4/inttypes.m4
@@ -0,0 +1,27 @@
1# inttypes.m4 serial 1 (gettext-0.11.4)
2dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License. As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8
9dnl From Paul Eggert.
10
11# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
12# <sys/types.h>.
13
14AC_DEFUN([gt_HEADER_INTTYPES_H],
15[
16 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
17 [
18 AC_TRY_COMPILE(
19 [#include <sys/types.h>
20#include <inttypes.h>],
21 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
22 ])
23 if test $gt_cv_header_inttypes_h = yes; then
24 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
25 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
26 fi
27])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
new file mode 100644
index 0000000..87be9cf
--- /dev/null
+++ b/m4/inttypes_h.m4
@@ -0,0 +1,29 @@
1# inttypes_h.m4 serial 10
2dnl Copyright (C) 1997-2004, 2006, 2008-2014 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_COMPILE_IFELSE(
16 [AC_LANG_PROGRAM(
17 [[
18#include <sys/types.h>
19#include <inttypes.h>
20 ]],
21 [[uintmax_t i = (uintmax_t) -1; return !i;]])],
22 [gl_cv_header_inttypes_h=yes],
23 [gl_cv_header_inttypes_h=no])])
24 if test $gl_cv_header_inttypes_h = yes; then
25 AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
26 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
27 and declares uintmax_t. ])
28 fi
29])
diff --git a/m4/isc-posix.m4 b/m4/isc-posix.m4
new file mode 100644
index 0000000..1319dd1
--- /dev/null
+++ b/m4/isc-posix.m4
@@ -0,0 +1,26 @@
1# isc-posix.m4 serial 2 (gettext-0.11.2)
2dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License. As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8
9# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
10
11# This test replaces the one in autoconf.
12# Currently this macro should have the same name as the autoconf macro
13# because gettext's gettext.m4 (distributed in the automake package)
14# still uses it. Otherwise, the use in gettext.m4 makes autoheader
15# give these diagnostics:
16# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
17# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
18
19undefine([AC_ISC_POSIX])
20
21AC_DEFUN([AC_ISC_POSIX],
22 [
23 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
24 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
25 ]
26)
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
new file mode 100644
index 0000000..7470ec5
--- /dev/null
+++ b/m4/lcmessage.m4
@@ -0,0 +1,35 @@
1# lcmessage.m4 serial 7 (gettext-0.18.2)
2dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014 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_LINK_IFELSE(
26 [AC_LANG_PROGRAM(
27 [[#include <locale.h>]],
28 [[return LC_MESSAGES]])],
29 [gt_cv_val_LC_MESSAGES=yes],
30 [gt_cv_val_LC_MESSAGES=no])])
31 if test $gt_cv_val_LC_MESSAGES = yes; then
32 AC_DEFINE([HAVE_LC_MESSAGES], [1],
33 [Define if your <locale.h> file defines LC_MESSAGES.])
34 fi
35])
diff --git a/m4/libcurl.m4 b/m4/libcurl.m4
new file mode 100644
index 0000000..a84077a
--- /dev/null
+++ b/m4/libcurl.m4
@@ -0,0 +1,251 @@
1# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
2# [ACTION-IF-YES], [ACTION-IF-NO])
3# ----------------------------------------------------------
4# David Shaw <dshaw@jabberwocky.com> May-09-2006
5#
6# Checks for libcurl. DEFAULT-ACTION is the string yes or no to
7# specify whether to default to --with-libcurl or --without-libcurl.
8# If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the
9# minimum version of libcurl to accept. Pass the version as a regular
10# version number like 7.10.1. If not supplied, any version is
11# accepted. ACTION-IF-YES is a list of shell commands to run if
12# libcurl was successfully found and passed the various tests.
13# ACTION-IF-NO is a list of shell commands that are run otherwise.
14# Note that using --without-libcurl does run ACTION-IF-NO.
15#
16# This macro #defines HAVE_LIBCURL if a working libcurl setup is
17# found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary
18# values. Other useful defines are LIBCURL_FEATURE_xxx where xxx are
19# the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy
20# where yyy are the various protocols supported by libcurl. Both xxx
21# and yyy are capitalized. See the list of AH_TEMPLATEs at the top of
22# the macro for the complete list of possible defines. Shell
23# variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also
24# defined to 'yes' for those features and protocols that were found.
25# Note that xxx and yyy keep the same capitalization as in the
26# curl-config list (e.g. it's "HTTP" and not "http").
27#
28# Users may override the detected values by doing something like:
29# LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure
30#
31# For the sake of sanity, this macro assumes that any libcurl that is
32# found is after version 7.7.2, the first version that included the
33# curl-config script. Note that it is very important for people
34# packaging binary versions of libcurl to include this script!
35# Without curl-config, we can only guess what protocols are available,
36# or use curl_version_info to figure it out at runtime.
37
38AC_DEFUN([LIBCURL_CHECK_CONFIG],
39[
40 AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL])
41 AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4])
42 AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6])
43 AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz])
44 AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS])
45 AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN])
46 AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI])
47 AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM])
48
49 AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP])
50 AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS])
51 AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP])
52 AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS])
53 AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE])
54 AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET])
55 AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
56 AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
57 AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
58 AH_TEMPLATE([LIBCURL_PROTOCOL_RTSP],[Defined if libcurl supports RTSP])
59 AH_TEMPLATE([LIBCURL_PROTOCOL_POP3],[Defined if libcurl supports POP3])
60 AH_TEMPLATE([LIBCURL_PROTOCOL_IMAP],[Defined if libcurl supports IMAP])
61 AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP])
62
63 AC_ARG_WITH(libcurl,
64 AC_HELP_STRING([--with-libcurl=PREFIX],[look for the curl library in PREFIX/lib and headers in PREFIX/include]),
65 [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
66
67 if test "$_libcurl_with" != "no" ; then
68
69 AC_PROG_AWK
70
71 _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
72
73 _libcurl_try_link=yes
74
75 if test -d "$_libcurl_with" ; then
76 LIBCURL_CPPFLAGS="-I$withval/include"
77 _libcurl_ldflags="-L$withval/lib"
78 AC_PATH_PROG([_libcurl_config],[curl-config],[],
79 ["$withval/bin"])
80 else
81 AC_PATH_PROG([_libcurl_config],[curl-config],[],[$PATH])
82 fi
83
84 if test x$_libcurl_config != "x" ; then
85 AC_CACHE_CHECK([for the version of libcurl],
86 [libcurl_cv_lib_curl_version],
87 [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`])
88
89 _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
90 _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
91
92 if test $_libcurl_wanted -gt 0 ; then
93 AC_CACHE_CHECK([for libcurl >= version $2],
94 [libcurl_cv_lib_version_ok],
95 [
96 if test $_libcurl_version -ge $_libcurl_wanted ; then
97 libcurl_cv_lib_version_ok=yes
98 else
99 libcurl_cv_lib_version_ok=no
100 fi
101 ])
102 fi
103
104 if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
105 if test x"$LIBCURL_CPPFLAGS" = "x" ; then
106 LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
107 fi
108 if test x"$LIBCURL" = "x" ; then
109 LIBCURL=`$_libcurl_config --libs`
110
111 # This is so silly, but Apple actually has a bug in their
112 # curl-config script. Fixed in Tiger, but there are still
113 # lots of Panther installs around.
114 case "${host}" in
115 powerpc-apple-darwin7*)
116 LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
117 ;;
118 esac
119 fi
120
121 # All curl-config scripts support --feature
122 _libcurl_features=`$_libcurl_config --feature`
123
124 # Is it modern enough to have --protocols? (7.12.4)
125 if test $_libcurl_version -ge 461828 ; then
126 _libcurl_protocols=`$_libcurl_config --protocols`
127 fi
128 else
129 _libcurl_try_link=no
130 fi
131
132 unset _libcurl_wanted
133 fi
134
135 if test $_libcurl_try_link = yes ; then
136
137 # we didn't find curl-config, so let's see if the user-supplied
138 # link line (or failing that, "-lcurl") is enough.
139 LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
140
141 AC_CACHE_CHECK([whether libcurl is usable],
142 [libcurl_cv_lib_curl_usable],
143 [
144 _libcurl_save_cppflags=$CPPFLAGS
145 CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
146 _libcurl_save_libs=$LIBS
147 LIBS="$LIBCURL $LIBS"
148
149 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curl/curl.h>]],[[
150/* Try and use a few common options to force a failure if we are
151 missing symbols or can't link. */
152int x;
153curl_easy_setopt(NULL,CURLOPT_URL,NULL);
154x=CURL_ERROR_SIZE;
155x=CURLOPT_WRITEFUNCTION;
156x=CURLOPT_WRITEDATA;
157x=CURLOPT_ERRORBUFFER;
158x=CURLOPT_STDERR;
159x=CURLOPT_VERBOSE;
160if (x) ;
161]])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
162
163 CPPFLAGS=$_libcurl_save_cppflags
164 LIBS=$_libcurl_save_libs
165 unset _libcurl_save_cppflags
166 unset _libcurl_save_libs
167 ])
168
169 if test $libcurl_cv_lib_curl_usable = yes ; then
170
171 # Does curl_free() exist in this version of libcurl?
172 # If not, fake it with free()
173
174 _libcurl_save_cppflags=$CPPFLAGS
175 CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
176 _libcurl_save_libs=$LIBS
177 LIBS="$LIBS $LIBCURL"
178
179 AC_CHECK_FUNC(curl_free,,
180 AC_DEFINE(curl_free,free,
181 [Define curl_free() as free() if our version of curl lacks curl_free.]))
182
183 CPPFLAGS=$_libcurl_save_cppflags
184 LIBS=$_libcurl_save_libs
185 unset _libcurl_save_cppflags
186 unset _libcurl_save_libs
187
188 AC_DEFINE(HAVE_LIBCURL,1,
189 [Define to 1 if you have a functional curl library.])
190 AC_SUBST(LIBCURL_CPPFLAGS)
191 AC_SUBST(LIBCURL)
192
193 for _libcurl_feature in $_libcurl_features ; do
194 AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
195 eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
196 done
197
198 if test "x$_libcurl_protocols" = "x" ; then
199
200 # We don't have --protocols, so just assume that all
201 # protocols are available
202 _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP"
203
204 if test x$libcurl_feature_SSL = xyes ; then
205 _libcurl_protocols="$_libcurl_protocols HTTPS"
206
207 # FTPS wasn't standards-compliant until version
208 # 7.11.0 (0x070b00 == 461568)
209 if test $_libcurl_version -ge 461568; then
210 _libcurl_protocols="$_libcurl_protocols FTPS"
211 fi
212 fi
213
214 # RTSP, IMAP, POP3 and SMTP were added in
215 # 7.20.0 (0x071400 == 463872)
216 if test $_libcurl_version -ge 463872; then
217 _libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP"
218 fi
219 fi
220
221 for _libcurl_protocol in $_libcurl_protocols ; do
222 AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
223 eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
224 done
225 else
226 unset LIBCURL
227 unset LIBCURL_CPPFLAGS
228 fi
229 fi
230
231 unset _libcurl_try_link
232 unset _libcurl_version_parse
233 unset _libcurl_config
234 unset _libcurl_feature
235 unset _libcurl_features
236 unset _libcurl_protocol
237 unset _libcurl_protocols
238 unset _libcurl_version
239 unset _libcurl_ldflags
240 fi
241
242 if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
243 # This is the IF-NO path
244 ifelse([$4],,:,[$4])
245 else
246 # This is the IF-YES path
247 ifelse([$3],,:,[$3])
248 fi
249
250 unset _libcurl_with
251])dnl
diff --git a/m4/libgcrypt.m4 b/m4/libgcrypt.m4
new file mode 100644
index 0000000..6cf482f
--- /dev/null
+++ b/m4/libgcrypt.m4
@@ -0,0 +1,122 @@
1dnl Autoconf macros for libgcrypt
2dnl Copyright (C) 2002, 2004, 2011 Free Software Foundation, Inc.
3dnl
4dnl This file is free software; as a special exception the author gives
5dnl unlimited permission to copy and/or distribute it, with or without
6dnl modifications, as long as this notice is preserved.
7dnl
8dnl This file is distributed in the hope that it will be useful, but
9dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12
13dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
14dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
15dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
16dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
17dnl with the API version to also check the API compatibility. Example:
18dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
19dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using
20dnl this features allows to prevent build against newer versions of libgcrypt
21dnl with a changed API.
22dnl
23AC_DEFUN([AM_PATH_LIBGCRYPT],
24[ AC_REQUIRE([AC_CANONICAL_HOST])
25 AC_ARG_WITH(libgcrypt-prefix,
26 AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
27 [prefix where LIBGCRYPT is installed (optional)]),
28 libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
29 if test x$libgcrypt_config_prefix != x ; then
30 if test x${LIBGCRYPT_CONFIG+set} != xset ; then
31 LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
32 fi
33 fi
34
35 AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
36 tmp=ifelse([$1], ,1:1.2.0,$1)
37 if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
38 req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
39 min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
40 else
41 req_libgcrypt_api=0
42 min_libgcrypt_version="$tmp"
43 fi
44
45 AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
46 ok=no
47 if test "$LIBGCRYPT_CONFIG" != "no" ; then
48 req_major=`echo $min_libgcrypt_version | \
49 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
50 req_minor=`echo $min_libgcrypt_version | \
51 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
52 req_micro=`echo $min_libgcrypt_version | \
53 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
54 libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
55 major=`echo $libgcrypt_config_version | \
56 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
57 minor=`echo $libgcrypt_config_version | \
58 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
59 micro=`echo $libgcrypt_config_version | \
60 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
61 if test "$major" -gt "$req_major"; then
62 ok=yes
63 else
64 if test "$major" -eq "$req_major"; then
65 if test "$minor" -gt "$req_minor"; then
66 ok=yes
67 else
68 if test "$minor" -eq "$req_minor"; then
69 if test "$micro" -ge "$req_micro"; then
70 ok=yes
71 fi
72 fi
73 fi
74 fi
75 fi
76 fi
77 if test $ok = yes; then
78 AC_MSG_RESULT([yes ($libgcrypt_config_version)])
79 else
80 AC_MSG_RESULT(no)
81 fi
82 if test $ok = yes; then
83 # If we have a recent libgcrypt, we should also check that the
84 # API is compatible
85 if test "$req_libgcrypt_api" -gt 0 ; then
86 tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
87 if test "$tmp" -gt 0 ; then
88 AC_MSG_CHECKING([LIBGCRYPT API version])
89 if test "$req_libgcrypt_api" -eq "$tmp" ; then
90 AC_MSG_RESULT([okay])
91 else
92 ok=no
93 AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
94 fi
95 fi
96 fi
97 fi
98 if test $ok = yes; then
99 LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
100 LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
101 ifelse([$2], , :, [$2])
102 libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
103 if test x"$libgcrypt_config_host" != xnone ; then
104 if test x"$libgcrypt_config_host" != x"$host" ; then
105 AC_MSG_WARN([[
106***
107*** The config script $LIBGCRYPT_CONFIG was
108*** built for $libgcrypt_config_host and thus may not match the
109*** used host $host.
110*** You may want to use the configure option --with-libgcrypt-prefix
111*** to specify a matching config script.
112***]])
113 fi
114 fi
115 else
116 LIBGCRYPT_CFLAGS=""
117 LIBGCRYPT_LIBS=""
118 ifelse([$3], , :, [$3])
119 fi
120 AC_SUBST(LIBGCRYPT_CFLAGS)
121 AC_SUBST(LIBGCRYPT_LIBS)
122])
diff --git a/m4/libgnurl.m4 b/m4/libgnurl.m4
new file mode 100644
index 0000000..da72e5e
--- /dev/null
+++ b/m4/libgnurl.m4
@@ -0,0 +1,266 @@
1# LIBGNURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
2# [ACTION-IF-YES], [ACTION-IF-NO])
3# ----------------------------------------------------------
4# David Shaw <dshaw@jabberwocky.com> May-09-2006
5#
6# Checks for libgnurl. DEFAULT-ACTION is the string yes or no to
7# specify whether to default to --with-libgnurl or --without-libgnurl.
8# If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the
9# minimum version of libgnurl to accept. Pass the version as a regular
10# version number like 7.10.1. If not supplied, any version is
11# accepted. ACTION-IF-YES is a list of shell commands to run if
12# libgnurl was successfully found and passed the various tests.
13# ACTION-IF-NO is a list of shell commands that are run otherwise.
14# Note that using --without-libgnurl does run ACTION-IF-NO.
15#
16# This macro #defines HAVE_LIBGNURL if a working libgnurl setup is
17# found, and sets @LIBGNURL@ and @LIBGNURL_CPPFLAGS@ to the necessary
18# values. Other useful defines are LIBGNURL_FEATURE_xxx where xxx are
19# the various features supported by libgnurl, and LIBGNURL_PROTOCOL_yyy
20# where yyy are the various protocols supported by libgnurl. Both xxx
21# and yyy are capitalized. See the list of AH_TEMPLATEs at the top of
22# the macro for the complete list of possible defines. Shell
23# variables $libgnurl_feature_xxx and $libgnurl_protocol_yyy are also
24# defined to 'yes' for those features and protocols that were found.
25# Note that xxx and yyy keep the same capitalization as in the
26# gnurl-config list (e.g. it's "HTTP" and not "http").
27#
28# Users may override the detected values by doing something like:
29# LIBGNURL="-lgnurl" LIBGNURL_CPPFLAGS="-I/usr/myinclude" ./configure
30#
31# For the sake of sanity, this macro assumes that any libgnurl that is
32# found is after version 7.7.2, the first version that included the
33# gnurl-config script. Note that it is very important for people
34# packaging binary versions of libgnurl to include this script!
35# Without gnurl-config, we can only guess what protocols are available,
36# or use gnurl_version_info to figure it out at runtime.
37
38AC_DEFUN([LIBGNURL_CHECK_CONFIG],
39[
40 AH_TEMPLATE([LIBGNURL_FEATURE_SSL],[Defined if libgnurl supports SSL])
41 AH_TEMPLATE([LIBGNURL_FEATURE_KRB4],[Defined if libgnurl supports KRB4])
42 AH_TEMPLATE([LIBGNURL_FEATURE_IPV6],[Defined if libgnurl supports IPv6])
43 AH_TEMPLATE([LIBGNURL_FEATURE_LIBZ],[Defined if libgnurl supports libz])
44 AH_TEMPLATE([LIBGNURL_FEATURE_ASYNCHDNS],[Defined if libgnurl supports AsynchDNS])
45 AH_TEMPLATE([LIBGNURL_FEATURE_IDN],[Defined if libgnurl supports IDN])
46 AH_TEMPLATE([LIBGNURL_FEATURE_SSPI],[Defined if libgnurl supports SSPI])
47 AH_TEMPLATE([LIBGNURL_FEATURE_NTLM],[Defined if libgnurl supports NTLM])
48
49 AH_TEMPLATE([LIBGNURL_PROTOCOL_HTTP],[Defined if libgnurl supports HTTP])
50 AH_TEMPLATE([LIBGNURL_PROTOCOL_HTTPS],[Defined if libgnurl supports HTTPS])
51 AH_TEMPLATE([LIBGNURL_PROTOCOL_FTP],[Defined if libgnurl supports FTP])
52 AH_TEMPLATE([LIBGNURL_PROTOCOL_FTPS],[Defined if libgnurl supports FTPS])
53 AH_TEMPLATE([LIBGNURL_PROTOCOL_FILE],[Defined if libgnurl supports FILE])
54 AH_TEMPLATE([LIBGNURL_PROTOCOL_TELNET],[Defined if libgnurl supports TELNET])
55 AH_TEMPLATE([LIBGNURL_PROTOCOL_LDAP],[Defined if libgnurl supports LDAP])
56 AH_TEMPLATE([LIBGNURL_PROTOCOL_DICT],[Defined if libgnurl supports DICT])
57 AH_TEMPLATE([LIBGNURL_PROTOCOL_TFTP],[Defined if libgnurl supports TFTP])
58 AH_TEMPLATE([LIBGNURL_PROTOCOL_RTSP],[Defined if libgnurl supports RTSP])
59 AH_TEMPLATE([LIBGNURL_PROTOCOL_POP3],[Defined if libgnurl supports POP3])
60 AH_TEMPLATE([LIBGNURL_PROTOCOL_IMAP],[Defined if libgnurl supports IMAP])
61 AH_TEMPLATE([LIBGNURL_PROTOCOL_SMTP],[Defined if libgnurl supports SMTP])
62
63 AC_ARG_WITH(libgnurl,
64 AC_HELP_STRING([--with-libgnurl=PREFIX],[look for the gnurl library in PREFIX/lib and headers in PREFIX/include]),
65 [_libgnurl_with=$withval],[_libgnurl_with=ifelse([$1],,[yes],[$1])])
66
67 if test "$_libgnurl_with" != "no" ; then
68
69 AC_PROG_AWK
70
71 _libgnurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
72
73 _libgnurl_try_link=yes
74
75 if test -d "$_libgnurl_with" ; then
76 LIBGNURL_CPPFLAGS="-I$withval/include"
77 _libgnurl_ldflags="-L$withval/lib"
78 AC_PATH_PROG([_libgnurl_config],[gnurl-config],[],
79 ["$withval/bin"])
80 else
81 AC_PATH_PROG([_libgnurl_config],[gnurl-config],[],[$PATH])
82 fi
83
84 if test x$_libgnurl_config != "x" ; then
85 AC_CACHE_CHECK([for the version of libgnurl],
86 [libgnurl_cv_lib_gnurl_version],
87 [libgnurl_cv_lib_gnurl_version=`$_libgnurl_config --version | $AWK '{print $[]2}'`])
88
89 _libgnurl_version=`echo $libgnurl_cv_lib_gnurl_version | $_libgnurl_version_parse`
90 _libgnurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libgnurl_version_parse`
91
92 if test $_libgnurl_wanted -gt 0 ; then
93 AC_CACHE_CHECK([for libgnurl >= version $2],
94 [libgnurl_cv_lib_version_ok],
95 [
96 if test $_libgnurl_version -ge $_libgnurl_wanted ; then
97 libgnurl_cv_lib_version_ok=yes
98 else
99 libgnurl_cv_lib_version_ok=no
100 fi
101 ])
102 fi
103
104 if test $_libgnurl_wanted -eq 0 || test x$libgnurl_cv_lib_version_ok = xyes ; then
105 if test x"$LIBGNURL_CPPFLAGS" = "x" ; then
106 LIBGNURL_CPPFLAGS=`$_libgnurl_config --cflags`
107 fi
108 if test x"$LIBGNURL" = "x" ; then
109 LIBGNURL=`$_libgnurl_config --libs`
110
111 # This is so silly, but Apple actually has a bug in their
112 # gnurl-config script. Fixed in Tiger, but there are still
113 # lots of Panther installs around.
114 case "${host}" in
115 powerpc-apple-darwin7*)
116 LIBGNURL=`echo $LIBGNURL | sed -e 's|-arch i386||g'`
117 ;;
118 esac
119 fi
120
121 # All gnurl-config scripts support --feature
122 _libgnurl_features=`$_libgnurl_config --feature`
123
124 # Is it modern enough to have --protocols? (7.12.4)
125 if test $_libgnurl_version -ge 461828 ; then
126 _libgnurl_protocols=`$_libgnurl_config --protocols`
127 fi
128 else
129 _libgnurl_try_link=no
130 fi
131
132 unset _libgnurl_wanted
133 fi
134
135 if test $_libgnurl_try_link = yes ; then
136
137 # we didn't find gnurl-config, so let's see if the user-supplied
138 # link line (or failing that, "-lgnurl") is enough.
139 LIBGNURL=${LIBGNURL-"$_libgnurl_ldflags -lgnurl"}
140
141 AC_CACHE_CHECK([whether libgnurl is usable],
142 [libgnurl_cv_lib_gnurl_usable],
143 [
144 _libgnurl_save_cppflags=$CPPFLAGS
145 CPPFLAGS="$LIBGNURL_CPPFLAGS $CPPFLAGS"
146 _libgnurl_save_libs=$LIBS
147 LIBS="$LIBGNURL $LIBS"
148
149 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <curl/curl.h>],[
150/* Try and use a few common options to force a failure if we are
151 missing symbols or can't link. */
152int x;
153curl_easy_setopt(NULL,CURLOPT_URL,NULL);
154x=CURL_ERROR_SIZE;
155x=CURLOPT_WRITEFUNCTION;
156x=CURLOPT_FILE;
157x=CURLOPT_ERRORBUFFER;
158x=CURLOPT_STDERR;
159x=CURLOPT_VERBOSE;
160])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no)
161
162# BEGIN Changes from original libcurl.m4:
163# Give it a 2nd shot using 'gnurl/curl.h'
164 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <gnurl/curl.h>],[
165/* Try and use a few common options to force a failure if we are
166 missing symbols or can't link. */
167int x;
168curl_easy_setopt(NULL,CURLOPT_URL,NULL);
169x=CURL_ERROR_SIZE;
170x=CURLOPT_WRITEFUNCTION;
171x=CURLOPT_FILE;
172x=CURLOPT_ERRORBUFFER;
173x=CURLOPT_STDERR;
174x=CURLOPT_VERBOSE;
175])],libgnurl_cv_lib_gnurl_usable=yes)
176# END Changes from original libcurl.m4:
177
178 CPPFLAGS=$_libgnurl_save_cppflags
179 LIBS=$_libgnurl_save_libs
180 unset _libgnurl_save_cppflags
181 unset _libgnurl_save_libs
182 ])
183
184 if test $libgnurl_cv_lib_gnurl_usable = yes ; then
185
186 # Does gnurl_free() exist in this version of libgnurl?
187 # If not, fake it with free()
188
189 _libgnurl_save_cppflags=$CPPFLAGS
190 CPPFLAGS="$CPPFLAGS $LIBGNURL_CPPFLAGS"
191 _libgnurl_save_libs=$LIBS
192 LIBS="$LIBS $LIBGNURL"
193
194 AC_CHECK_FUNC(curl_free,,
195 AC_DEFINE(curl_free,free,
196 [Define curl_free() as free() if our version of gnurl lacks curl_free.]))
197
198 CPPFLAGS=$_libgnurl_save_cppflags
199 LIBS=$_libgnurl_save_libs
200 unset _libgnurl_save_cppflags
201 unset _libgnurl_save_libs
202
203 AC_DEFINE(HAVE_LIBGNURL,1,
204 [Define to 1 if you have a functional gnurl library.])
205 AC_SUBST(LIBGNURL_CPPFLAGS)
206 AC_SUBST(LIBGNURL)
207
208 for _libgnurl_feature in $_libgnurl_features ; do
209 AC_DEFINE_UNQUOTED(AS_TR_CPP(libgnurl_feature_$_libgnurl_feature),[1])
210 eval AS_TR_SH(libgnurl_feature_$_libgnurl_feature)=yes
211 done
212
213 if test "x$_libgnurl_protocols" = "x" ; then
214
215 # We don't have --protocols, so just assume that all
216 # protocols are available
217 _libgnurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP"
218
219 if test x$libgnurl_feature_SSL = xyes ; then
220 _libgnurl_protocols="$_libgnurl_protocols HTTPS"
221
222 # FTPS wasn't standards-compliant until version
223 # 7.11.0 (0x070b00 == 461568)
224 if test $_libgnurl_version -ge 461568; then
225 _libgnurl_protocols="$_libgnurl_protocols FTPS"
226 fi
227 fi
228
229 # RTSP, IMAP, POP3 and SMTP were added in
230 # 7.20.0 (0x071400 == 463872)
231 if test $_libgnurl_version -ge 463872; then
232 _libgnurl_protocols="$_libgnurl_protocols RTSP IMAP POP3 SMTP"
233 fi
234 fi
235
236 for _libgnurl_protocol in $_libgnurl_protocols ; do
237 AC_DEFINE_UNQUOTED(AS_TR_CPP(libgnurl_protocol_$_libgnurl_protocol),[1])
238 eval AS_TR_SH(libgnurl_protocol_$_libgnurl_protocol)=yes
239 done
240 else
241 unset LIBGNURL
242 unset LIBGNURL_CPPFLAGS
243 fi
244 fi
245
246 unset _libgnurl_try_link
247 unset _libgnurl_version_parse
248 unset _libgnurl_config
249 unset _libgnurl_feature
250 unset _libgnurl_features
251 unset _libgnurl_protocol
252 unset _libgnurl_protocols
253 unset _libgnurl_version
254 unset _libgnurl_ldflags
255 fi
256
257 if test x$_libgnurl_with = xno || test x$libgnurl_cv_lib_gnurl_usable != xyes ; then
258 # This is the IF-NO path
259 ifelse([$4],,:,[$4])
260 else
261 # This is the IF-YES path
262 ifelse([$3],,:,[$3])
263 fi
264
265 unset _libgnurl_with
266])dnl
diff --git a/m4/libunistring.m4 b/m4/libunistring.m4
new file mode 100644
index 0000000..c1bf4d5
--- /dev/null
+++ b/m4/libunistring.m4
@@ -0,0 +1,150 @@
1# libunistring.m4 serial 11
2dnl Copyright (C) 2009-2012 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 gl_LIBUNISTRING
8dnl Searches for an installed libunistring.
9dnl If found, it sets and AC_SUBSTs HAVE_LIBUNISTRING=yes and the LIBUNISTRING
10dnl and LTLIBUNISTRING variables, sets the LIBUNISTRING_VERSION variable, and
11dnl augments the CPPFLAGS variable, and #defines HAVE_LIBUNISTRING to 1.
12dnl Otherwise, it sets and AC_SUBSTs HAVE_LIBUNISTRING=no and LIBUNISTRING and
13dnl LTLIBUNISTRING to empty.
14
15dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE for Autoconf >= 2.64, in order
16dnl to avoid warnings like
17dnl "warning: AC_REQUIRE: `gl_LIBUNISTRING' was expanded before it was required".
18dnl This is tricky because of the way 'aclocal' is implemented:
19dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
20dnl Otherwise aclocal's initial scan pass would miss the macro definition.
21dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
22dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
23dnl warnings.
24m4_define([gl_libunistring_AC_DEFUN],
25 m4_version_prereq([2.64],
26 [[AC_DEFUN_ONCE(
27 [$1], [$2])]],
28 [m4_ifdef([gl_00GNULIB],
29 [[AC_DEFUN_ONCE(
30 [$1], [$2])]],
31 [[AC_DEFUN(
32 [$1], [$2])]])]))
33gl_libunistring_AC_DEFUN([gl_LIBUNISTRING],
34[
35 AC_BEFORE([$0], [gl_LIBUNISTRING_MODULE])
36 AC_BEFORE([$0], [gl_LIBUNISTRING_LIBHEADER])
37 AC_BEFORE([$0], [gl_LIBUNISTRING_LIB_PREPARE])
38
39 m4_ifdef([gl_LIBUNISTRING_OPTIONAL],
40 [
41 AC_MSG_CHECKING([whether included libunistring is requested])
42 AC_ARG_WITH([included-libunistring],
43 [ --with-included-libunistring use the libunistring parts included here],
44 [gl_libunistring_force_included=$withval],
45 [gl_libunistring_force_included=no])
46 AC_MSG_RESULT([$gl_libunistring_force_included])
47 gl_libunistring_use_included="$gl_libunistring_force_included"
48 if test "$gl_libunistring_use_included" = yes; then
49 dnl Assume that libunistring is not installed until some other macro
50 dnl explicitly invokes gl_LIBUNISTRING_CORE.
51 if test -z "$HAVE_LIBUNISTRING"; then
52 HAVE_LIBUNISTRING=no
53 fi
54 LIBUNISTRING=
55 LTLIBUNISTRING=
56 else
57 gl_LIBUNISTRING_CORE
58 if test $HAVE_LIBUNISTRING = no; then
59 gl_libunistring_use_included=yes
60 LIBUNISTRING=
61 LTLIBUNISTRING=
62 fi
63 fi
64 ],
65 [gl_LIBUNISTRING_CORE])
66])
67
68AC_DEFUN([gl_LIBUNISTRING_CORE],
69[
70 AC_REQUIRE([AM_ICONV])
71 if test -n "$LIBICONV"; then
72 dnl First, try to link without -liconv. libunistring often depends on
73 dnl libiconv, but we don't know (and often don't need to know) where
74 dnl libiconv is installed.
75 AC_LIB_HAVE_LINKFLAGS([unistring], [],
76 [#include <uniconv.h>], [u8_strconv_from_locale((char*)0);],
77 [no, trying again together with libiconv])
78 if test "$ac_cv_libunistring" != yes; then
79 dnl Second try, with -liconv.
80 dnl We have to erase the cached result of the first AC_LIB_HAVE_LINKFLAGS
81 dnl invocation, otherwise the second one will not be run.
82 unset ac_cv_libunistring
83 glus_save_LIBS="$LIBS"
84 LIBS="$LIBS $LIBICONV"
85 AC_LIB_HAVE_LINKFLAGS([unistring], [],
86 [#include <uniconv.h>], [u8_strconv_from_locale((char*)0);],
87 [no, consider installing GNU libunistring])
88 if test -n "$LIBUNISTRING"; then
89 LIBUNISTRING="$LIBUNISTRING $LIBICONV"
90 LTLIBUNISTRING="$LTLIBUNISTRING $LTLIBICONV"
91 fi
92 LIBS="$glus_save_LIBS"
93 fi
94 else
95 AC_LIB_HAVE_LINKFLAGS([unistring], [],
96 [#include <uniconv.h>], [u8_strconv_from_locale((char*)0);],
97 [no, consider installing GNU libunistring])
98 fi
99 if test $HAVE_LIBUNISTRING = yes; then
100 dnl Determine the installed version.
101 AC_CACHE_CHECK([for libunistring version], [gl_cv_libunistring_version],
102 [AC_COMPUTE_INT([gl_libunistring_hexversion],
103 [_LIBUNISTRING_VERSION],
104 [#include <unistring/version.h>])
105 dnl Versions <= 0.9.3 had a hexversion of 0x0009.
106 dnl Use other tests to distinguish them.
107 if test $gl_libunistring_hexversion = 9; then
108 dnl Version 0.9.2 introduced the header <unistring/cdefs.h>.
109 AC_COMPILE_IFELSE(
110 [AC_LANG_PROGRAM([[#include <unistring/cdefs.h>]], [[]])],
111 [gl_cv_libunistring_version092=true],
112 [gl_cv_libunistring_version092=false])
113 if $gl_cv_libunistring_version092; then
114 dnl Version 0.9.3 changed a comment in <unistr.h>.
115 gl_ABSOLUTE_HEADER_ONE([unistr.h])
116 if test -n "$gl_cv_absolute_unistr_h" \
117 && grep 'Copy no more than N units of SRC to DEST. Return a pointer' $gl_cv_absolute_unistr_h > /dev/null; then
118 dnl Detected version 0.9.3.
119 gl_libunistring_hexversion=2307
120 else
121 dnl Detected version 0.9.2.
122 gl_libunistring_hexversion=2306
123 fi
124 else
125 dnl Version 0.9.1 introduced the type casing_suffix_context_t.
126 AC_COMPILE_IFELSE(
127 [AC_LANG_PROGRAM(
128 [[#include <unicase.h>
129 casing_suffix_context_t ct;]],
130 [[]])],
131 [gl_cv_libunistring_version091=true],
132 [gl_cv_libunistring_version091=false])
133 if $gl_cv_libunistring_version091; then
134 dnl Detected version 0.9.1.
135 gl_libunistring_hexversion=2305
136 else
137 dnl Detected version 0.9.
138 gl_libunistring_hexversion=2304
139 fi
140 fi
141 fi
142 dnl Transform into the usual major.minor.subminor notation.
143 gl_libunistring_major=`expr $gl_libunistring_hexversion / 65536`
144 gl_libunistring_minor=`expr $gl_libunistring_hexversion / 256 % 256`
145 gl_libunistring_subminor=`expr $gl_libunistring_hexversion % 256`
146 gl_cv_libunistring_version="$gl_libunistring_major.$gl_libunistring_minor.$gl_libunistring_subminor"
147 ])
148 LIBUNISTRING_VERSION="$gl_cv_libunistring_version"
149 fi
150])
diff --git a/m4/libxml2.m4 b/m4/libxml2.m4
new file mode 100644
index 0000000..68cd824
--- /dev/null
+++ b/m4/libxml2.m4
@@ -0,0 +1,188 @@
1# Configure paths for LIBXML2
2# Mike Hommey 2004-06-19
3# use CPPFLAGS instead of CFLAGS
4# Toshio Kuratomi 2001-04-21
5# Adapted from:
6# Configure paths for GLIB
7# Owen Taylor 97-11-3
8
9dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
10dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
11dnl
12AC_DEFUN([AM_PATH_XML2],[
13AC_ARG_WITH(xml-prefix,
14 [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
15 xml_config_prefix="$withval", xml_config_prefix="")
16AC_ARG_WITH(xml-exec-prefix,
17 [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
18 xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
19AC_ARG_ENABLE(xmltest,
20 [ --disable-xmltest Do not try to compile and run a test LIBXML program],,
21 enable_xmltest=yes)
22
23 if test x$xml_config_exec_prefix != x ; then
24 xml_config_args="$xml_config_args"
25 if test x${XML2_CONFIG+set} != xset ; then
26 XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
27 fi
28 fi
29 if test x$xml_config_prefix != x ; then
30 xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
31 if test x${XML2_CONFIG+set} != xset ; then
32 XML2_CONFIG=$xml_config_prefix/bin/xml2-config
33 fi
34 fi
35
36 AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
37 min_xml_version=ifelse([$1], ,2.0.0,[$1])
38 AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
39 no_xml=""
40 if test "$XML2_CONFIG" = "no" ; then
41 no_xml=yes
42 else
43 XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
44 XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
45 xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
46 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
47 xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
48 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
49 xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
50 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
51 if test "x$enable_xmltest" = "xyes" ; then
52 ac_save_CPPFLAGS="$CPPFLAGS"
53 ac_save_LIBS="$LIBS"
54 CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
55 LIBS="$XML_LIBS $LIBS"
56dnl
57dnl Now check if the installed libxml is sufficiently new.
58dnl (Also sanity checks the results of xml2-config to some extent)
59dnl
60 rm -f conf.xmltest
61 AC_TRY_RUN([
62#include <stdlib.h>
63#include <stdio.h>
64#include <string.h>
65#include <libxml/xmlversion.h>
66
67int
68main()
69{
70 int xml_major_version, xml_minor_version, xml_micro_version;
71 int major, minor, micro;
72 char *tmp_version;
73
74 system("touch conf.xmltest");
75
76 /* Capture xml2-config output via autoconf/configure variables */
77 /* HP/UX 9 (%@#!) writes to sscanf strings */
78 tmp_version = (char *)strdup("$min_xml_version");
79 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
80 printf("%s, bad version string from xml2-config\n", "$min_xml_version");
81 exit(1);
82 }
83 free(tmp_version);
84
85 /* Capture the version information from the header files */
86 tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
87 if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
88 printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
89 exit(1);
90 }
91 free(tmp_version);
92
93 /* Compare xml2-config output to the libxml headers */
94 if ((xml_major_version != $xml_config_major_version) ||
95 (xml_minor_version != $xml_config_minor_version) ||
96 (xml_micro_version != $xml_config_micro_version))
97 {
98 printf("*** libxml header files (version %d.%d.%d) do not match\n",
99 xml_major_version, xml_minor_version, xml_micro_version);
100 printf("*** xml2-config (version %d.%d.%d)\n",
101 $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
102 return 1;
103 }
104/* Compare the headers to the library to make sure we match */
105 /* Less than ideal -- doesn't provide us with return value feedback,
106 * only exits if there's a serious mismatch between header and library.
107 */
108 LIBXML_TEST_VERSION;
109
110 /* Test that the library is greater than our minimum version */
111 if ((xml_major_version > major) ||
112 ((xml_major_version == major) && (xml_minor_version > minor)) ||
113 ((xml_major_version == major) && (xml_minor_version == minor) &&
114 (xml_micro_version >= micro)))
115 {
116 return 0;
117 }
118 else
119 {
120 printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
121 xml_major_version, xml_minor_version, xml_micro_version);
122 printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
123 major, minor, micro);
124 printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
125 printf("***\n");
126 printf("*** If you have already installed a sufficiently new version, this error\n");
127 printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
128 printf("*** being found. The easiest way to fix this is to remove the old version\n");
129 printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
130 printf("*** correct copy of xml2-config. (In this case, you will have to\n");
131 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
132 printf("*** so that the correct libraries are found at run-time))\n");
133 }
134 return 1;
135}
136],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
137 CPPFLAGS="$ac_save_CPPFLAGS"
138 LIBS="$ac_save_LIBS"
139 fi
140 fi
141
142 if test "x$no_xml" = x ; then
143 AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
144 ifelse([$2], , :, [$2])
145 else
146 AC_MSG_RESULT(no)
147 if test "$XML2_CONFIG" = "no" ; then
148 echo "*** The xml2-config script installed by LIBXML could not be found"
149 echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
150 echo "*** your path, or set the XML2_CONFIG environment variable to the"
151 echo "*** full path to xml2-config."
152 else
153 if test -f conf.xmltest ; then
154 :
155 else
156 echo "*** Could not run libxml test program, checking why..."
157 CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
158 LIBS="$LIBS $XML_LIBS"
159 AC_TRY_LINK([
160#include <libxml/xmlversion.h>
161#include <stdio.h>
162], [ LIBXML_TEST_VERSION; return 0;],
163 [ echo "*** The test program compiled, but did not run. This usually means"
164 echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
165 echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
166 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
167 echo "*** to the installed location Also, make sure you have run ldconfig if that"
168 echo "*** is required on your system"
169 echo "***"
170 echo "*** If you have an old version installed, it is best to remove it, although"
171 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
172 [ echo "*** The test program failed to compile or link. See the file config.log for the"
173 echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
174 echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
175 echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
176 CPPFLAGS="$ac_save_CPPFLAGS"
177 LIBS="$ac_save_LIBS"
178 fi
179 fi
180
181 XML_CPPFLAGS=""
182 XML_LIBS=""
183 ifelse([$3], , :, [$3])
184 fi
185 AC_SUBST(XML_CPPFLAGS)
186 AC_SUBST(XML_LIBS)
187 rm -f conf.xmltest
188])
diff --git a/m4/lock.m4 b/m4/lock.m4
new file mode 100644
index 0000000..73a3c54
--- /dev/null
+++ b/m4/lock.m4
@@ -0,0 +1,42 @@
1# lock.m4 serial 13 (gettext-0.18.2)
2dnl Copyright (C) 2005-2014 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 Mac OS 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_COMPILE_IFELSE([
22 AC_LANG_PROGRAM(
23 [[#include <pthread.h>]],
24 [[
25#if __FreeBSD__ == 4
26error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
27#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
28 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
29error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
30#else
31int x = (int)PTHREAD_MUTEX_RECURSIVE;
32return !x;
33#endif
34 ]])],
35 [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
36 [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
37 fi
38 gl_PREREQ_LOCK
39])
40
41# Prerequisites of lib/glthread/lock.c.
42AC_DEFUN([gl_PREREQ_LOCK], [:])
diff --git a/m4/longdouble.m4 b/m4/longdouble.m4
new file mode 100644
index 0000000..25590f4
--- /dev/null
+++ b/m4/longdouble.m4
@@ -0,0 +1,31 @@
1# longdouble.m4 serial 2 (gettext-0.15)
2dnl Copyright (C) 2002-2003, 2006 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 compiler supports the 'long double' type.
9dnl Prerequisite: AC_PROG_CC
10
11dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
12dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
13
14AC_DEFUN([gt_TYPE_LONGDOUBLE],
15[
16 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
17 [if test "$GCC" = yes; then
18 gt_cv_c_long_double=yes
19 else
20 AC_TRY_COMPILE([
21 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
22 long double foo = 0.0;
23 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
24 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
25 ], ,
26 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
27 fi])
28 if test $gt_cv_c_long_double = yes; then
29 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
30 fi
31])
diff --git a/m4/longlong.m4 b/m4/longlong.m4
new file mode 100644
index 0000000..eefb37c
--- /dev/null
+++ b/m4/longlong.m4
@@ -0,0 +1,113 @@
1# longlong.m4 serial 17
2dnl Copyright (C) 1999-2007, 2009-2014 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, and can be faster
11# than what's in Autoconf 2.62 through 2.68.
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_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
20 AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
21 [ac_cv_type_long_long_int=yes
22 if test "x${ac_cv_prog_cc_c99-no}" = xno; then
23 ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
24 if test $ac_cv_type_long_long_int = yes; then
25 dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
26 dnl If cross compiling, assume the bug is not important, since
27 dnl nobody cross compiles for this platform as far as we know.
28 AC_RUN_IFELSE(
29 [AC_LANG_PROGRAM(
30 [[@%:@include <limits.h>
31 @%:@ifndef LLONG_MAX
32 @%:@ define HALF \
33 (1LL << (sizeof (long long int) * CHAR_BIT - 2))
34 @%:@ define LLONG_MAX (HALF - 1 + HALF)
35 @%:@endif]],
36 [[long long int n = 1;
37 int i;
38 for (i = 0; ; i++)
39 {
40 long long int m = n << i;
41 if (m >> i != n)
42 return 1;
43 if (LLONG_MAX / 2 < m)
44 break;
45 }
46 return 0;]])],
47 [],
48 [ac_cv_type_long_long_int=no],
49 [:])
50 fi
51 fi])
52 if test $ac_cv_type_long_long_int = yes; then
53 AC_DEFINE([HAVE_LONG_LONG_INT], [1],
54 [Define to 1 if the system has the type 'long long int'.])
55 fi
56])
57
58# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
59# This fixes a bug in Autoconf 2.61, and can be faster
60# than what's in Autoconf 2.62 through 2.68.
61
62# Note: If the type 'unsigned long long int' exists but is only 32 bits
63# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
64# will not be defined. In this case you can treat 'unsigned long long int'
65# like 'unsigned long int'.
66
67AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
68[
69 AC_CACHE_CHECK([for unsigned long long int],
70 [ac_cv_type_unsigned_long_long_int],
71 [ac_cv_type_unsigned_long_long_int=yes
72 if test "x${ac_cv_prog_cc_c99-no}" = xno; then
73 AC_LINK_IFELSE(
74 [_AC_TYPE_LONG_LONG_SNIPPET],
75 [],
76 [ac_cv_type_unsigned_long_long_int=no])
77 fi])
78 if test $ac_cv_type_unsigned_long_long_int = yes; then
79 AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
80 [Define to 1 if the system has the type 'unsigned long long int'.])
81 fi
82])
83
84# Expands to a C program that can be used to test for simultaneous support
85# of 'long long' and 'unsigned long long'. We don't want to say that
86# 'long long' is available if 'unsigned long long' is not, or vice versa,
87# because too many programs rely on the symmetry between signed and unsigned
88# integer types (excluding 'bool').
89AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
90[
91 AC_LANG_PROGRAM(
92 [[/* For now, do not test the preprocessor; as of 2007 there are too many
93 implementations with broken preprocessors. Perhaps this can
94 be revisited in 2012. In the meantime, code should not expect
95 #if to work with literals wider than 32 bits. */
96 /* Test literals. */
97 long long int ll = 9223372036854775807ll;
98 long long int nll = -9223372036854775807LL;
99 unsigned long long int ull = 18446744073709551615ULL;
100 /* Test constant expressions. */
101 typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
102 ? 1 : -1)];
103 typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
104 ? 1 : -1)];
105 int i = 63;]],
106 [[/* Test availability of runtime routines for shift and division. */
107 long long int llmax = 9223372036854775807ll;
108 unsigned long long int ullmax = 18446744073709551615ull;
109 return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
110 | (llmax / ll) | (llmax % ll)
111 | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
112 | (ullmax / ull) | (ullmax % ull));]])
113])
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4
new file mode 100644
index 0000000..3be95c1
--- /dev/null
+++ b/m4/printf-posix.m4
@@ -0,0 +1,48 @@
1# printf-posix.m4 serial 6 (gettext-0.18.2)
2dnl Copyright (C) 2003, 2007, 2009-2014 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_RUN_IFELSE(
18 [AC_LANG_SOURCE([[
19#include <stdio.h>
20#include <string.h>
21/* The string "%2$d %1$d", with dollar characters protected from the shell's
22 dollar expansion (possibly an autoconf bug). */
23static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
24static char buf[100];
25int main ()
26{
27 sprintf (buf, format, 33, 55);
28 return (strcmp (buf, "55 33") != 0);
29}]])],
30 [gt_cv_func_printf_posix=yes],
31 [gt_cv_func_printf_posix=no],
32 [
33 AC_EGREP_CPP([notposix], [
34#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
35 notposix
36#endif
37 ],
38 [gt_cv_func_printf_posix="guessing no"],
39 [gt_cv_func_printf_posix="guessing yes"])
40 ])
41 ])
42 case $gt_cv_func_printf_posix in
43 *yes)
44 AC_DEFINE([HAVE_POSIX_PRINTF], [1],
45 [Define if your printf() function supports format strings with positions.])
46 ;;
47 esac
48])
diff --git a/m4/signed.m4 b/m4/signed.m4
new file mode 100644
index 0000000..dc1f54f
--- /dev/null
+++ b/m4/signed.m4
@@ -0,0 +1,19 @@
1# signed.m4 serial 1 (gettext-0.10.40)
2dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License. As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8
9dnl From Bruno Haible.
10
11AC_DEFUN([bh_C_SIGNED],
12[
13 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
14 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
15 if test $bh_cv_c_signed = no; then
16 AC_DEFINE(signed, ,
17 [Define to empty if the C compiler doesn't support this keyword.])
18 fi
19])
diff --git a/m4/size_max.m4 b/m4/size_max.m4
new file mode 100644
index 0000000..7e192d5
--- /dev/null
+++ b/m4/size_max.m4
@@ -0,0 +1,79 @@
1# size_max.m4 serial 10
2dnl Copyright (C) 2003, 2005-2006, 2008-2014 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_COMPILE_IFELSE(
38 [AC_LANG_PROGRAM(
39 [[#include <stddef.h>
40 extern size_t foo;
41 extern unsigned long foo;
42 ]],
43 [[]])],
44 [fits_in_uint=0])
45 fi
46 dnl We cannot use 'expr' to simplify this expression, because 'expr'
47 dnl works only with 'long' integers in the host environment, while we
48 dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
49 if test $fits_in_uint = 1; then
50 gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
51 else
52 gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
53 fi
54 else
55 dnl Shouldn't happen, but who knows...
56 gl_cv_size_max='((size_t)~(size_t)0)'
57 fi
58 fi
59 ])
60 if test "$gl_cv_size_max" != yes; then
61 AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
62 [Define as the maximum value of type 'size_t', if the system doesn't define it.])
63 fi
64 dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
65 dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
66 dnl #define by AC_DEFINE_UNQUOTED.
67 AH_VERBATIM([SIZE_MAX],
68[/* Define as the maximum value of type 'size_t', if the system doesn't define
69 it. */
70#ifndef SIZE_MAX
71# undef SIZE_MAX
72#endif])
73])
74
75dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
76dnl Remove this when we can assume autoconf >= 2.61.
77m4_ifdef([AC_COMPUTE_INT], [], [
78 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
79])
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
new file mode 100644
index 0000000..7fc2ce9
--- /dev/null
+++ b/m4/stdint_h.m4
@@ -0,0 +1,27 @@
1# stdint_h.m4 serial 9
2dnl Copyright (C) 1997-2004, 2006, 2008-2014 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_COMPILE_IFELSE(
16 [AC_LANG_PROGRAM(
17 [[#include <sys/types.h>
18 #include <stdint.h>]],
19 [[uintmax_t i = (uintmax_t) -1; return !i;]])],
20 [gl_cv_header_stdint_h=yes],
21 [gl_cv_header_stdint_h=no])])
22 if test $gl_cv_header_stdint_h = yes; then
23 AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
24 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
25 and declares uintmax_t. ])
26 fi
27])
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
new file mode 100644
index 0000000..dc9a3d8
--- /dev/null
+++ b/m4/threadlib.m4
@@ -0,0 +1,389 @@
1# threadlib.m4 serial 11 (gettext-0.18.2)
2dnl Copyright (C) 2005-2014 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 If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
13dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
14dnl default is 'no', otherwise it is system dependent. In both cases, the user
15dnl can change the choice through the options --enable-threads=choice or
16dnl --disable-threads.
17dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
18dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
19dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
20dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
21dnl libtool).
22dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
23dnl programs that really need multithread functionality. The difference
24dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
25dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
26dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
27dnl multithread-safe programs.
28
29AC_DEFUN([gl_THREADLIB_EARLY],
30[
31 AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
32])
33
34dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
35
36AC_DEFUN([gl_THREADLIB_EARLY_BODY],
37[
38 dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
39 dnl influences the result of the autoconf tests that test for *_unlocked
40 dnl declarations, on AIX 5 at least. Therefore it must come early.
41 AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
42 AC_BEFORE([$0], [gl_ARGP])dnl
43
44 AC_REQUIRE([AC_CANONICAL_HOST])
45 dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
46 dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
47 dnl AC_GNU_SOURCE.
48 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
49 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
50 [AC_REQUIRE([AC_GNU_SOURCE])])
51 dnl Check for multithreading.
52 m4_ifdef([gl_THREADLIB_DEFAULT_NO],
53 [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
54 [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
55 AC_ARG_ENABLE([threads],
56AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
57AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
58 [gl_use_threads=$enableval],
59 [if test -n "$gl_use_threads_default"; then
60 gl_use_threads="$gl_use_threads_default"
61 else
62changequote(,)dnl
63 case "$host_os" in
64 dnl Disable multithreading by default on OSF/1, because it interferes
65 dnl with fork()/exec(): When msgexec is linked with -lpthread, its
66 dnl child process gets an endless segmentation fault inside execvp().
67 dnl Disable multithreading by default on Cygwin 1.5.x, because it has
68 dnl bugs that lead to endless loops or crashes. See
69 dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
70 osf*) gl_use_threads=no ;;
71 cygwin*)
72 case `uname -r` in
73 1.[0-5].*) gl_use_threads=no ;;
74 *) gl_use_threads=yes ;;
75 esac
76 ;;
77 *) gl_use_threads=yes ;;
78 esac
79changequote([,])dnl
80 fi
81 ])
82 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
83 # For using <pthread.h>:
84 case "$host_os" in
85 osf*)
86 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
87 # groks <pthread.h>. cc also understands the flag -pthread, but
88 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
89 # 2. putting a flag into CPPFLAGS that has an effect on the linker
90 # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
91 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
92 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
93 ;;
94 esac
95 # Some systems optimize for single-threaded programs by default, and
96 # need special flags to disable these optimizations. For example, the
97 # definition of 'errno' in <errno.h>.
98 case "$host_os" in
99 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
100 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
101 esac
102 fi
103])
104
105dnl The guts of gl_THREADLIB. Needs to be expanded only once.
106
107AC_DEFUN([gl_THREADLIB_BODY],
108[
109 AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
110 gl_threads_api=none
111 LIBTHREAD=
112 LTLIBTHREAD=
113 LIBMULTITHREAD=
114 LTLIBMULTITHREAD=
115 if test "$gl_use_threads" != no; then
116 dnl Check whether the compiler and linker support weak declarations.
117 AC_CACHE_CHECK([whether imported symbols can be declared weak],
118 [gl_cv_have_weak],
119 [gl_cv_have_weak=no
120 dnl First, test whether the compiler accepts it syntactically.
121 AC_LINK_IFELSE(
122 [AC_LANG_PROGRAM(
123 [[extern void xyzzy ();
124#pragma weak xyzzy]],
125 [[xyzzy();]])],
126 [gl_cv_have_weak=maybe])
127 if test $gl_cv_have_weak = maybe; then
128 dnl Second, test whether it actually works. On Cygwin 1.7.2, with
129 dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
130 AC_RUN_IFELSE(
131 [AC_LANG_SOURCE([[
132#include <stdio.h>
133#pragma weak fputs
134int main ()
135{
136 return (fputs == NULL);
137}]])],
138 [gl_cv_have_weak=yes],
139 [gl_cv_have_weak=no],
140 [dnl When cross-compiling, assume that only ELF platforms support
141 dnl weak symbols.
142 AC_EGREP_CPP([Extensible Linking Format],
143 [#ifdef __ELF__
144 Extensible Linking Format
145 #endif
146 ],
147 [gl_cv_have_weak="guessing yes"],
148 [gl_cv_have_weak="guessing no"])
149 ])
150 fi
151 ])
152 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
153 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
154 # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
155 AC_CHECK_HEADER([pthread.h],
156 [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
157 if test "$gl_have_pthread_h" = yes; then
158 # Other possible tests:
159 # -lpthreads (FSU threads, PCthreads)
160 # -lgthreads
161 gl_have_pthread=
162 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
163 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
164 # the second one only in libpthread, and lock.c needs it.
165 #
166 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
167 # needs -pthread for some reason. See:
168 # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
169 save_LIBS=$LIBS
170 for gl_pthread in '' '-pthread'; do
171 LIBS="$LIBS $gl_pthread"
172 AC_LINK_IFELSE(
173 [AC_LANG_PROGRAM(
174 [[#include <pthread.h>
175 pthread_mutex_t m;
176 pthread_mutexattr_t ma;
177 ]],
178 [[pthread_mutex_lock (&m);
179 pthread_mutexattr_init (&ma);]])],
180 [gl_have_pthread=yes
181 LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
182 LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread])
183 LIBS=$save_LIBS
184 test -n "$gl_have_pthread" && break
185 done
186
187 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
188 # since it is defined as a macro on OSF/1.)
189 if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
190 # The program links fine without libpthread. But it may actually
191 # need to link with libpthread in order to create multiple threads.
192 AC_CHECK_LIB([pthread], [pthread_kill],
193 [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
194 # On Solaris and HP-UX, most pthread functions exist also in libc.
195 # Therefore pthread_in_use() needs to actually try to create a
196 # thread: pthread_create from libc will fail, whereas
197 # pthread_create will actually create a thread.
198 case "$host_os" in
199 solaris* | hpux*)
200 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
201 [Define if the pthread_in_use() detection is hard.])
202 esac
203 ])
204 elif test -z "$gl_have_pthread"; then
205 # Some library is needed. Try libpthread and libc_r.
206 AC_CHECK_LIB([pthread], [pthread_kill],
207 [gl_have_pthread=yes
208 LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
209 LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
210 if test -z "$gl_have_pthread"; then
211 # For FreeBSD 4.
212 AC_CHECK_LIB([c_r], [pthread_kill],
213 [gl_have_pthread=yes
214 LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
215 LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
216 fi
217 fi
218 if test -n "$gl_have_pthread"; then
219 gl_threads_api=posix
220 AC_DEFINE([USE_POSIX_THREADS], [1],
221 [Define if the POSIX multithreading library can be used.])
222 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
223 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
224 AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
225 [Define if references to the POSIX multithreading library should be made weak.])
226 LIBTHREAD=
227 LTLIBTHREAD=
228 fi
229 fi
230 fi
231 fi
232 fi
233 if test -z "$gl_have_pthread"; then
234 if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
235 gl_have_solaristhread=
236 gl_save_LIBS="$LIBS"
237 LIBS="$LIBS -lthread"
238 AC_LINK_IFELSE(
239 [AC_LANG_PROGRAM(
240 [[
241#include <thread.h>
242#include <synch.h>
243 ]],
244 [[thr_self();]])],
245 [gl_have_solaristhread=yes])
246 LIBS="$gl_save_LIBS"
247 if test -n "$gl_have_solaristhread"; then
248 gl_threads_api=solaris
249 LIBTHREAD=-lthread
250 LTLIBTHREAD=-lthread
251 LIBMULTITHREAD="$LIBTHREAD"
252 LTLIBMULTITHREAD="$LTLIBTHREAD"
253 AC_DEFINE([USE_SOLARIS_THREADS], [1],
254 [Define if the old Solaris multithreading library can be used.])
255 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
256 AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
257 [Define if references to the old Solaris multithreading library should be made weak.])
258 LIBTHREAD=
259 LTLIBTHREAD=
260 fi
261 fi
262 fi
263 fi
264 if test "$gl_use_threads" = pth; then
265 gl_save_CPPFLAGS="$CPPFLAGS"
266 AC_LIB_LINKFLAGS([pth])
267 gl_have_pth=
268 gl_save_LIBS="$LIBS"
269 LIBS="$LIBS $LIBPTH"
270 AC_LINK_IFELSE(
271 [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
272 [gl_have_pth=yes])
273 LIBS="$gl_save_LIBS"
274 if test -n "$gl_have_pth"; then
275 gl_threads_api=pth
276 LIBTHREAD="$LIBPTH"
277 LTLIBTHREAD="$LTLIBPTH"
278 LIBMULTITHREAD="$LIBTHREAD"
279 LTLIBMULTITHREAD="$LTLIBTHREAD"
280 AC_DEFINE([USE_PTH_THREADS], [1],
281 [Define if the GNU Pth multithreading library can be used.])
282 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
283 if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
284 AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
285 [Define if references to the GNU Pth multithreading library should be made weak.])
286 LIBTHREAD=
287 LTLIBTHREAD=
288 fi
289 fi
290 else
291 CPPFLAGS="$gl_save_CPPFLAGS"
292 fi
293 fi
294 if test -z "$gl_have_pthread"; then
295 case "$gl_use_threads" in
296 yes | windows | win32) # The 'win32' is for backward compatibility.
297 if { case "$host_os" in
298 mingw*) true;;
299 *) false;;
300 esac
301 }; then
302 gl_threads_api=windows
303 AC_DEFINE([USE_WINDOWS_THREADS], [1],
304 [Define if the native Windows multithreading API can be used.])
305 fi
306 ;;
307 esac
308 fi
309 fi
310 AC_MSG_CHECKING([for multithread API to use])
311 AC_MSG_RESULT([$gl_threads_api])
312 AC_SUBST([LIBTHREAD])
313 AC_SUBST([LTLIBTHREAD])
314 AC_SUBST([LIBMULTITHREAD])
315 AC_SUBST([LTLIBMULTITHREAD])
316])
317
318AC_DEFUN([gl_THREADLIB],
319[
320 AC_REQUIRE([gl_THREADLIB_EARLY])
321 AC_REQUIRE([gl_THREADLIB_BODY])
322])
323
324
325dnl gl_DISABLE_THREADS
326dnl ------------------
327dnl Sets the gl_THREADLIB default so that threads are not used by default.
328dnl The user can still override it at installation time, by using the
329dnl configure option '--enable-threads'.
330
331AC_DEFUN([gl_DISABLE_THREADS], [
332 m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
333])
334
335
336dnl Survey of platforms:
337dnl
338dnl Platform Available Compiler Supports test-lock
339dnl flavours option weak result
340dnl --------------- --------- --------- -------- ---------
341dnl Linux 2.4/glibc posix -lpthread Y OK
342dnl
343dnl GNU Hurd/glibc posix
344dnl
345dnl Ubuntu 14.04 posix -pthread Y OK
346dnl
347dnl FreeBSD 5.3 posix -lc_r Y
348dnl posix -lkse ? Y
349dnl posix -lpthread ? Y
350dnl posix -lthr Y
351dnl
352dnl FreeBSD 5.2 posix -lc_r Y
353dnl posix -lkse Y
354dnl posix -lthr Y
355dnl
356dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
357dnl
358dnl NetBSD 1.6 --
359dnl
360dnl OpenBSD 3.4 posix -lpthread Y OK
361dnl
362dnl Mac OS X 10.[123] posix -lpthread Y OK
363dnl
364dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
365dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
366dnl
367dnl HP-UX 11 posix -lpthread N (cc) OK
368dnl Y (gcc)
369dnl
370dnl IRIX 6.5 posix -lpthread Y 0.5
371dnl
372dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
373dnl
374dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
375dnl -lpthread (gcc) Y
376dnl
377dnl Cygwin posix -lpthread Y OK
378dnl
379dnl Any of the above pth -lpth 0.0
380dnl
381dnl Mingw windows N OK
382dnl
383dnl BeOS 5 --
384dnl
385dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
386dnl turned off:
387dnl OK if all three tests terminate OK,
388dnl 0.5 if the first test terminates OK but the second one loops endlessly,
389dnl 0.0 if the first test already loops endlessly.
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4
new file mode 100644
index 0000000..0a94f17
--- /dev/null
+++ b/m4/uintmax_t.m4
@@ -0,0 +1,30 @@
1# uintmax_t.m4 serial 12
2dnl Copyright (C) 1997-2004, 2007-2014 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])
diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4
new file mode 100644
index 0000000..9fae98e
--- /dev/null
+++ b/m4/ulonglong.m4
@@ -0,0 +1,48 @@
1# ulonglong.m4 serial 6
2dnl Copyright (C) 1999-2006 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_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
10# This fixes a bug in Autoconf 2.60, but can be removed once we
11# assume 2.61 everywhere.
12
13# Note: If the type 'unsigned long long int' exists but is only 32 bits
14# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
15# will not be defined. In this case you can treat 'unsigned long long int'
16# like 'unsigned long int'.
17
18AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
19[
20 AC_CACHE_CHECK([for unsigned long long int],
21 [ac_cv_type_unsigned_long_long_int],
22 [AC_LINK_IFELSE(
23 [AC_LANG_PROGRAM(
24 [[unsigned long long int ull = 18446744073709551615ULL;
25 typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1
26 ? 1 : -1)];
27 int i = 63;]],
28 [[unsigned long long int ullmax = 18446744073709551615ull;
29 return (ull << 63 | ull >> 63 | ull << i | ull >> i
30 | ullmax / ull | ullmax % ull);]])],
31 [ac_cv_type_unsigned_long_long_int=yes],
32 [ac_cv_type_unsigned_long_long_int=no])])
33 if test $ac_cv_type_unsigned_long_long_int = yes; then
34 AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1,
35 [Define to 1 if the system has the type `unsigned long long int'.])
36 fi
37])
38
39# This macro is obsolescent and should go away soon.
40AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
41[
42 AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
43 ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int
44 if test $ac_cv_type_unsigned_long_long = yes; then
45 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
46 [Define if you have the 'unsigned long long' type.])
47 fi
48])
diff --git a/m4/visibility.m4 b/m4/visibility.m4
new file mode 100644
index 0000000..552e397
--- /dev/null
+++ b/m4/visibility.m4
@@ -0,0 +1,77 @@
1# visibility.m4 serial 5 (gettext-0.18.2)
2dnl Copyright (C) 2005, 2008, 2010-2014 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 Tests whether the compiler supports the command-line option
10dnl -fvisibility=hidden and the function and variable attributes
11dnl __attribute__((__visibility__("hidden"))) and
12dnl __attribute__((__visibility__("default"))).
13dnl Does *not* test for __visibility__("protected") - which has tricky
14dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
15dnl Mac OS X.
16dnl Does *not* test for __visibility__("internal") - which has processor
17dnl dependent semantics.
18dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
19dnl "really only recommended for legacy code".
20dnl Set the variable CFLAG_VISIBILITY.
21dnl Defines and sets the variable HAVE_VISIBILITY.
22
23AC_DEFUN([gl_VISIBILITY],
24[
25 AC_REQUIRE([AC_PROG_CC])
26 CFLAG_VISIBILITY=
27 HAVE_VISIBILITY=0
28 if test -n "$GCC"; then
29 dnl First, check whether -Werror can be added to the command line, or
30 dnl whether it leads to an error because of some other option that the
31 dnl user has put into $CC $CFLAGS $CPPFLAGS.
32 AC_MSG_CHECKING([whether the -Werror option is usable])
33 AC_CACHE_VAL([gl_cv_cc_vis_werror], [
34 gl_save_CFLAGS="$CFLAGS"
35 CFLAGS="$CFLAGS -Werror"
36 AC_COMPILE_IFELSE(
37 [AC_LANG_PROGRAM([[]], [[]])],
38 [gl_cv_cc_vis_werror=yes],
39 [gl_cv_cc_vis_werror=no])
40 CFLAGS="$gl_save_CFLAGS"])
41 AC_MSG_RESULT([$gl_cv_cc_vis_werror])
42 dnl Now check whether visibility declarations are supported.
43 AC_MSG_CHECKING([for simple visibility declarations])
44 AC_CACHE_VAL([gl_cv_cc_visibility], [
45 gl_save_CFLAGS="$CFLAGS"
46 CFLAGS="$CFLAGS -fvisibility=hidden"
47 dnl We use the option -Werror and a function dummyfunc, because on some
48 dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
49 dnl "visibility attribute not supported in this configuration; ignored"
50 dnl at the first function definition in every compilation unit, and we
51 dnl don't want to use the option in this case.
52 if test $gl_cv_cc_vis_werror = yes; then
53 CFLAGS="$CFLAGS -Werror"
54 fi
55 AC_COMPILE_IFELSE(
56 [AC_LANG_PROGRAM(
57 [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
58 extern __attribute__((__visibility__("default"))) int exportedvar;
59 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
60 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
61 void dummyfunc (void) {}
62 ]],
63 [[]])],
64 [gl_cv_cc_visibility=yes],
65 [gl_cv_cc_visibility=no])
66 CFLAGS="$gl_save_CFLAGS"])
67 AC_MSG_RESULT([$gl_cv_cc_visibility])
68 if test $gl_cv_cc_visibility = yes; then
69 CFLAG_VISIBILITY="-fvisibility=hidden"
70 HAVE_VISIBILITY=1
71 fi
72 fi
73 AC_SUBST([CFLAG_VISIBILITY])
74 AC_SUBST([HAVE_VISIBILITY])
75 AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
76 [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
77])
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
new file mode 100644
index 0000000..9b07b07
--- /dev/null
+++ b/m4/wint_t.m4
@@ -0,0 +1,32 @@
1# wint_t.m4 serial 5 (gettext-0.18.2)
2dnl Copyright (C) 2003, 2007-2014 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_COMPILE_IFELSE(
15 [AC_LANG_PROGRAM(
16 [[
17/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
18 <wchar.h>.
19 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
20 before <wchar.h>. */
21#include <stddef.h>
22#include <stdio.h>
23#include <time.h>
24#include <wchar.h>
25 wint_t foo = (wchar_t)'\0';]],
26 [[]])],
27 [gt_cv_c_wint_t=yes],
28 [gt_cv_c_wint_t=no])])
29 if test $gt_cv_c_wint_t = yes; then
30 AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
31 fi
32])
diff --git a/m4/xsize.m4 b/m4/xsize.m4
new file mode 100644
index 0000000..3af23ec
--- /dev/null
+++ b/m4/xsize.m4
@@ -0,0 +1,12 @@
1# xsize.m4 serial 5
2dnl Copyright (C) 2003-2004, 2008-2014 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_CHECK_HEADERS([stdint.h])
12])
diff --git a/pkgconfig/gnunetsocial.pc.in b/pkgconfig/gnunetsocial.pc.in
new file mode 100644
index 0000000..5ea9c6a
--- /dev/null
+++ b/pkgconfig/gnunetsocial.pc.in
@@ -0,0 +1,12 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: GNUnet Social
7Description: library for social interactions
8URL: https://gnunet.org
9Version: @VERSION@
10Requires:
11Libs: -L${libdir} -lgnunetsocial
12Cflags: -I${includedir}