Re: [PATCH] config.mak.uname: resolve FreeBSD iconv-related compilation warning

2018-08-31 Thread Eric Sunshine
On Fri, Aug 31, 2018 at 1:00 PM Jonathan Nieder  wrote:
> > From: Jonathan Nieder 
> > OLD_ICONV has long been needed by FreeBSD so config.mak.uname defines
> > it unconditionally. However, recent versions do not need it, and its
> > presence results in compilation warnings. Resolve this issue by defining
> > OLD_ICONV only for older FreeBSD versions.
>
> I think it makes sense for you to take credit for this one.  You
> noticed the original problem, tested on FreeBSD, wrote the
> explanation, and figured out the firstword hackery.  All I did was to
> say "somebody should fix this" and run "git log -S" a few times. [...]

I'm fine going either way with authorship, and I can re-roll with that
minor change (if Junio isn't interested in tweaking it while
queueing).


Re: [PATCH] config.mak.uname: resolve FreeBSD iconv-related compilation warning

2018-08-31 Thread Eric Sunshine
On Fri, Aug 31, 2018 at 7:54 AM Ævar Arnfjörð Bjarmason
 wrote:
> On Fri, Aug 31, 2018 at 11:52 AM Eric Sunshine  
> wrote:
> > OLD_ICONV has long been needed by FreeBSD so config.mak.uname defines
> > it unconditionally. However, recent versions do not need it, and its
> > presence results in compilation warnings. Resolve this issue by defining
> > OLD_ICONV only for older FreeBSD versions.
>
> This seems sane, but just for context is FreeBSD ports itself just
> compiling without iconv entirely?
>
> I have little clue about how ports works, but just noticed that
> they're not monkeypatching in OLD_ICONV there.

My experience with FreeBSD ports is pretty limited too, but, as I
discovered in [1], they run Git's configure script, so OLD_ICONV is
determined dynamically, as far as I can tell.

[1]: 
https://public-inbox.org/git/CAPig+cTEGtsmUyoYsKEx+erMsXKm5=c6tjunageky2pcgw1...@mail.gmail.com/


Re: [PATCH] config.mak.uname: resolve FreeBSD iconv-related compilation warning

2018-08-31 Thread Jonathan Nieder
Eric Sunshine wrote:

> From: Jonathan Nieder 
>
> OLD_ICONV has long been needed by FreeBSD so config.mak.uname defines
> it unconditionally. However, recent versions do not need it, and its
> presence results in compilation warnings. Resolve this issue by defining
> OLD_ICONV only for older FreeBSD versions.
>
> Specifically, revision r281550[1], which is part of FreeBSD 11, removed
> the need for OLD_ICONV, and r282275[2] back-ported that change to 10.2.
> Versions prior to 10.2 do need it.
>
> [1] 
> https://github.com/freebsd/freebsd/commit/b0813ee288f64f677a2cebf7815754b027a8215b
> [2] 
> https://github.com/freebsd/freebsd/commit/b709ec868adb5170d09bc5a66b18d0e0d5987ab6
>
> [es: commit message; tweak version check to distinguish 10.x versions]
>
> Signed-off-by: Jonathan Nieder 
> Signed-off-by: Eric Sunshine 
> ---
>  config.mak.uname | 12 +++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

I think it makes sense for you to take credit for this one.  You
noticed the original problem, tested on FreeBSD, wrote the
explanation, and figured out the firstword hackery.  All I did was to
say "somebody should fix this" and run "git log -S" a few times.  In
any event,

Reviewed-by: Jonathan Nieder 


Re: [PATCH] config.mak.uname: resolve FreeBSD iconv-related compilation warning

2018-08-31 Thread Ævar Arnfjörð Bjarmason
On Fri, Aug 31, 2018 at 11:52 AM Eric Sunshine  wrote:
> OLD_ICONV has long been needed by FreeBSD so config.mak.uname defines
> it unconditionally. However, recent versions do not need it, and its
> presence results in compilation warnings. Resolve this issue by defining
> OLD_ICONV only for older FreeBSD versions.

This seems sane, but just for context is FreeBSD ports itself just
compiling without iconv entirely?

[CC FreeBSD devel/git maintainer]

$ uname -r; grep -ri iconv /usr/ports/devel/git
11.2-RELEASE-p2
/usr/ports/devel/git/Makefile:OPTIONS_DEFINE=   GUI SVN GITWEB CONTRIB
P4 CVS HTMLDOCS PERL ICONV CURL \
/usr/ports/devel/git/Makefile:OPTIONS_DEFAULT=  CONTRIB P4 CVS PERL
GITWEB ICONV CURL SEND_EMAIL PCRE \
/usr/ports/devel/git/Makefile:ICONV_USES=   iconv
/usr/ports/devel/git/Makefile:ICONV_MAKE_ARGS_OFF=  NO_ICONV=1

I have little clue about how ports works, but just noticed that
they're not monkeypatching in OLD_ICONV there.


[PATCH] config.mak.uname: resolve FreeBSD iconv-related compilation warning

2018-08-31 Thread Eric Sunshine
From: Jonathan Nieder 

OLD_ICONV has long been needed by FreeBSD so config.mak.uname defines
it unconditionally. However, recent versions do not need it, and its
presence results in compilation warnings. Resolve this issue by defining
OLD_ICONV only for older FreeBSD versions.

Specifically, revision r281550[1], which is part of FreeBSD 11, removed
the need for OLD_ICONV, and r282275[2] back-ported that change to 10.2.
Versions prior to 10.2 do need it.

[1] 
https://github.com/freebsd/freebsd/commit/b0813ee288f64f677a2cebf7815754b027a8215b
[2] 
https://github.com/freebsd/freebsd/commit/b709ec868adb5170d09bc5a66b18d0e0d5987ab6

[es: commit message; tweak version check to distinguish 10.x versions]

Signed-off-by: Jonathan Nieder 
Signed-off-by: Eric Sunshine 
---

This is a follow-up to [1] which encapsulates Jonathan's proposed change
as a proper patch. I made Jonathan as the author since he did all the
hard research and formulated the core of the change (whereas I only
reported the issue and extended the version check to correctly handle
FreeBSD 10.0 and 10.1). Jonathan's sign-off comes from [1].

[1]: 
https://public-inbox.org/git/20180805075736.gf44...@aiede.svl.corp.google.com/

 config.mak.uname | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/config.mak.uname b/config.mak.uname
index 2be2f19811..e47af72e01 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -192,7 +192,17 @@ ifeq ($(uname_O),Cygwin)
 endif
 ifeq ($(uname_S),FreeBSD)
NEEDS_LIBICONV = YesPlease
-   OLD_ICONV = YesPlease
+   # Versions up to 10.1 require OLD_ICONV; 10.2 and beyond don't.
+   # A typical version string looks like "10.2-RELEASE".
+   ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2)
+   OLD_ICONV = YesPlease
+   endif
+   ifeq ($(firstword $(subst -, ,$(uname_R))),10.0)
+   OLD_ICONV = YesPlease
+   endif
+   ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
+   OLD_ICONV = YesPlease
+   endif
NO_MEMMEM = YesPlease
BASIC_CFLAGS += -I/usr/local/include
BASIC_LDFLAGS += -L/usr/local/lib
-- 
2.19.0.rc1.352.gb1634b371d