{"thread":{"id":"44892","subject":"[PATCH 2/2] configure.ac: Fix --without-iconv","startedAt":"2017-01-16T20:02:17Z","lastAt":"2017-01-16T21:41:18Z","messageCount":3,"participants":["Bernd Kuhls","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"309488","messageId":"20170116195638.3713-2-bernd.kuhls@writeme.com","threadId":"44892","inReplyTo":"20170116195638.3713-1-bernd.kuhls@writeme.com","subject":"[PATCH 2/2] configure.ac: Fix --without-iconv","fromName":"Bernd Kuhls","fromEmail":"bernd.kuhls@writeme.com","sentAt":"2017-01-16T19:56:38Z","receivedAt":"2017-01-16T20:02:17Z","isPatch":true,"sender":{"key":"bernd.kuhls@writeme.com","avatar":null},"body":"GIT_PARSE_WITH(iconv)) sets NO_ICONV=YesPlease in\nhttps://github.com/git/git/blob/maint/configure.ac#L327\n\nBut the command GIT_CONF_SUBST([NO_ICONV]) in\nhttps://github.com/git/git/blob/maint/configure.ac#L618\n\nis only executed when NO_ICONV is an empty variable\nhttps://github.com/git/git/blob/maint/configure.ac#L578\n\nwhich has the effect that NO_ICONV=YesPlease is not written to\nconfig.mak.autogen which breaks compilation in systems without iconv.\n\nSigned-off-by: Bernd Kuhls <bernd.kuhls@writeme.com>\n---\n configure.ac | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex 63e71a472..419469315 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -614,15 +614,15 @@ LIBS=\"$old_LIBS\"\n \n GIT_UNSTASH_FLAGS($ICONVDIR)\n \n-GIT_CONF_SUBST([NEEDS_LIBICONV])\n-GIT_CONF_SUBST([NO_ICONV])\n-\n if test -n \"$NO_ICONV\"; then\n     NEEDS_LIBICONV=\n fi\n \n fi\n \n+GIT_CONF_SUBST([NEEDS_LIBICONV])\n+GIT_CONF_SUBST([NO_ICONV])\n+\n #\n # Define NO_DEFLATE_BOUND if deflateBound is missing from zlib.\n \n-- \n2.11.0\n\n"},{"id":"309489","messageId":"20170116195638.3713-1-bernd.kuhls@writeme.com","threadId":"44892","inReplyTo":null,"subject":"[PATCH 1/2] configure.ac: fix old iconv check","fromName":"Bernd Kuhls","fromEmail":"bernd.kuhls@writeme.com","sentAt":"2017-01-16T19:56:37Z","receivedAt":"2017-01-16T20:02:20Z","isPatch":true,"sender":{"key":"bernd.kuhls@writeme.com","avatar":null},"body":"According to\nhttps://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Running-the-Compiler.html\nthe parameter syntax of AC_COMPILE_IFELSE is\n\n(input, [action-if-true], [action-if-false])\n\nDisplaying \"no\" when the test was positive and enabling support for old\niconv implementations by OLD_ICONV=UnfortunatelyYes when the test fails\nit obviously wrong. This patch switches the actions to fix the problem.\n\nSigned-off-by: Bernd Kuhls <bernd.kuhls@writeme.com>\n---\n configure.ac | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex 0b15f04b1..63e71a472 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -759,9 +759,9 @@ GIT_STASH_FLAGS($ICONVDIR)\n \n AC_MSG_CHECKING([for old iconv()])\n AC_COMPILE_IFELSE([OLDICONVTEST_SRC],\n-\t[AC_MSG_RESULT([no])],\n \t[AC_MSG_RESULT([yes])\n-\tOLD_ICONV=UnfortunatelyYes])\n+\tOLD_ICONV=UnfortunatelyYes],\n+\t[AC_MSG_RESULT([no])])\n \n GIT_UNSTASH_FLAGS($ICONVDIR)\n \n-- \n2.11.0\n\n"},{"id":"309498","messageId":"20170116214111.v2imkedzyofcpt6b@sigill.intra.peff.net","threadId":"44892","inReplyTo":"20170116195638.3713-1-bernd.kuhls@writeme.com","subject":"Re: [PATCH 1/2] configure.ac: fix old iconv check","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-01-16T21:41:11Z","receivedAt":"2017-01-16T21:41:18Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jan 16, 2017 at 08:56:37PM +0100, Bernd Kuhls wrote:\n\n> According to\n> https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Running-the-Compiler.html\n> the parameter syntax of AC_COMPILE_IFELSE is\n> \n> (input, [action-if-true], [action-if-false])\n> \n> Displaying \"no\" when the test was positive and enabling support for old\n> iconv implementations by OLD_ICONV=UnfortunatelyYes when the test fails\n> it obviously wrong. This patch switches the actions to fix the problem.\n\nHrm. But the test code is:\n\n  # Define OLD_ICONV if your library has an old iconv(), where the second\n  # (input buffer pointer) parameter is declared with type (const char **).\n  AC_DEFUN([OLDICONVTEST_SRC], [\n  AC_LANG_PROGRAM([[\n  #include <iconv.h>\n  \n  extern size_t iconv(iconv_t cd,\n                      char **inbuf, size_t *inbytesleft,\n                      char **outbuf, size_t *outbytesleft);\n  ]], [])])\n\nWhich will compile correctly for the _new_ code, but not the old. So\nwhen the test is positive, then \"no\", we do not need to set the\nOLD_ICONV flag.\n\nThe logic would probably be clearer if the test were reversed. It would\nmean that other compilation problems (e.g., you do not have iconv.h at\nall) would fail to see OLD_ICONV, but that seems reasonable.\n\n-Peff\n"}]}