From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Ramsay Jones <ramsay@ramsay1.demon.co.uk>,
Arjen Laarhoven <arjen@yaph.org>,
Brian Gernhardt <benji@silverinsanity.com>,
Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH/RFC] autoconf: Add test for OLD_ICONV
Date: Wed, 5 Dec 2007 16:45:26 +0100 [thread overview]
Message-ID: <1196869526-2197-1-git-send-email-jnareb@gmail.com> (raw)
In-Reply-To: <7vd4u5l29v.fsf@gitster.siamese.dyndns.org>
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).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch needs checking if it correctly sets OLD_ICONV
when needed. I have checked only that it is not set when
with new iconv() declaration. Could people using Cygwin
(and other with OLD_ICONV: Darwin) test it?
I should probably used AC_LANG_PROGRAM like for NO_C99_FORMAT instead
of generating whole programlet^W test program by hand (I hope that for
example I haven't missed some header file which needs to be included);
I have followed example for NO_ICONV / NEEDS_LIBICONV and
NO_DEFLATE_BOUND test. I'm also not sure if I have put this test in
the correct autoconf section, but that is probably matter of taste.
P.S. Is there any convention on where to use YesPlease, and where
UnfortunatelyYes when setting Makefile build configuration variables?
config.mak.in | 1 +
configure.ac | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/config.mak.in b/config.mak.in
index 11d256e..7d5df9b 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -41,4 +41,5 @@ NO_STRTOUMAX=@NO_STRTOUMAX@
NO_SETENV=@NO_SETENV@
NO_MKDTEMP=@NO_MKDTEMP@
NO_ICONV=@NO_ICONV@
+OLD_ICONV=@OLD_ICONV@
NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
diff --git a/configure.ac b/configure.ac
index 5f8a15b..5d2936e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -212,6 +212,27 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
## Checks for header files.
+AC_MSG_NOTICE([CHECKS for header files])
+#
+# Define OLD_ICONV if your library has an old iconv(), where the second
+# (input buffer pointer) parameter is declared with type (const char **).
+AC_DEFUN([OLDICONVTEST_SRC], [[
+#include <iconv.h>
+
+int main(void)
+{
+ iconv_t cd;
+ char *ibp, *obp;
+ size_t insz, outsz;
+ iconv(cd, &ibp, &insz, &obp, &outsz);
+}
+]])
+AC_MSG_CHECKING([for old iconv()])
+AC_COMPILE_IFELSE(OLDICONVTEST_SRC,
+ [AC_MSG_RESULT([no])],
+ [AC_MSG_RESULT([yes])
+ OLD_ICONV=YesPlease])
+AC_SUBST(OLD_ICONV)
## Checks for typedefs, structures, and compiler characteristics.
--
1.5.3.6
next prev parent reply other threads:[~2007-12-05 15:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 18:47 [PATCH] autoconf: Add tests for memmem, strtoumax and mkdtemp functions Jakub Narebski
[not found] ` <7vd4u5l29v.fsf@gitster.siamese.dyndns.org>
2007-11-20 18:12 ` Stefan-W. Hahn
2007-11-21 0:08 ` Matt Kraai
2007-12-05 15:45 ` Jakub Narebski [this message]
2007-12-05 16:11 ` [PATCH/RFC] autoconf: Add test for OLD_ICONV Brian Gernhardt
2007-12-05 16:33 ` Jakub Narebski
2007-12-05 16:31 ` Wincent Colaiuta
2007-12-05 16:52 ` Jakub Narebski
2007-12-05 20:49 ` Wincent Colaiuta
2007-12-05 21:19 ` Jakub Narebski
2007-12-05 21:38 ` Brian Gernhardt
2007-12-06 19:07 ` Wincent Colaiuta
2007-12-05 19:38 ` Junio C Hamano
2007-12-05 21:26 ` Jakub Narebski
2007-12-05 22:22 ` Junio C Hamano
2007-12-05 23:05 ` [PATCH/RFC (amend)] autoconf: Add test for OLD_ICONV (squelching compiler warning) Jakub Narebski
2007-12-05 23:27 ` Junio C Hamano
2007-12-05 21:46 ` [PATCH/RFC] autoconf: Add test for OLD_ICONV Pascal Obry
2007-11-21 6:58 ` [PATCH] autoconf: Add tests for memmem, strtoumax and mkdtemp functions Shawn O. Pearce
2007-11-21 18:47 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1196869526-2197-1-git-send-email-jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=arjen@yaph.org \
--cc=benji@silverinsanity.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).