{"thread":{"id":"10933","subject":"[PATCH] autoconf: Add tests for memmem, strtoumax and mkdtemp functions","startedAt":"2007-11-19T18:47:05Z","lastAt":"2007-12-06T19:07:11Z","messageCount":20,"participants":["Jakub Narebski","Stefan-W. Hahn","Matt Kraai","Shawn O. Pearce","Brian Gernhardt","Wincent Colaiuta","Junio C Hamano","Pascal Obry"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"60350","messageId":"200711191947.05960.jnareb@gmail.com","threadId":"10933","inReplyTo":null,"subject":"[PATCH] autoconf: Add tests for memmem, strtoumax and mkdtemp functions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-19T18:47:05Z","receivedAt":"2007-11-19T18:47:05Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Update configure.ac (and config.mak.in) to keep up with git\ndevelopment by adding tests for memmem (NO_MEMMEM), strtoumax\n(NO_STRTOUMAX) and mkdtemp (NO_MKDTEMP) functions.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis is beginning of \"bring configure up to date\" thingy.\n\nBy the way, do you have idea how to test for the following\nin configure.ac:\n\n* Define NO_PREAD if you have a problem with pread() system call (e.g.\n  cygwin.dll before v1.5.22).\n\n  - what is the problem? how to detect it?\n\n* Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is\n  generally faster on your platform than accessing the working directory.\n\n  - if at all possible\n\n* Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support\n  the executable mode bit, but doesn't really do so.\n\n  - I think there were some code here\n\n* Define NO_R_TO_GCC_LINKER if your gcc does not like \"-R/path/lib\"\n  that tells runtime paths to dynamic libraries;\n  \"-Wl,-rpath=/path/lib\" is used instead.\n\n* Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's\n  MakeMaker (e.g. using ActiveState under Cygwin).\n\n* Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8\n* Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.\n\n  - it needs some portable way to check asciidoc and docbook-xsl version\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\n  - perhaps compile with new iconv and check for compile errors?\n\n\n config.mak.in |    3 +++\n configure.ac  |   18 ++++++++++++++++++\n 2 files changed, 21 insertions(+), 0 deletions(-)\n\ndiff --git a/config.mak.in b/config.mak.in\nindex 776b805..11d256e 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -35,7 +35,10 @@ NO_SOCKADDR_STORAGE=@NO_SOCKADDR_STORAGE@\n NO_IPV6=@NO_IPV6@\n NO_C99_FORMAT=@NO_C99_FORMAT@\n NO_STRCASESTR=@NO_STRCASESTR@\n+NO_MEMMEM=@NO_MEMMEM@\n NO_STRLCPY=@NO_STRLCPY@\n+NO_STRTOUMAX=@NO_STRTOUMAX@\n NO_SETENV=@NO_SETENV@\n+NO_MKDTEMP=@NO_MKDTEMP@\n NO_ICONV=@NO_ICONV@\n NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\ndiff --git a/configure.ac b/configure.ac\nindex 53e9a17..7bcf1a4 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -289,18 +289,36 @@ AC_CHECK_FUNC(strcasestr,\n [NO_STRCASESTR=YesPlease])\n AC_SUBST(NO_STRCASESTR)\n #\n+# Define NO_MEMMEM if you don't have memmem.\n+AC_CHECK_FUNC(memmem,\n+[NO_MEMMEM=],\n+[NO_MEMMEM=YesPlease])\n+AC_SUBST(NO_MEMMEM)\n+#\n # Define NO_STRLCPY if you don't have strlcpy.\n AC_CHECK_FUNC(strlcpy,\n [NO_STRLCPY=],\n [NO_STRLCPY=YesPlease])\n AC_SUBST(NO_STRLCPY)\n #\n+# Define NO_STRTOUMAX if you don't have strtoumax in the C library.\n+AC_CHECK_FUNC(strtoumax,\n+[NO_STRTOUMAX=],\n+[NO_STRTOUMAX=YesPlease])\n+AC_SUBST(NO_STRTOUMAX)\n+#\n # Define NO_SETENV if you don't have setenv in the C library.\n AC_CHECK_FUNC(setenv,\n [NO_SETENV=],\n [NO_SETENV=YesPlease])\n AC_SUBST(NO_SETENV)\n #\n+# Define NO_MKDTEMP if you don't have mkdtemp in the C library.\n+AC_CHECK_FUNC(mkdtemp,\n+[NO_MKDTEMP=],\n+[NO_MKDTEMP=YesPlease])\n+AC_SUBST(NO_MKDTEMP)\n+#\n # Define NO_MMAP if you want to avoid mmap.\n #\n # Define NO_ICONV if your libc does not properly support iconv.\n-- \n1.5.3.5\n"},{"id":"60418","messageId":"20071120181202.GA12389@scotty.home","threadId":"10933","inReplyTo":"7vd4u5l29v.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] autoconf: Add tests for memmem, strtoumax and mkdtemp functions","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2007-11-20T18:12:02Z","receivedAt":"2007-11-20T18:12:02Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"Also sprach Junio C Hamano am Tue, 20 Nov 2007 at 01:00:44 -0800:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n> > By the way, do you have idea how to test for the following\n> > in configure.ac:\n> >\n> > * Define NO_PREAD if you have a problem with pread() system call (e.g.\n> >   cygwin.dll before v1.5.22).\n> >\n> >   - what is the problem? how to detect it?\n> \n> 6900679c2f6d937a5a6ef616869c8887690ad19d (Replacing the system\n> call pread() with lseek()/xread()/lseek() sequence.)\n> \n\nFor me it happened when using git (e.g. git commit). Detecting perhaps\nis possible with \"cygcheck\" command which shows the version of cygwin\nsystem dlls.\n\nPerhaps: cygcheck -p 'cygwin1.dll'\nShows name and version of found cygwin1.dll.\n\nStefan\n\n-- \nStefan-W. Hahn                          It is easy to make things.\n/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.\t\t\t\n"},{"id":"60453","messageId":"20071121000824.GA25959@ftbfs.org","threadId":"10933","inReplyTo":"7vd4u5l29v.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] autoconf: Add tests for memmem, strtoumax and mkdtemp functions","fromName":"Matt Kraai","fromEmail":"kraai@ftbfs.org","sentAt":"2007-11-21T00:08:24Z","receivedAt":"2007-11-21T00:08:24Z","isPatch":true,"sender":{"key":"kraai@ftbfs.org","avatar":null},"body":"On Tue, Nov 20, 2007 at 01:00:44AM -0800, Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> > * Define NO_R_TO_GCC_LINKER if your gcc does not like \"-R/path/lib\"\n> >   that tells runtime paths to dynamic libraries;\n> >   \"-Wl,-rpath=/path/lib\" is used instead.\n> \n> Try with -R/path/lib and see if it complains, perhaps?\n> \n> 206488774238c94ff337dd5c997be441dbde5112 (Correct the name of\n> NO_R_TO_GCC_LINKER in the comment describing it.)\n\nI don't know how to test this, unfortunately.  I'll be happy to test\nany tests you'd like me to try, though.\n\n> >   MakeMaker (e.g. using ActiveState under Cygwin).\n> \n> f848718a6980ebda0eb5afb2ca49c3bc1e7b2b1d (Make perl/ build\n> procedure ActiveState friendly.)\n> \n> Alex CC'ed.\n> \n> > * Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8\n> \n>         case \"$(asciidoc --version)\" in\n>         asciidoc' '7*)\t: not def ;;\n>         asciidoc' '8)\t: def ;;\n>         esac\n> \n> > * Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.\n> >\n> >   - it needs some portable way to check asciidoc and docbook-xsl version\n> \n> Hmmm.\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> >\n> >   - perhaps compile with new iconv and check for compile errors?\n> \n> Yeah, with appropriate includes,\n> \n>         char *ibp, *obp;\n>         size_t insz, outsz;\n>         iconv(conv, &ibp, &insz, &obp, &outsz);\n> \n> would cause compilation trouble if iconv() wants \"const char *\"\n> for ibp.\n\n-- \nMatt\n"},{"id":"60467","messageId":"20071121065858.GU14735@spearce.org","threadId":"10933","inReplyTo":"200711191947.05960.jnareb@gmail.com","subject":"Re: [PATCH] autoconf: Add tests for memmem, strtoumax and mkdtemp functions","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-11-21T06:58:58Z","receivedAt":"2007-11-21T06:58:58Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> wrote:\n> By the way, do you have idea how to test for the following\n> in configure.ac:\n> \n> * Define NO_PREAD if you have a problem with pread() system call (e.g.\n>   cygwin.dll before v1.5.22).\n> \n>   - what is the problem? how to detect it?\n\nThis also appears to be broken on HP-UX (e.g. we need to set\nNO_PREAD there).  Thiago on IRC talked about this the other day\nwhen he was trying to build git on a bunch of different systems.\n\nUnfortunately this may just need to be an OS based test.  The code\ncompiles just fine but when index-pack tries to use pread to walk\nback through the deltas and generate their SHA-1s it barfs without\nan error code.  I suspect the failure is pread claiming it put the\ndata into the user buffer but not actually doing so, which causes\nzlib's inflate() to then see data corruption.\n\nOuch.\n\n-- \nShawn.\n"},{"id":"60553","messageId":"200711211947.50661.jnareb@gmail.com","threadId":"10933","inReplyTo":"20071121065858.GU14735@spearce.org","subject":"Re: [PATCH] autoconf: Add tests for memmem, strtoumax and mkdtemp functions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-21T18:47:50Z","receivedAt":"2007-11-21T18:47:50Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Shawn O. Pearce wrote:\n> Jakub Narebski <jnareb@gmail.com> wrote:\n>> By the way, do you have idea how to test for the following\n>> in configure.ac:\n>> \n>> * Define NO_PREAD if you have a problem with pread() system call (e.g.\n>>   cygwin.dll before v1.5.22).\n>> \n>>   - what is the problem? how to detect it?\n> \n> This also appears to be broken on HP-UX (e.g. we need to set\n> NO_PREAD there).  Thiago on IRC talked about this the other day\n> when he was trying to build git on a bunch of different systems.\n> \n> Unfortunately this may just need to be an OS based test.  The code\n> compiles just fine but when index-pack tries to use pread to walk\n> back through the deltas and generate their SHA-1s it barfs without\n> an error code.  I suspect the failure is pread claiming it put the\n> data into the user buffer but not actually doing so, which causes\n> zlib's inflate() to then see data corruption.\n\nCan you write a short program which demonstrates this error (either\nfails with some error code, or produces wrong output)? That would be\nenough for configure.ac (see for example NO_C99_FORMAT in configure.ac)\n\nUnless this is Schroedinger bug...\n\n-- \nJakub Narebski\nPoland\n"},{"id":"62023","messageId":"1196869526-2197-1-git-send-email-jnareb@gmail.com","threadId":"10933","inReplyTo":"7vd4u5l29v.fsf@gitster.siamese.dyndns.org","subject":"[PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-05T15:45:26Z","receivedAt":"2007-12-05T15:45:26Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Update configure.ac (and config.mak.in) to keep up with git\ndevelopment by adding [compile] test whether your library has\nan old iconv(), where the second (input buffer pointer) parameter\nis declared with type (const char **) (OLD_ICONV).\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis patch needs checking if it correctly sets OLD_ICONV\nwhen needed.  I have checked only that it is not set when\nwith new iconv() declaration.  Could people using Cygwin\n(and other with OLD_ICONV: Darwin) test it?\n\nI should probably used AC_LANG_PROGRAM like for NO_C99_FORMAT instead\nof generating whole programlet^W test program by hand (I hope that for\nexample I haven't missed some header file which needs to be included);\nI have followed example for NO_ICONV / NEEDS_LIBICONV and\nNO_DEFLATE_BOUND test.  I'm also not sure if I have put this test in\nthe correct autoconf section, but that is probably matter of taste.\n\nP.S. Is there any convention on where to use YesPlease, and where\nUnfortunatelyYes when setting Makefile build configuration variables?\n\n config.mak.in |    1 +\n configure.ac  |   21 +++++++++++++++++++++\n 2 files changed, 22 insertions(+), 0 deletions(-)\n\ndiff --git a/config.mak.in b/config.mak.in\nindex 11d256e..7d5df9b 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -41,4 +41,5 @@ NO_STRTOUMAX=@NO_STRTOUMAX@\n NO_SETENV=@NO_SETENV@\n NO_MKDTEMP=@NO_MKDTEMP@\n NO_ICONV=@NO_ICONV@\n+OLD_ICONV=@OLD_ICONV@\n NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\ndiff --git a/configure.ac b/configure.ac\nindex 5f8a15b..5d2936e 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -212,6 +212,27 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -lsocket\"\n \n \n ## Checks for header files.\n+AC_MSG_NOTICE([CHECKS for header files])\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+#include <iconv.h>\n+\n+int main(void)\n+{\n+\ticonv_t cd;\n+\tchar *ibp, *obp;\n+\tsize_t insz, outsz;\n+\ticonv(cd, &ibp, &insz, &obp, &outsz);\n+}\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=YesPlease])\n+AC_SUBST(OLD_ICONV)\n \n \n ## Checks for typedefs, structures, and compiler characteristics.\n-- \n1.5.3.6\n"},{"id":"62024","messageId":"82D48BF0-E01D-4CE4-92F3-44B555531624@silverinsanity.com","threadId":"10933","inReplyTo":"1196869526-2197-1-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-12-05T16:11:32Z","receivedAt":"2007-12-05T16:11:32Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Dec 5, 2007, at 10:45 AM, Jakub Narebski wrote:\n\n> Update configure.ac (and config.mak.in) to keep up with git\n> development by adding [compile] test whether your library has\n> an old iconv(), where the second (input buffer pointer) parameter\n> is declared with type (const char **) (OLD_ICONV).\n>\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n> This patch needs checking if it correctly sets OLD_ICONV\n> when needed.  I have checked only that it is not set when\n> with new iconv() declaration.  Could people using Cygwin\n> (and other with OLD_ICONV: Darwin) test it?\n\nI could not get git am to apply the patch cleanly, but will try again  \nlater when I have more time.  That said, 10.5's default /usr/include/ \niconv.h uses the newer non-const definition of iconv_open.  I've had  \nto add a \"OLD_ICONV=\" line to my config.mak to avoid the warning.   \nI'll still test to look for a false positive.\n\n> P.S. Is there any convention on where to use YesPlease, and where\n> UnfortunatelyYes when setting Makefile build configuration variables?\n\nAFAICT, YesPlease is the \"normal\" choice and UnfortunatelyYes is used  \nwhen the person who added it considered it an obnoxious hack or a  \nstupid failing in a system.  The test in the Makefile is just if the  \nvariable is defined, so you technically could use  \n\"IDontLikeSillyVariableValuesInMyMakefiles\", and it would work just  \nfine.  ;-)\n\n~~ Brian\n"},{"id":"62026","messageId":"ADB12552-AD67-4781-B194-AD15CA4A7B44@wincent.com","threadId":"10933","inReplyTo":"1196869526-2197-1-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-12-05T16:31:23Z","receivedAt":"2007-12-05T16:31:23Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 5/12/2007, a las 16:45, Jakub Narebski escribió:\n\n> Update configure.ac (and config.mak.in) to keep up with git\n> development by adding [compile] test whether your library has\n> an old iconv(), where the second (input buffer pointer) parameter\n> is declared with type (const char **) (OLD_ICONV).\n>\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n> This patch needs checking if it correctly sets OLD_ICONV\n> when needed.  I have checked only that it is not set when\n> with new iconv() declaration.  Could people using Cygwin\n> (and other with OLD_ICONV: Darwin) test it?\n\nBefore applying your patch:\n\n     CC utf8.o\nutf8.c: In function ‘reencode_string’:\nutf8.c:328: warning: passing argument 2 of ‘iconv’ from incompatible  \npointer type\n     CC convert.o\n\nAfter applying your patch:\n\n     CC utf8.o\n     CC convert.o\n\nThis on Darwin Kernel Version 9.1.0 (Mac OS X 10.5.1).\n\nCheers,\nWincent\n"},{"id":"62027","messageId":"200712051733.11590.jnareb@gmail.com","threadId":"10933","inReplyTo":"82D48BF0-E01D-4CE4-92F3-44B555531624@silverinsanity.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-05T16:33:08Z","receivedAt":"2007-12-05T16:33:08Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 5 Dec 2007, Brian Gernhardt wrote:\n> On Dec 5, 2007, at 10:45 AM, Jakub Narebski wrote:\n> \n> > This patch needs checking if it correctly sets OLD_ICONV\n> > when needed.  I have checked only that it is not set when\n> > with new iconv() declaration.  Could people using Cygwin\n> > (and other with OLD_ICONV: Darwin) test it?\n> \n> I could not get git am to apply the patch cleanly, but will try again  \n> later when I have more time.\n\nHmmm... it should apply cleanly to both 'master' (7a4a2e1f797)\nand 'next' (bd1cfb7fbddc). It just adds some contents...\n\n-- \nJakub Narebski\nPoland\n"},{"id":"62028","messageId":"200712051752.28667.jnareb@gmail.com","threadId":"10933","inReplyTo":"ADB12552-AD67-4781-B194-AD15CA4A7B44@wincent.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-05T16:52:28Z","receivedAt":"2007-12-05T16:52:28Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 5 December 2007, Wincent Colaiuta wrote:\n> El 5/12/2007, a las 16:45, Jakub Narebski escribió:\n> \n> > Update configure.ac (and config.mak.in) to keep up with git\n> > development by adding [compile] test whether your library has\n> > an old iconv(), where the second (input buffer pointer) parameter\n> > is declared with type (const char **) (OLD_ICONV).\n> >\n> > Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> > ---\n> > This patch needs checking if it correctly sets OLD_ICONV\n> > when needed.  I have checked only that it is not set when\n> > with new iconv() declaration.  Could people using Cygwin\n> > (and other with OLD_ICONV: Darwin) test it?\n> \n> Before applying your patch:\n> \n>      CC utf8.o\n> utf8.c: In function ‘reencode_string’:\n> utf8.c:328: warning: passing argument 2 of ‘iconv’ from incompatible  \n> pointer type\n>      CC convert.o\n> \n> After applying your patch:\n> \n>      CC utf8.o\n>      CC convert.o\n\nDo I understand correctly that above is excerpt from the output of the \nfollowing sequence of commands before and after this patch applied?\n\n  $ make configure\n  $ ./configure [options]\n  $ make\n\nDo you have something like below in ./configure output?\n\n  configure: CHECKS for header files\n  checking for old iconv()... yes\n\n> This on Darwin Kernel Version 9.1.0 (Mac OS X 10.5.1).\n\nStrange... in Makefile there is\n\n  ifeq ($(uname_S),Darwin)\n\tNEEDS_SSL_WITH_CRYPTO = YesPlease\n\tNEEDS_LIBICONV = YesPlease\n\tOLD_ICONV = UnfortunatelyYes\n\tNO_STRLCPY = YesPlease\n\tNO_MEMMEM = YesPlease\n  endif\n\nso the uname based guessing should set OLD_ICONV on Darwin...\n-- \nJakub Narebski\nPoland\n"},{"id":"62047","messageId":"7vtzmxortn.fsf@gitster.siamese.dyndns.org","threadId":"10933","inReplyTo":"1196869526-2197-1-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-05T19:38:12Z","receivedAt":"2007-12-05T19:38:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> diff --git a/configure.ac b/configure.ac\n> index 5f8a15b..5d2936e 100644\n> --- a/configure.ac\n> +++ b/configure.ac\n> @@ -212,6 +212,27 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -lsocket\"\n>  \n>  \n>  ## Checks for header files.\n> +AC_MSG_NOTICE([CHECKS for header files])\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> +#include <iconv.h>\n> +\n> +int main(void)\n> +{\n> +\ticonv_t cd;\n> +\tchar *ibp, *obp;\n> +\tsize_t insz, outsz;\n> +\ticonv(cd, &ibp, &insz, &obp, &outsz);\n> +}\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=YesPlease])\n> +AC_SUBST(OLD_ICONV)\n>  \n\nWhich result does COMPILE_IFELSE give for non error warnings?  Ok, or\nBad?\n"},{"id":"62052","messageId":"52A4CC8B-EB11-4E3F-A3B6-06826F860E5D@wincent.com","threadId":"10933","inReplyTo":"200712051752.28667.jnareb@gmail.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-12-05T20:49:35Z","receivedAt":"2007-12-05T20:49:35Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 5/12/2007, a las 17:52, Jakub Narebski escribió:\n\n> On Wed, 5 December 2007, Wincent Colaiuta wrote:\n>>\n>> Before applying your patch:\n>>\n>>     CC utf8.o\n>> utf8.c: In function ‘reencode_string’:\n>> utf8.c:328: warning: passing argument 2 of ‘iconv’ from incompatible\n>> pointer type\n>>     CC convert.o\n>>\n>> After applying your patch:\n>>\n>>     CC utf8.o\n>>     CC convert.o\n>\n> Do I understand correctly that above is excerpt from the output of the\n> following sequence of commands before and after this patch applied?\n>\n>  $ make configure\n>  $ ./configure [options]\n>  $ make\n\nYes, that's right, but with a \"make clean\" before anything else.\n\n> Do you have something like below in ./configure output?\n>\n>  configure: CHECKS for header files\n>  checking for old iconv()... yes\n\nThis:\n\nconfigure: CHECKS for header files\nchecking for old iconv()... no\n\n>> This on Darwin Kernel Version 9.1.0 (Mac OS X 10.5.1).\n>\n> Strange... in Makefile there is\n>\n>  ifeq ($(uname_S),Darwin)\n> \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n> \tNEEDS_LIBICONV = YesPlease\n> \tOLD_ICONV = UnfortunatelyYes\n> \tNO_STRLCPY = YesPlease\n> \tNO_MEMMEM = YesPlease\n>  endif\n>\n> so the uname based guessing should set OLD_ICONV on Darwin...\n\nThat happens *before* config.mak.autogen is included in the Makefile,  \nso it gets overridden.\n\nCheers,\nWincent\n"},{"id":"62056","messageId":"200712052219.00930.jnareb@gmail.com","threadId":"10933","inReplyTo":"52A4CC8B-EB11-4E3F-A3B6-06826F860E5D@wincent.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-05T21:19:00Z","receivedAt":"2007-12-05T21:19:00Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Wincent Colaiuta wrote:\n> El 5/12/2007, a las 17:52, Jakub Narebski escribió:\n>> On Wed, 5 December 2007, Wincent Colaiuta wrote:\n>>>\n>>> Before applying your patch:\n>>>\n>>>     CC utf8.o\n>>> utf8.c: In function ‘reencode_string’:\n>>> utf8.c:328: warning: passing argument 2 of ‘iconv’ from incompatible\n>>> pointer type\n>>>     CC convert.o\n>>>\n>>> After applying your patch:\n>>>\n>>>     CC utf8.o\n>>>     CC convert.o\n>>\n>> Do I understand correctly that above is excerpt from the output of the\n>> following sequence of commands before and after this patch applied?\n>>\n>>  $ make configure\n>>  $ ./configure [options]\n>>  $ make\n> \n> Yes, that's right, but with a \"make clean\" before anything else.\n> \n>> Do you have something like below in ./configure output?\n>>\n>>  configure: CHECKS for header files\n>>  checking for old iconv()... yes\n> \n> This:\n> \n> configure: CHECKS for header files\n> checking for old iconv()... no\n> \n>>> This on Darwin Kernel Version 9.1.0 (Mac OS X 10.5.1).\n>>\n>> Strange... in Makefile there is\n>>\n>>  ifeq ($(uname_S),Darwin)\n>> \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n>> \tNEEDS_LIBICONV = YesPlease\n>> \tOLD_ICONV = UnfortunatelyYes\n>> \tNO_STRLCPY = YesPlease\n>> \tNO_MEMMEM = YesPlease\n>>  endif\n>>\n>> so the uname based guessing should set OLD_ICONV on Darwin...\n> \n> That happens *before* config.mak.autogen is included in the Makefile,  \n> so it gets overridden.\n\nAhhh... now I understand. You have installed new iconv() on your\ncomputer, and generic 'uname -s' (OS name) based guessing in Makefile\nguesses wrongly that you need OLD_ICONV, while ./configure script\nactually tests it and correctly decides to unset OLD_ICONV !\n\n\nBTW. Perhaps it whould be written more explicitely:\n\n+AC_COMPILE_IFELSE(OLDICONVTEST_SRC,\n+       [AC_MSG_RESULT([no])\n+       OLD_ICONV=],\n+       [AC_MSG_RESULT([yes])\n+       OLD_ICONV=YesPlease])\n\n\n-- \nJakub Narebski\nPoland\n"},{"id":"62057","messageId":"200712052226.53543.jnareb@gmail.com","threadId":"10933","inReplyTo":"7vtzmxortn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-05T21:26:53Z","receivedAt":"2007-12-05T21:26:53Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\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=YesPlease])\n>> +AC_SUBST(OLD_ICONV)\n>>  \n> \n> Which result does COMPILE_IFELSE give for non error warnings?  Ok, or\n> Bad?\n\n - Macro: AC_COMPILE_IFELSE (INPUT, [ACTION-IF-FOUND],\n          [ACTION-IF-NOT-FOUND])\n     Run the compiler and compilation flags of the current language\n     (*note Language Choice::) on the INPUT, run the shell commands\n     ACTION-IF-TRUE on success, ACTION-IF-FALSE otherwise.  The INPUT\n     can be made by `AC_LANG_PROGRAM' and friends.\n\nAnd if I have checked correctly code which causes only warnings\nreturns Ok (in this case print 'no' after 'checking for old iconv()... '\nand do not set OLD_ICONV, which means it will be unset).\n-- \nJakub Narebski\nPoland\n"},{"id":"62059","messageId":"9B4498E3-295F-4D0B-896C-34E54A869B5E@silverinsanity.com","threadId":"10933","inReplyTo":"200712052219.00930.jnareb@gmail.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-12-05T21:38:10Z","receivedAt":"2007-12-05T21:38:10Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Dec 5, 2007, at 4:19 PM, Jakub Narebski wrote:\n\n> Ahhh... now I understand. You have installed new iconv() on your\n> computer, and generic 'uname -s' (OS name) based guessing in Makefile\n> guesses wrongly that you need OLD_ICONV, while ./configure script\n> actually tests it and correctly decides to unset OLD_ICONV !\n\nAs far as the \"installed new iconv()\" goes, you may be wrong there.   \nThe latest major release of OS X includes a version of iconv that does  \nnot need OLD_ICONV as part of the base system.  I've had to unset it  \nin my config.mak in order to avoid the warning.\n\n~~ Brian Gernhardt\n"},{"id":"62061","messageId":"47571C4B.5060907@obry.net","threadId":"10933","inReplyTo":"1196869526-2197-1-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2007-12-05T21:46:51Z","receivedAt":"2007-12-05T21:46:51Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Jakub Narebski a écrit :\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n> This patch needs checking if it correctly sets OLD_ICONV\n> when needed.  I have checked only that it is not set when\n> with new iconv() declaration.  Could people using Cygwin\n> (and other with OLD_ICONV: Darwin) test it?\n\nNot working on Cygwin:\n\n   $ autoconf\n   $ ./configure --prefix=/usr/local --build=i686-pc-cygwin\n   ...\n   configure: CHECKS for header files\n   checking for old iconv()... no\n\nIt should be yes above. And in config.mak.autogen we have:\n\n   OLD_ICONV=\n\nNote also that you should remove all the hard-coded settings in Makefile\nanyway.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"},{"id":"62067","messageId":"7vd4tkn5mk.fsf@gitster.siamese.dyndns.org","threadId":"10933","inReplyTo":"200712052226.53543.jnareb@gmail.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-05T22:22:59Z","receivedAt":"2007-12-05T22:22:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Junio C Hamano wrote:\n>> Jakub Narebski <jnareb@gmail.com> writes:\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=YesPlease])\n>>> +AC_SUBST(OLD_ICONV)\n>>>  \n>> \n>> Which result does COMPILE_IFELSE give for non error warnings?  Ok, or\n>> Bad?\n>\n>  - Macro: AC_COMPILE_IFELSE (INPUT, [ACTION-IF-FOUND],\n>           [ACTION-IF-NOT-FOUND])\n>      Run the compiler and compilation flags of the current language\n>      (*note Language Choice::) on the INPUT, run the shell commands\n>      ACTION-IF-TRUE on success, ACTION-IF-FALSE otherwise.  The INPUT\n>      can be made by `AC_LANG_PROGRAM' and friends.\n>\n> And if I have checked correctly code which causes only warnings\n> returns Ok (in this case print 'no' after 'checking for old iconv()... '\n> and do not set OLD_ICONV, which means it will be unset).\n\nWhich means the real-life compilation will get the warning on type\nmismatch.  Wasn't OLD_ICONV about squelching that?\n"},{"id":"62070","messageId":"1196895948-25115-1-git-send-email-jnareb@gmail.com","threadId":"10933","inReplyTo":"7vd4tkn5mk.fsf@gitster.siamese.dyndns.org","subject":"[PATCH/RFC (amend)] autoconf: Add test for OLD_ICONV (squelching compiler warning)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-05T23:05:48Z","receivedAt":"2007-12-05T23:05:48Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 5 Dec 2007, Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n>> Junio C Hamano wrote:\n>>> Jakub Narebski <jnareb@gmail.com> writes:\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=YesPlease])\n>>>> +AC_SUBST(OLD_ICONV)\n>>>>  \n>>> \n>>> Which result does COMPILE_IFELSE give for non error warnings?\n>>> Ok, or Bad?\n>>\n>>  - Macro: AC_COMPILE_IFELSE (INPUT, [ACTION-IF-FOUND],\n>>           [ACTION-IF-NOT-FOUND])\n>>      Run the compiler and compilation flags of the current language\n>>      (*note Language Choice::) on the INPUT, run the shell commands\n>>      ACTION-IF-TRUE on success, ACTION-IF-FALSE otherwise.  The INPUT\n>>      can be made by `AC_LANG_PROGRAM' and friends.\n>>\n>> And if I have checked correctly code which causes only warnings\n>> returns Ok (in this case print 'no' after 'checking for old iconv()... '\n>> and do not set OLD_ICONV, which means it will be unset).\n> \n> Which means the real-life compilation will get the warning on type\n> mismatch.  Wasn't OLD_ICONV about squelching that?\n\nGah, I don't know why I though OLD_ICONV was about compile errors, and\nnot about compile warnings. This version uses -Werror to check for\nwarnings; I hope it doesn't give false positives...\n\n\nOn Wed, 5 Dec 2007, Pascal Obry wrote:\n> Jakub Narebski a écrit :\n>> ---\n>> This patch needs checking if it correctly sets OLD_ICONV\n>> when needed.  I have checked only that it is not set when\n>> with new iconv() declaration.  Could people using Cygwin\n>> (and other with OLD_ICONV: Darwin) test it?\n> \n> Not working on Cygwin:\n> \n>    $ autoconf\n>    $ ./configure --prefix=/usr/local --build=i686-pc-cygwin\n>    ...\n>    configure: CHECKS for header files\n>    checking for old iconv()... no\n> \n> It should be yes above. And in config.mak.autogen we have:\n> \n>    OLD_ICONV=\n\nCheck out current version of patch. It should work correctly now\n(I thought OLD_ICONV was about compile errors, and it is about\nsquelching compile warnings). It should give now:\n\n  $ make configure\n  $ ./configure --prefix=/usr/local --build=i686-pc-cygwin\n\n  configure: CHECKS for header files\n  checking for old iconv()... yes\n \n  $ cat config.mak.autogen\n \n  OLD_ICONV=UnfortunatelyYes\n\n> Note also that you should remove all the hard-coded settings\n> in Makefile anyway.\n\nNo, I should not. ./configure script is purely optional in git,\nand compiling should work with reasonable defaults even if you\ndon't have autoconf installed and/or you don't want to run\n./configure script (because e.g. it is too slow).\n\n-- >8 --\nFrom: Jakub Narebski <jnareb@gmail.com>\nSubject: [PATCH] autoconf: Add test for OLD_ICONV (squelching compiler warning)\n\nUpdate configure.ac (and config.mak.in) to keep up with git\ndevelopment by adding [compile] test whether your library has an old\niconv(), where the second (input buffer pointer) parameter is declared\nwith type (const char **) (OLD_ICONV).\n\nTest-proposed-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n config.mak.in |    1 +\n configure.ac  |   24 ++++++++++++++++++++++++\n 2 files changed, 25 insertions(+), 0 deletions(-)\n\ndiff --git a/config.mak.in b/config.mak.in\nindex 11d256e..7d5df9b 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -41,4 +41,5 @@ NO_STRTOUMAX=@NO_STRTOUMAX@\n NO_SETENV=@NO_SETENV@\n NO_MKDTEMP=@NO_MKDTEMP@\n NO_ICONV=@NO_ICONV@\n+OLD_ICONV=@OLD_ICONV@\n NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\ndiff --git a/configure.ac b/configure.ac\nindex 5f8a15b..196ab3e 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -212,6 +212,30 @@ test -n \"$NEEDS_SOCKET\" && LIBS=\"$LIBS -lsocket\"\n \n \n ## Checks for header files.\n+AC_MSG_NOTICE([CHECKS for header files])\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+#include <iconv.h>\n+\n+int main(void)\n+{\n+\ticonv_t cd;\n+\tchar *ibp, *obp;\n+\tsize_t insz, outsz;\n+\ticonv(cd, &ibp, &insz, &obp, &outsz);\n+}\n+]])\n+AC_MSG_CHECKING([for old iconv()])\n+CFLAGS_ORIG=$CFLAGS\n+CFLAGS=\"$CFLAGS -Werror\"\n+AC_COMPILE_IFELSE(OLDICONVTEST_SRC,\n+\t[AC_MSG_RESULT([no])],\n+\t[AC_MSG_RESULT([yes])\n+\tOLD_ICONV=UnfortunatelyYes])\n+CFLAGS=$CFLAGS_ORIG\n+AC_SUBST(OLD_ICONV)\n \n \n ## Checks for typedefs, structures, and compiler characteristics.\n-- \n1.5.3.7\n"},{"id":"62072","messageId":"7vd4tklo2r.fsf@gitster.siamese.dyndns.org","threadId":"10933","inReplyTo":"1196895948-25115-1-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH/RFC (amend)] autoconf: Add test for OLD_ICONV (squelching compiler warning)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-05T23:27:24Z","receivedAt":"2007-12-05T23:27:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n>> Which means the real-life compilation will get the warning on type\n>> mismatch.  Wasn't OLD_ICONV about squelching that?\n>\n> Gah, I don't know why I though OLD_ICONV was about compile errors, and\n> not about compile warnings. This version uses -Werror to check for\n> warnings; I hope it doesn't give false positives...\n\nBut use of -Werror means you are married to gcc, doesn't it?\n\nHow important is it to detect OLD_ICONV anyway, I have to wonder?\n\n> On Wed, 5 Dec 2007, Pascal Obry wrote:\n> ...\n>> Note also that you should remove all the hard-coded settings\n>> in Makefile anyway.\n>\n> No, I should not. ./configure script is purely optional in git,\n\nCorrect.  Thanks.\n"},{"id":"62184","messageId":"BCD45527-C564-4CD3-9797-36F6251377E6@wincent.com","threadId":"10933","inReplyTo":"200712052219.00930.jnareb@gmail.com","subject":"Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-12-06T19:07:11Z","receivedAt":"2007-12-06T19:07:11Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 5/12/2007, a las 22:19, Jakub Narebski escribió:\n\n> Ahhh... now I understand. You have installed new iconv() on your\n> computer, and generic 'uname -s' (OS name) based guessing in Makefile\n> guesses wrongly that you need OLD_ICONV, while ./configure script\n> actually tests it and correctly decides to unset OLD_ICONV !\n\nNo, nothing installed. It's that Mac OS X 10.5 (Leopard)/Darwin 9  \ncomes with a newer version of iconv. So while there was no warning  \nprior to Leopard there is one now, which your patch fixes for those  \nusing configure.\n\nThis came up before here:\n\n<http://marc.info/?l=git&m=119397507006026&w=2>\n\nStill, I'd like to fix the warning for those who don't use configure.  \nHave posted a separate patch for that just now.\n\nCheers,\n>\n\nWincent\n"}]}