diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2021-11-25 20:47:49 +0100 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2021-11-25 20:47:49 +0100 |
commit | a24bbd5b39c7d26d97af357531ed05579016bd69 (patch) | |
tree | aa6094e8ce1c41f2b323ceba803701d385ba3ade /m4 | |
parent | 63854ee52ec8d24928c2346928a3dbea22ebd1fe (diff) | |
parent | 0bd99177d2424a76bcf26b5347bfe8ee568348e8 (diff) | |
download | gnunet-a24bbd5b39c7d26d97af357531ed05579016bd69.tar.gz gnunet-a24bbd5b39c7d26d97af357531ed05579016bd69.zip |
Merge branch 'dev/vanni/bcd-new'
Diffstat (limited to 'm4')
-rw-r--r-- | m4/check-latex-package.m4 | 42 | ||||
-rw-r--r-- | m4/check-libheader.m4 | 35 | ||||
-rw-r--r-- | m4/iconv.m4 | 118 | ||||
-rw-r--r-- | m4/libcurl.m4 | 23 | ||||
-rw-r--r-- | m4/libgcrypt.m4 | 87 | ||||
-rw-r--r-- | m4/libgnurl.m4 | 21 | ||||
-rw-r--r-- | m4/libunistring.m4 | 21 |
7 files changed, 230 insertions, 117 deletions
diff --git a/m4/check-latex-package.m4 b/m4/check-latex-package.m4 new file mode 100644 index 000000000..7b7861134 --- /dev/null +++ b/m4/check-latex-package.m4 | |||
@@ -0,0 +1,42 @@ | |||
1 | dnl | ||
2 | dnl CHECK_LATEX_PACKAGE(FEATURE-NAME, | ||
3 | dnl PACKAGE-NAME, | ||
4 | dnl ACTION-IF-FOUND, | ||
5 | dnl ACTION-IF-NOT-FOUND) | ||
6 | dnl | ||
7 | dnl Tries to compile a small LaTeX document to see if the requested package is | ||
8 | dnl available to be used with \usepackage. | ||
9 | dnl | ||
10 | dnl The result will be cached in the ac_cv_tex_PACKAGE-NAME variable. | ||
11 | dnl | ||
12 | dnl This macro also checks for pdflatex as in AC_CHECK_PROGS and the result | ||
13 | dnl is made available in the PDFLATEX_BINARY variable (all capitals like that.) | ||
14 | dnl | ||
15 | dnl FEATURE-NAME is one or more words to identify the check; | ||
16 | dnl PACKAGE-NAME is the package as it appears in the \usepackage statement | ||
17 | dnl ACTION-IF-FOUND (optional) commands to execute if the package is installed | ||
18 | dnl ACTION-IF-NOT-FOUND (optional) the inverse of ACTION-IF-FOUND | ||
19 | dnl | ||
20 | AC_DEFUN([CHECK_LATEX_PACKAGE], | ||
21 | [AC_CHECK_PROGS([PDFLATEX_BINARY], [pdflatex], [no]) | ||
22 | |||
23 | AS_IF([test "x$ac_cv_prog_PDFLATEX_BINARY" = "xno"], | ||
24 | [m4_if([$4], ,:,[$4])], | ||
25 | [AC_CACHE_CHECK([for the $1 package for LaTeX], [AS_TR_SH([ac_cv_tex_][$2])], | ||
26 | [cat <<EOF > conftest.tex | ||
27 | \\documentclass{article} | ||
28 | \\usepackage{$2} | ||
29 | \\begin{document} | ||
30 | Hello | ||
31 | \\end{document} | ||
32 | EOF | ||
33 | |||
34 | "$ac_cv_prog_PDFLATEX_BINARY" conftest.tex 1>/dev/null 2>&1 | ||
35 | AS_IF([test "x$?" = "x0"], | ||
36 | [AS_VAR_SET([AS_TR_SH([ac_cv_tex_][$2])], [yes])], | ||
37 | [AS_VAR_SET([AS_TR_SH([ac_cv_tex_][$2])], [no])])]) | ||
38 | |||
39 | AS_VAR_IF([AS_TR_SH([ac_cv_tex_][$2])], [xyes], | ||
40 | [m4_if([$3], ,:,[$3])], | ||
41 | [m4_if([$4], ,:,[$4])])]) | ||
42 | ])dnl | ||
diff --git a/m4/check-libheader.m4 b/m4/check-libheader.m4 index 1e24d8a97..4e0285336 100644 --- a/m4/check-libheader.m4 +++ b/m4/check-libheader.m4 | |||
@@ -11,30 +11,19 @@ dnl HEADER-NAME - header file name as in AC_CHECK_HEADER | |||
11 | dnl ACTION-IF-FOUND - when feature is found then execute given action | 11 | dnl ACTION-IF-FOUND - when feature is found then execute given action |
12 | dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action | 12 | dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action |
13 | dnl EXTRA-LDFLAGS - extra linker flags (-L or -l) | 13 | dnl EXTRA-LDFLAGS - extra linker flags (-L or -l) |
14 | dnl EXTRA-CPPFLAGS - extra C preprocessor flags, i.e. -I/usr/X11R6/include | 14 | dnl EXTRA-CPPFLAGS - extra C preprocessor flags, e.g. -I/usr/X11R6/include |
15 | dnl | 15 | dnl |
16 | dnl Based on GST_CHECK_LIBHEADER from gstreamer plugins 0.3.1. | ||
17 | dnl | 16 | dnl |
18 | AC_DEFUN([CHECK_LIBHEADER], | 17 | AC_DEFUN([CHECK_LIBHEADER], |
19 | [ | 18 | [m4_if([$7], ,:,[LDFLAGS="$7 $LDFLAGS"]) |
20 | AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no, [$7]) | 19 | m4_if([$8], ,:,[CPPFLAGS="$8 $CPPFLAGS"]) |
21 | check_libheader_feature_name=translit([$1], A-Z, a-z) | ||
22 | |||
23 | if test "x$HAVE_[$1]" = "xyes"; then | ||
24 | check_libheader_save_CPPFLAGS=$CPPFLAGS | ||
25 | CPPFLAGS="[$8] $CPPFLAGS" | ||
26 | AC_CHECK_HEADER([$4], :, HAVE_[$1]=no) | ||
27 | CPPFLAGS=$check_libheader_save_CPPFLAGS | ||
28 | fi | ||
29 | |||
30 | if test "x$HAVE_[$1]" = "xyes"; then | ||
31 | ifelse([$5], , :, [$5]) | ||
32 | AC_MSG_NOTICE($check_libheader_feature_name was found) | ||
33 | else | ||
34 | ifelse([$6], , :, [$6]) | ||
35 | AC_MSG_WARN($check_libheader_feature_name not found) | ||
36 | fi | ||
37 | AC_SUBST(HAVE_[$1]) | ||
38 | ] | ||
39 | ) | ||
40 | 20 | ||
21 | AC_CHECK_HEADERS([$4], | ||
22 | [AC_CHECK_LIB([$2], [$3], | ||
23 | [eval "HAVE_]AS_TR_SH([$1])[=yes"] | ||
24 | m4_if([$5], ,:,[$5]), | ||
25 | [eval "HAVE_]AS_TR_SH([$1])[=no"] | ||
26 | m4_if([$6], ,:,[$6]))], | ||
27 | [eval "HAVE_]AS_TR_SH([$1])[=no"] | ||
28 | m4_if([$6], ,:,[$6])) | ||
29 | ])dnl | ||
diff --git a/m4/iconv.m4 b/m4/iconv.m4 index 41aa44a56..e593b7270 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 | |||
@@ -1,5 +1,6 @@ | |||
1 | # iconv.m4 serial 18 (gettext-0.18.2) | 1 | # iconv.m4 serial 21 |
2 | dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation, |
3 | dnl Inc. | ||
3 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
@@ -29,7 +30,7 @@ AC_DEFUN([AM_ICONV_LINK], | |||
29 | 30 | ||
30 | dnl Add $INCICONV to CPPFLAGS before performing the following checks, | 31 | dnl Add $INCICONV to CPPFLAGS before performing the following checks, |
31 | dnl because if the user has installed libiconv and not disabled its use | 32 | dnl because if the user has installed libiconv and not disabled its use |
32 | dnl via --without-libiconv-prefix, they want to use it. The first | 33 | dnl via --without-libiconv-prefix, he wants to use it. The first |
33 | dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. | 34 | dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. |
34 | am_save_CPPFLAGS="$CPPFLAGS" | 35 | am_save_CPPFLAGS="$CPPFLAGS" |
35 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) | 36 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) |
@@ -72,27 +73,33 @@ AC_DEFUN([AM_ICONV_LINK], | |||
72 | if test $am_cv_lib_iconv = yes; then | 73 | if test $am_cv_lib_iconv = yes; then |
73 | LIBS="$LIBS $LIBICONV" | 74 | LIBS="$LIBS $LIBICONV" |
74 | fi | 75 | fi |
75 | AC_RUN_IFELSE( | 76 | am_cv_func_iconv_works=no |
76 | [AC_LANG_SOURCE([[ | 77 | for ac_iconv_const in '' 'const'; do |
78 | AC_RUN_IFELSE( | ||
79 | [AC_LANG_PROGRAM( | ||
80 | [[ | ||
77 | #include <iconv.h> | 81 | #include <iconv.h> |
78 | #include <string.h> | 82 | #include <string.h> |
79 | int main () | 83 | |
80 | { | 84 | #ifndef ICONV_CONST |
81 | int result = 0; | 85 | # define ICONV_CONST $ac_iconv_const |
86 | #endif | ||
87 | ]], | ||
88 | [[int result = 0; | ||
82 | /* Test against AIX 5.1 bug: Failures are not distinguishable from successful | 89 | /* Test against AIX 5.1 bug: Failures are not distinguishable from successful |
83 | returns. */ | 90 | returns. */ |
84 | { | 91 | { |
85 | iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); | 92 | iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); |
86 | if (cd_utf8_to_88591 != (iconv_t)(-1)) | 93 | if (cd_utf8_to_88591 != (iconv_t)(-1)) |
87 | { | 94 | { |
88 | static const char input[] = "\342\202\254"; /* EURO SIGN */ | 95 | static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ |
89 | char buf[10]; | 96 | char buf[10]; |
90 | const char *inptr = input; | 97 | ICONV_CONST char *inptr = input; |
91 | size_t inbytesleft = strlen (input); | 98 | size_t inbytesleft = strlen (input); |
92 | char *outptr = buf; | 99 | char *outptr = buf; |
93 | size_t outbytesleft = sizeof (buf); | 100 | size_t outbytesleft = sizeof (buf); |
94 | size_t res = iconv (cd_utf8_to_88591, | 101 | size_t res = iconv (cd_utf8_to_88591, |
95 | (char **) &inptr, &inbytesleft, | 102 | &inptr, &inbytesleft, |
96 | &outptr, &outbytesleft); | 103 | &outptr, &outbytesleft); |
97 | if (res == 0) | 104 | if (res == 0) |
98 | result |= 1; | 105 | result |= 1; |
@@ -105,14 +112,14 @@ int main () | |||
105 | iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); | 112 | iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); |
106 | if (cd_ascii_to_88591 != (iconv_t)(-1)) | 113 | if (cd_ascii_to_88591 != (iconv_t)(-1)) |
107 | { | 114 | { |
108 | static const char input[] = "\263"; | 115 | static ICONV_CONST char input[] = "\263"; |
109 | char buf[10]; | 116 | char buf[10]; |
110 | const char *inptr = input; | 117 | ICONV_CONST char *inptr = input; |
111 | size_t inbytesleft = strlen (input); | 118 | size_t inbytesleft = strlen (input); |
112 | char *outptr = buf; | 119 | char *outptr = buf; |
113 | size_t outbytesleft = sizeof (buf); | 120 | size_t outbytesleft = sizeof (buf); |
114 | size_t res = iconv (cd_ascii_to_88591, | 121 | size_t res = iconv (cd_ascii_to_88591, |
115 | (char **) &inptr, &inbytesleft, | 122 | &inptr, &inbytesleft, |
116 | &outptr, &outbytesleft); | 123 | &outptr, &outbytesleft); |
117 | if (res == 0) | 124 | if (res == 0) |
118 | result |= 2; | 125 | result |= 2; |
@@ -124,14 +131,14 @@ int main () | |||
124 | iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); | 131 | iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); |
125 | if (cd_88591_to_utf8 != (iconv_t)(-1)) | 132 | if (cd_88591_to_utf8 != (iconv_t)(-1)) |
126 | { | 133 | { |
127 | static const char input[] = "\304"; | 134 | static ICONV_CONST char input[] = "\304"; |
128 | static char buf[2] = { (char)0xDE, (char)0xAD }; | 135 | static char buf[2] = { (char)0xDE, (char)0xAD }; |
129 | const char *inptr = input; | 136 | ICONV_CONST char *inptr = input; |
130 | size_t inbytesleft = 1; | 137 | size_t inbytesleft = 1; |
131 | char *outptr = buf; | 138 | char *outptr = buf; |
132 | size_t outbytesleft = 1; | 139 | size_t outbytesleft = 1; |
133 | size_t res = iconv (cd_88591_to_utf8, | 140 | size_t res = iconv (cd_88591_to_utf8, |
134 | (char **) &inptr, &inbytesleft, | 141 | &inptr, &inbytesleft, |
135 | &outptr, &outbytesleft); | 142 | &outptr, &outbytesleft); |
136 | if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) | 143 | if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) |
137 | result |= 4; | 144 | result |= 4; |
@@ -144,14 +151,14 @@ int main () | |||
144 | iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); | 151 | iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); |
145 | if (cd_88591_to_utf8 != (iconv_t)(-1)) | 152 | if (cd_88591_to_utf8 != (iconv_t)(-1)) |
146 | { | 153 | { |
147 | static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; | 154 | static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; |
148 | char buf[50]; | 155 | char buf[50]; |
149 | const char *inptr = input; | 156 | ICONV_CONST char *inptr = input; |
150 | size_t inbytesleft = strlen (input); | 157 | size_t inbytesleft = strlen (input); |
151 | char *outptr = buf; | 158 | char *outptr = buf; |
152 | size_t outbytesleft = sizeof (buf); | 159 | size_t outbytesleft = sizeof (buf); |
153 | size_t res = iconv (cd_88591_to_utf8, | 160 | size_t res = iconv (cd_88591_to_utf8, |
154 | (char **) &inptr, &inbytesleft, | 161 | &inptr, &inbytesleft, |
155 | &outptr, &outbytesleft); | 162 | &outptr, &outbytesleft); |
156 | if ((int)res > 0) | 163 | if ((int)res > 0) |
157 | result |= 8; | 164 | result |= 8; |
@@ -161,27 +168,36 @@ int main () | |||
161 | #endif | 168 | #endif |
162 | /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is | 169 | /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is |
163 | provided. */ | 170 | provided. */ |
164 | if (/* Try standardized names. */ | 171 | { |
165 | iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) | 172 | /* Try standardized names. */ |
166 | /* Try IRIX, OSF/1 names. */ | 173 | iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); |
167 | && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) | 174 | /* Try IRIX, OSF/1 names. */ |
168 | /* Try AIX names. */ | 175 | iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); |
169 | && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) | 176 | /* Try AIX names. */ |
170 | /* Try HP-UX names. */ | 177 | iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); |
171 | && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) | 178 | /* Try HP-UX names. */ |
172 | result |= 16; | 179 | iconv_t cd4 = iconv_open ("utf8", "eucJP"); |
180 | if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) | ||
181 | && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) | ||
182 | result |= 16; | ||
183 | if (cd1 != (iconv_t)(-1)) | ||
184 | iconv_close (cd1); | ||
185 | if (cd2 != (iconv_t)(-1)) | ||
186 | iconv_close (cd2); | ||
187 | if (cd3 != (iconv_t)(-1)) | ||
188 | iconv_close (cd3); | ||
189 | if (cd4 != (iconv_t)(-1)) | ||
190 | iconv_close (cd4); | ||
191 | } | ||
173 | return result; | 192 | return result; |
174 | }]])], | 193 | ]])], |
175 | [am_cv_func_iconv_works=yes], | 194 | [am_cv_func_iconv_works=yes], , |
176 | [am_cv_func_iconv_works=no], | 195 | [case "$host_os" in |
177 | [ | 196 | aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; |
178 | changequote(,)dnl | 197 | *) am_cv_func_iconv_works="guessing yes" ;; |
179 | case "$host_os" in | 198 | esac]) |
180 | aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; | 199 | test "$am_cv_func_iconv_works" = no || break |
181 | *) am_cv_func_iconv_works="guessing yes" ;; | 200 | done |
182 | esac | ||
183 | changequote([,])dnl | ||
184 | ]) | ||
185 | LIBS="$am_save_LIBS" | 201 | LIBS="$am_save_LIBS" |
186 | ]) | 202 | ]) |
187 | case "$am_cv_func_iconv_works" in | 203 | case "$am_cv_func_iconv_works" in |
@@ -255,14 +271,18 @@ size_t iconv(); | |||
255 | am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` | 271 | am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` |
256 | AC_MSG_RESULT([ | 272 | AC_MSG_RESULT([ |
257 | $am_cv_proto_iconv]) | 273 | $am_cv_proto_iconv]) |
258 | AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], | 274 | else |
259 | [Define as const if the declaration of iconv() needs const.]) | 275 | dnl When compiling GNU libiconv on a system that does not have iconv yet, |
260 | dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>. | 276 | dnl pick the POSIX compliant declaration without 'const'. |
261 | m4_ifdef([gl_ICONV_H_DEFAULTS], | 277 | am_cv_proto_iconv_arg1="" |
262 | [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) | ||
263 | if test -n "$am_cv_proto_iconv_arg1"; then | ||
264 | ICONV_CONST="const" | ||
265 | fi | ||
266 | ]) | ||
267 | fi | 278 | fi |
279 | AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], | ||
280 | [Define as const if the declaration of iconv() needs const.]) | ||
281 | dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>. | ||
282 | m4_ifdef([gl_ICONV_H_DEFAULTS], | ||
283 | [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) | ||
284 | if test -n "$am_cv_proto_iconv_arg1"; then | ||
285 | ICONV_CONST="const" | ||
286 | fi | ||
287 | ]) | ||
268 | ]) | 288 | ]) |
diff --git a/m4/libcurl.m4 b/m4/libcurl.m4 index 047260bae..ad53a444e 100644 --- a/m4/libcurl.m4 +++ b/m4/libcurl.m4 | |||
@@ -1,3 +1,24 @@ | |||
1 | #*************************************************************************** | ||
2 | # _ _ ____ _ | ||
3 | # Project ___| | | | _ \| | | ||
4 | # / __| | | | |_) | | | ||
5 | # | (__| |_| | _ <| |___ | ||
6 | # \___|\___/|_| \_\_____| | ||
7 | # | ||
8 | # Copyright (C) 2006 - 2020, David Shaw <dshaw@jabberwocky.com> | ||
9 | # | ||
10 | # This software is licensed as described in the file COPYING, which | ||
11 | # you should have received as part of this distribution. The terms | ||
12 | # are also available at https://curl.se/docs/copyright.html. | ||
13 | # | ||
14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell | ||
15 | # copies of the Software, and permit persons to whom the Software is | ||
16 | # furnished to do so, under the terms of the COPYING file. | ||
17 | # | ||
18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | # KIND, either express or implied. | ||
20 | # | ||
21 | ########################################################################### | ||
1 | # LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], | 22 | # LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], |
2 | # [ACTION-IF-YES], [ACTION-IF-NO]) | 23 | # [ACTION-IF-YES], [ACTION-IF-NO]) |
3 | # ---------------------------------------------------------- | 24 | # ---------------------------------------------------------- |
@@ -157,7 +178,7 @@ x=CURLOPT_WRITEDATA; | |||
157 | x=CURLOPT_ERRORBUFFER; | 178 | x=CURLOPT_ERRORBUFFER; |
158 | x=CURLOPT_STDERR; | 179 | x=CURLOPT_STDERR; |
159 | x=CURLOPT_VERBOSE; | 180 | x=CURLOPT_VERBOSE; |
160 | if (x) ; | 181 | if (x) {;} |
161 | ]])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no) | 182 | ]])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no) |
162 | 183 | ||
163 | CPPFLAGS=$_libcurl_save_cppflags | 184 | CPPFLAGS=$_libcurl_save_cppflags |
diff --git a/m4/libgcrypt.m4 b/m4/libgcrypt.m4 index 9a29eb5ba..19d514fd5 100644 --- a/m4/libgcrypt.m4 +++ b/m4/libgcrypt.m4 | |||
@@ -1,38 +1,70 @@ | |||
1 | dnl Autoconf macros for libgcrypt | 1 | # libgcrypt.m4 - Autoconf macros to detect libgcrypt |
2 | dnl Copyright (C) 2002, 2004, 2011 Free Software Foundation, Inc. | 2 | # Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020 g10 Code GmbH |
3 | dnl | 3 | # |
4 | dnl This file is free software; as a special exception the author gives | 4 | # This file is free software; as a special exception the author gives |
5 | dnl unlimited permission to copy and/or distribute it, with or without | 5 | # unlimited permission to copy and/or distribute it, with or without |
6 | dnl modifications, as long as this notice is preserved. | 6 | # modifications, as long as this notice is preserved. |
7 | dnl | 7 | # |
8 | dnl This file is distributed in the hope that it will be useful, but | 8 | # This file is distributed in the hope that it will be useful, but |
9 | dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the | 9 | # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
10 | dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 10 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11 | # | ||
12 | # Last-changed: 2020-09-27 | ||
11 | 13 | ||
12 | 14 | ||
13 | dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, | 15 | dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, |
14 | dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) | 16 | dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) |
15 | dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS. | 17 | dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS. |
16 | dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed | 18 | dnl MINIMUM-VERSION is a string with the version number optionally prefixed |
17 | dnl with the API version to also check the API compatibility. Example: | 19 | dnl with the API version to also check the API compatibility. Example: |
18 | dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed | 20 | dnl a MINIMUM-VERSION of 1:1.2.5 won't pass the test unless the installed |
19 | dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using | 21 | dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using |
20 | dnl this features allows to prevent build against newer versions of libgcrypt | 22 | dnl this features allows to prevent build against newer versions of libgcrypt |
21 | dnl with a changed API. | 23 | dnl with a changed API. |
22 | dnl | 24 | dnl |
25 | dnl If a prefix option is not used, the config script is first | ||
26 | dnl searched in $SYSROOT/bin and then along $PATH. If the used | ||
27 | dnl config script does not match the host specification the script | ||
28 | dnl is added to the gpg_config_script_warn variable. | ||
29 | dnl | ||
23 | AC_DEFUN([AM_PATH_LIBGCRYPT], | 30 | AC_DEFUN([AM_PATH_LIBGCRYPT], |
24 | [ AC_REQUIRE([AC_CANONICAL_HOST]) | 31 | [ AC_REQUIRE([AC_CANONICAL_HOST]) |
25 | AC_ARG_WITH(libgcrypt-prefix, | 32 | AC_ARG_WITH(libgcrypt-prefix, |
26 | AS_HELP_STRING([--with-libgcrypt-prefix=PFX], | 33 | AS_HELP_STRING([--with-libgcrypt-prefix=PFX], |
27 | [prefix where LIBGCRYPT is installed (optional)]), | 34 | [prefix where LIBGCRYPT is installed (optional)]), |
28 | libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") | 35 | libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") |
29 | if test x$libgcrypt_config_prefix != x ; then | 36 | if test x"${LIBGCRYPT_CONFIG}" = x ; then |
30 | if test x${LIBGCRYPT_CONFIG+set} != xset ; then | 37 | if test x"${libgcrypt_config_prefix}" != x ; then |
31 | LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config | 38 | LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config" |
32 | fi | 39 | fi |
33 | fi | 40 | fi |
34 | 41 | ||
35 | AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) | 42 | use_gpgrt_config="" |
43 | if test x"${LIBGCRYPT_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then | ||
44 | if $GPGRT_CONFIG libgcrypt --exists; then | ||
45 | LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt" | ||
46 | AC_MSG_NOTICE([Use gpgrt-config as libgcrypt-config]) | ||
47 | use_gpgrt_config=yes | ||
48 | fi | ||
49 | fi | ||
50 | if test -z "$use_gpgrt_config"; then | ||
51 | if test x"${LIBGCRYPT_CONFIG}" = x ; then | ||
52 | case "${SYSROOT}" in | ||
53 | /*) | ||
54 | if test -x "${SYSROOT}/bin/libgcrypt-config" ; then | ||
55 | LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config" | ||
56 | fi | ||
57 | ;; | ||
58 | '') | ||
59 | ;; | ||
60 | *) | ||
61 | AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.]) | ||
62 | ;; | ||
63 | esac | ||
64 | fi | ||
65 | AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) | ||
66 | fi | ||
67 | |||
36 | tmp=ifelse([$1], ,1:1.2.0,$1) | 68 | tmp=ifelse([$1], ,1:1.2.0,$1) |
37 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then | 69 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then |
38 | req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` | 70 | req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` |
@@ -51,7 +83,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], | |||
51 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` | 83 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
52 | req_micro=`echo $min_libgcrypt_version | \ | 84 | req_micro=`echo $min_libgcrypt_version | \ |
53 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` | 85 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
54 | libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` | 86 | if test -z "$use_gpgrt_config"; then |
87 | libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` | ||
88 | else | ||
89 | libgcrypt_config_version=`$LIBGCRYPT_CONFIG --modversion` | ||
90 | fi | ||
55 | major=`echo $libgcrypt_config_version | \ | 91 | major=`echo $libgcrypt_config_version | \ |
56 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` | 92 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` |
57 | minor=`echo $libgcrypt_config_version | \ | 93 | minor=`echo $libgcrypt_config_version | \ |
@@ -83,7 +119,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], | |||
83 | # If we have a recent libgcrypt, we should also check that the | 119 | # If we have a recent libgcrypt, we should also check that the |
84 | # API is compatible | 120 | # API is compatible |
85 | if test "$req_libgcrypt_api" -gt 0 ; then | 121 | if test "$req_libgcrypt_api" -gt 0 ; then |
86 | tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` | 122 | if test -z "$use_gpgrt_config"; then |
123 | tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` | ||
124 | else | ||
125 | tmp=`$LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0` | ||
126 | fi | ||
87 | if test "$tmp" -gt 0 ; then | 127 | if test "$tmp" -gt 0 ; then |
88 | AC_MSG_CHECKING([LIBGCRYPT API version]) | 128 | AC_MSG_CHECKING([LIBGCRYPT API version]) |
89 | if test "$req_libgcrypt_api" -eq "$tmp" ; then | 129 | if test "$req_libgcrypt_api" -eq "$tmp" ; then |
@@ -99,17 +139,22 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], | |||
99 | LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` | 139 | LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` |
100 | LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` | 140 | LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` |
101 | ifelse([$2], , :, [$2]) | 141 | ifelse([$2], , :, [$2]) |
102 | libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` | 142 | if test -z "$use_gpgrt_config"; then |
143 | libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` | ||
144 | else | ||
145 | libgcrypt_config_host=`$LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none` | ||
146 | fi | ||
103 | if test x"$libgcrypt_config_host" != xnone ; then | 147 | if test x"$libgcrypt_config_host" != xnone ; then |
104 | if test x"$libgcrypt_config_host" != x"$host" ; then | 148 | if test x"$libgcrypt_config_host" != x"$host" ; then |
105 | AC_MSG_WARN([[ | 149 | AC_MSG_WARN([[ |
106 | *** | 150 | *** |
107 | *** The config script $LIBGCRYPT_CONFIG was | 151 | *** The config script "$LIBGCRYPT_CONFIG" was |
108 | *** built for $libgcrypt_config_host and thus may not match the | 152 | *** built for $libgcrypt_config_host and thus may not match the |
109 | *** used host $host. | 153 | *** used host $host. |
110 | *** You may want to use the configure option --with-libgcrypt-prefix | 154 | *** You may want to use the configure option --with-libgcrypt-prefix |
111 | *** to specify a matching config script. | 155 | *** to specify a matching config script or use \$SYSROOT. |
112 | ***]]) | 156 | ***]]) |
157 | gpg_config_script_warn="$gpg_config_script_warn libgcrypt" | ||
113 | fi | 158 | fi |
114 | fi | 159 | fi |
115 | else | 160 | else |
diff --git a/m4/libgnurl.m4 b/m4/libgnurl.m4 index 412709373..d030c5dd8 100644 --- a/m4/libgnurl.m4 +++ b/m4/libgnurl.m4 | |||
@@ -1,3 +1,4 @@ | |||
1 | ########################################################################### | ||
1 | # LIBGNURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], | 2 | # LIBGNURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], |
2 | # [ACTION-IF-YES], [ACTION-IF-NO]) | 3 | # [ACTION-IF-YES], [ACTION-IF-NO]) |
3 | # ---------------------------------------------------------- | 4 | # ---------------------------------------------------------- |
@@ -146,34 +147,36 @@ AC_DEFUN([LIBGNURL_CHECK_CONFIG], | |||
146 | _libgnurl_save_libs=$LIBS | 147 | _libgnurl_save_libs=$LIBS |
147 | LIBS="$LIBGNURL $LIBS" | 148 | LIBS="$LIBGNURL $LIBS" |
148 | 149 | ||
149 | AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <curl/curl.h>],[ | 150 | 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 | /* Try and use a few common options to force a failure if we are |
151 | missing symbols or can't link. */ | 152 | missing symbols or can't link. */ |
152 | int x; | 153 | int x; |
153 | curl_easy_setopt(NULL,CURLOPT_URL,NULL); | 154 | curl_easy_setopt(NULL,CURLOPT_URL,NULL); |
154 | x=CURL_ERROR_SIZE; | 155 | x=CURL_ERROR_SIZE; |
155 | x=CURLOPT_WRITEFUNCTION; | 156 | x=CURLOPT_WRITEFUNCTION; |
156 | x=CURLOPT_FILE; | 157 | x=CURLOPT_WRITEDATA; |
157 | x=CURLOPT_ERRORBUFFER; | 158 | x=CURLOPT_ERRORBUFFER; |
158 | x=CURLOPT_STDERR; | 159 | x=CURLOPT_STDERR; |
159 | x=CURLOPT_VERBOSE; | 160 | x=CURLOPT_VERBOSE; |
160 | ])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no) | 161 | if (x) {;} |
162 | ]])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no) | ||
161 | 163 | ||
162 | # BEGIN Changes from original libcurl.m4: | 164 | # BEGIN Changes from original libcurl.m4: |
163 | # Give it a 2nd shot using 'gnurl/curl.h' | 165 | # Give it a second shot using 'gnurl/curl.h' |
164 | AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <gnurl/curl.h>],[ | 166 | 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 | 167 | /* Try and use a few common options to force a failure if we are |
166 | missing symbols or can't link. */ | 168 | missing symbols or can't link. */ |
167 | int x; | 169 | int x; |
168 | curl_easy_setopt(NULL,CURLOPT_URL,NULL); | 170 | curl_easy_setopt(NULL,CURLOPT_URL,NULL); |
169 | x=CURL_ERROR_SIZE; | 171 | x=CURL_ERROR_SIZE; |
170 | x=CURLOPT_WRITEFUNCTION; | 172 | x=CURLOPT_WRITEFUNCTION; |
171 | x=CURLOPT_FILE; | 173 | x=CURLOPT_WRITEDATA; |
172 | x=CURLOPT_ERRORBUFFER; | 174 | x=CURLOPT_ERRORBUFFER; |
173 | x=CURLOPT_STDERR; | 175 | x=CURLOPT_STDERR; |
174 | x=CURLOPT_VERBOSE; | 176 | x=CURLOPT_VERBOSE; |
175 | ])],libgnurl_cv_lib_gnurl_usable=yes) | 177 | if (x) {;} |
176 | # END Changes from original libcurl.m4: | 178 | ]])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no) |
179 | # END Changes from original libcurl.m4 | ||
177 | 180 | ||
178 | CPPFLAGS=$_libgnurl_save_cppflags | 181 | CPPFLAGS=$_libgnurl_save_cppflags |
179 | LIBS=$_libgnurl_save_libs | 182 | LIBS=$_libgnurl_save_libs |
@@ -183,7 +186,7 @@ x=CURLOPT_VERBOSE; | |||
183 | 186 | ||
184 | if test $libgnurl_cv_lib_gnurl_usable = yes ; then | 187 | if test $libgnurl_cv_lib_gnurl_usable = yes ; then |
185 | 188 | ||
186 | # Does gnurl_free() exist in this version of libgnurl? | 189 | # Does curl_free() exist in this version of libgnurl? |
187 | # If not, fake it with free() | 190 | # If not, fake it with free() |
188 | 191 | ||
189 | _libgnurl_save_cppflags=$CPPFLAGS | 192 | _libgnurl_save_cppflags=$CPPFLAGS |
diff --git a/m4/libunistring.m4 b/m4/libunistring.m4 index c1bf4d553..e3d944793 100644 --- a/m4/libunistring.m4 +++ b/m4/libunistring.m4 | |||
@@ -1,9 +1,11 @@ | |||
1 | # libunistring.m4 serial 11 | 1 | # libunistring.m4 serial 12 |
2 | dnl Copyright (C) 2009-2012 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
6 | 6 | ||
7 | AC_PREREQ([2.64]) | ||
8 | |||
7 | dnl gl_LIBUNISTRING | 9 | dnl gl_LIBUNISTRING |
8 | dnl Searches for an installed libunistring. | 10 | dnl Searches for an installed libunistring. |
9 | dnl If found, it sets and AC_SUBSTs HAVE_LIBUNISTRING=yes and the LIBUNISTRING | 11 | dnl If found, it sets and AC_SUBSTs HAVE_LIBUNISTRING=yes and the LIBUNISTRING |
@@ -12,8 +14,8 @@ dnl augments the CPPFLAGS variable, and #defines HAVE_LIBUNISTRING to 1. | |||
12 | dnl Otherwise, it sets and AC_SUBSTs HAVE_LIBUNISTRING=no and LIBUNISTRING and | 14 | dnl Otherwise, it sets and AC_SUBSTs HAVE_LIBUNISTRING=no and LIBUNISTRING and |
13 | dnl LTLIBUNISTRING to empty. | 15 | dnl LTLIBUNISTRING to empty. |
14 | 16 | ||
15 | dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE for Autoconf >= 2.64, in order | 17 | dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE, in order dnl to avoid warnings |
16 | dnl to avoid warnings like | 18 | dnl like |
17 | dnl "warning: AC_REQUIRE: `gl_LIBUNISTRING' was expanded before it was required". | 19 | dnl "warning: AC_REQUIRE: `gl_LIBUNISTRING' was expanded before it was required". |
18 | dnl This is tricky because of the way 'aclocal' is implemented: | 20 | dnl This is tricky because of the way 'aclocal' is implemented: |
19 | dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. | 21 | dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. |
@@ -21,16 +23,7 @@ dnl Otherwise aclocal's initial scan pass would miss the macro definition. | |||
21 | dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. | 23 | dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. |
22 | dnl Otherwise aclocal would emit many "Use of uninitialized value $1" | 24 | dnl Otherwise aclocal would emit many "Use of uninitialized value $1" |
23 | dnl warnings. | 25 | dnl warnings. |
24 | m4_define([gl_libunistring_AC_DEFUN], | 26 | AC_DEFUN_ONCE([gl_LIBUNISTRING], |
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])]])])) | ||
33 | gl_libunistring_AC_DEFUN([gl_LIBUNISTRING], | ||
34 | [ | 27 | [ |
35 | AC_BEFORE([$0], [gl_LIBUNISTRING_MODULE]) | 28 | AC_BEFORE([$0], [gl_LIBUNISTRING_MODULE]) |
36 | AC_BEFORE([$0], [gl_LIBUNISTRING_LIBHEADER]) | 29 | AC_BEFORE([$0], [gl_LIBUNISTRING_LIBHEADER]) |