Skip to content

Commit 6c6ce21

Browse files
sunshinecogitster
authored andcommitted
config.mak.uname: resolve FreeBSD iconv-related compilation warning
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] freebsd/freebsd-src@b0813ee [2] freebsd/freebsd-src@b709ec8 [es: commit message; tweak version check to distinguish 10.x versions] Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Eric Sunshine <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53f9a3e commit 6c6ce21

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

config.mak.uname

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,17 @@ ifeq ($(uname_O),Cygwin)
192192
endif
193193
ifeq ($(uname_S),FreeBSD)
194194
NEEDS_LIBICONV = YesPlease
195-
OLD_ICONV = YesPlease
195+
# Versions up to 10.1 require OLD_ICONV; 10.2 and beyond don't.
196+
# A typical version string looks like "10.2-RELEASE".
197+
ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2)
198+
OLD_ICONV = YesPlease
199+
endif
200+
ifeq ($(firstword $(subst -, ,$(uname_R))),10.0)
201+
OLD_ICONV = YesPlease
202+
endif
203+
ifeq ($(firstword $(subst -, ,$(uname_R))),10.1)
204+
OLD_ICONV = YesPlease
205+
endif
196206
NO_MEMMEM = YesPlease
197207
BASIC_CFLAGS += -I/usr/local/include
198208
BASIC_LDFLAGS += -L/usr/local/lib

0 commit comments

Comments
 (0)