autoconf: Add test for OLD_ICONV (squelching compiler warning)
Update configure.ac (and config.mak.in) to keep up with git development by adding [compile] test whether your library has an old iconv(), where the second (input buffer pointer) parameter is declared with type (const char **) (OLD_ICONV). Test-proposed-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jakub Narebski committed
Dec 7, 2007 at 02:27 UTC
0f7a9c9b7bb1f443f8fd0f18cb66933b2f4ec410
2 files changed
+23
config.mak.in
+1
@@ -41,4 +41,5 @@ NO_STRTOUMAX=@NO_STRTOUMAX@
41
NO_SETENV=@NO_SETENV@
42
NO_MKDTEMP=@NO_MKDTEMP@
43
NO_ICONV=@NO_ICONV@
44
+OLD_ICONV=@OLD_ICONV@
45
NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
configure.ac
+22
@@ -212,6 +212,28 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
212
213
214
## Checks for header files.
215
+AC_MSG_NOTICE([CHECKS for header files])
216
+#
217
+# Define OLD_ICONV if your library has an old iconv(), where the second
218
+# (input buffer pointer) parameter is declared with type (const char **).
219
+AC_DEFUN([OLDICONVTEST_SRC], [[
220
+#include <iconv.h>
221
+
222
+extern size_t iconv(iconv_t cd,
223
+ char **inbuf, size_t *inbytesleft,
224
+ char **outbuf, size_t *outbytesleft);
225
+
226
+int main(void)
227
+{
228
+ return 0;
229
+}
230
+]])
231
+AC_MSG_CHECKING([for old iconv()])
232
+AC_COMPILE_IFELSE(OLDICONVTEST_SRC,
233
+ [AC_MSG_RESULT([no])],
234
+ [AC_MSG_RESULT([yes])
235
+ OLD_ICONV=UnfortunatelyYes])
236
+AC_SUBST(OLD_ICONV)
237
238
239
## Checks for typedefs, structures, and compiler characteristics.