{"thread":{"id":"39504","subject":"[PATCH v2 2/2] configure: add getdelim() check","startedAt":"2015-06-02T21:15:42Z","lastAt":"2015-06-03T04:35:32Z","messageCount":4,"participants":["Eric Sunshine","Jeff King"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"262781","messageId":"1433279744-23379-1-git-send-email-sunshine@sunshineco.com","threadId":"39504","inReplyTo":null,"subject":"[PATCH v2 0/2] auto-detect getdelim()","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-06-02T21:15:42Z","receivedAt":"2015-06-02T21:15:42Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"This series updates config.mak.uname to define HAVE_GETDELIM on Mac OS X\nwhen appropriate, and adds a configure check for the same.\n\nChanges since v1[1]:\n\npatch 1/2 -- optimize OS X version recognition:\n\n* Use `...` for 'expr' invocation to extract digits from $(uname_R),\n  thus only a fork(), rather than gmake $(shell...), which spawns via\n  fork()+exec().\n\n* Use 'test' relational operator -ge rather than 'expr >=', along with\n  'echo' to compare version number. Since 'test' and 'echo' are\n  typically shell builtins, this should be faster than invoking 'expr' a\n  second time.\n\npatch 2/2 -- unchanged\n\n[1]: http://thread.gmane.org/gmane.comp.version-control.git/270576\n\nEric Sunshine (2):\n  config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X\n    releases\n  configure: add getdelim() check\n\n config.mak.uname | 3 +++\n configure.ac     | 6 ++++++\n 2 files changed, 9 insertions(+)\n\n-- \n2.4.2.598.gb4379f4\n"},{"id":"262780","messageId":"1433279744-23379-2-git-send-email-sunshine@sunshineco.com","threadId":"39504","inReplyTo":"1433279744-23379-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 1/2] config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-06-02T21:15:43Z","receivedAt":"2015-06-02T21:15:43Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mac OS X, getdelim() first became available with Xcode 4.1[1], which\nwas released the same day as OS X 10.7 \"Lion\", so assume getdelim()\navailability from 10.7 onward. (As of this writing, OS X is at 10.10\n\"Yosemite\".)\n\nAccording to Wikipedia[2], 4.1 was also available for download by paying\ndevelopers on OS X 10.6 \"Snow Leopard\", so it's possible that some 10.6\nmachines may have getdelim(). However, as strbuf's use of getdelim() is\npurely an optimization, let's be conservative and assume 10.6 and\nearlier lack getdelim().\n\n[1]: Or, possibly with Xcode 4.0, but that version is no longer\n     available for download, or not available to non-paying developers,\n     so testing is not possible.\n\n[2]: http://en.wikipedia.org/wiki/Xcode\n\nHelped-by: Jeff King <peff@peff.net>\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n config.mak.uname | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/config.mak.uname b/config.mak.uname\nindex d26665f..943c439 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -102,6 +102,9 @@ ifeq ($(uname_S),Darwin)\n \tifeq ($(shell expr \"$(uname_R)\" : '[15]\\.'),2)\n \t\tNO_STRLCPY = YesPlease\n \tendif\n+\tifeq ($(shell test \"`expr \"$(uname_R)\" : '\\([0-9][0-9]*\\)\\.'`\" -ge 11 && echo 1),1)\n+\t\tHAVE_GETDELIM = YesPlease\n+\tendif\n \tNO_MEMMEM = YesPlease\n \tUSE_ST_TIMESPEC = YesPlease\n \tHAVE_DEV_TTY = YesPlease\n-- \n2.4.2.598.gb4379f4\n"},{"id":"262779","messageId":"1433279744-23379-3-git-send-email-sunshine@sunshineco.com","threadId":"39504","inReplyTo":"1433279744-23379-1-git-send-email-sunshine@sunshineco.com","subject":"[PATCH v2 2/2] configure: add getdelim() check","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-06-02T21:15:44Z","receivedAt":"2015-06-02T21:15:44Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"As an optimization, strbuf will take advantage of getdelim() if\navailable, so add a configure check which defines HAVE_GETDELIM if\nfound.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n configure.ac | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/configure.ac b/configure.ac\nindex bbdde85..14012fa 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -1041,6 +1041,12 @@ GIT_CHECK_FUNC(initgroups,\n [NO_INITGROUPS=YesPlease])\n GIT_CONF_SUBST([NO_INITGROUPS])\n #\n+# Define HAVE_GETDELIM if you have getdelim in the C library.\n+GIT_CHECK_FUNC(getdelim,\n+[HAVE_GETDELIM=YesPlease],\n+[HAVE_GETDELIM=])\n+GIT_CONF_SUBST([HAVE_GETDELIM])\n+#\n #\n # Define NO_MMAP if you want to avoid mmap.\n #\n-- \n2.4.2.598.gb4379f4\n"},{"id":"262806","messageId":"20150603043532.GB15989@peff.net","threadId":"39504","inReplyTo":"1433279744-23379-1-git-send-email-sunshine@sunshineco.com","subject":"Re: [PATCH v2 0/2] auto-detect getdelim()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-06-03T04:35:32Z","receivedAt":"2015-06-03T04:35:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 02, 2015 at 05:15:42PM -0400, Eric Sunshine wrote:\n\n> This series updates config.mak.uname to define HAVE_GETDELIM on Mac OS X\n> when appropriate, and adds a configure check for the same.\n> \n> Changes since v1[1]:\n> \n> patch 1/2 -- optimize OS X version recognition:\n> \n> * Use `...` for 'expr' invocation to extract digits from $(uname_R),\n>   thus only a fork(), rather than gmake $(shell...), which spawns via\n>   fork()+exec().\n> \n> * Use 'test' relational operator -ge rather than 'expr >=', along with\n>   'echo' to compare version number. Since 'test' and 'echo' are\n>   typically shell builtins, this should be faster than invoking 'expr' a\n>   second time.\n> \n> patch 2/2 -- unchanged\n\nThanks, this version looks good to me.\n\n-Peff\n"}]}