git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 31, 2018, 08:33 UTC
Message-ID
<20180831083342.34836-1-sunshine@sunshineco.com>
In-Reply-To
<20180805075736.GF44140@aiede.svl.corp.google.com>
From: Jonathan Nieder <jrnieder@gmail.com>

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 <jrnieder@gmail.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---

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.GF44140@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
Previous: Jonathan NiederNext: Ævar Arnfjörð Bjarmason
Message 22 of 26 in “Makefile: enable DEVELOPER by default”
  1. Makefile: enable DEVELOPER by defaultStefan Beller, Aug 4, 2018
  2. Makefile: enable DEVELOPER by defaultStefan Beller, Aug 4, 2018
  3. Jonathan NiederAug 4, 2018
  4. Duy NguyenAug 4, 2018
  5. Junio C HamanoAug 4, 2018
  6. Ævar Arnfjörð BjarmasonAug 6, 2018
  7. Jeff KingAug 6, 2018
  8. Randall S. BeckerAug 6, 2018
  9. Jonathan NiederAug 6, 2018
  10. Jeff KingAug 6, 2018
  11. Ævar Arnfjörð BjarmasonAug 6, 2018
  12. Stefan BellerAug 6, 2018
  13. Randall S. BeckerAug 6, 2018
  14. Ævar Arnfjörð BjarmasonAug 6, 2018
  15. Randall S. BeckerAug 6, 2018
  16. Kaartic SivaraamSep 1, 2018
  17. Eric SunshineAug 5, 2018
  18. Jonathan NiederAug 5, 2018
  19. Eric SunshineAug 5, 2018
  20. Eric SunshineAug 5, 2018
  21. Jonathan NiederAug 5, 2018
  22. config.mak.uname: resolve FreeBSD iconv-related compilation warningEric Sunshine, Aug 31, 2018
  23. Ævar Arnfjörð BjarmasonAug 31, 2018
  24. Eric SunshineAug 31, 2018
  25. Jonathan NiederAug 31, 2018
  26. Eric SunshineAug 31, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.