From c55a2adbbafb4066561d3aae9410b158ad5d9950 Mon Sep 17 00:00:00 2001 From: Gleb Popov <6yearold@gmail.com> Date: Wed, 9 Jun 2021 21:17:12 +0300 Subject: Pass -DLIBICONV_PLUG when building base library on FreeBSD. If libiconv is installed from packages on the build machine, there is a high chance that the build system will pick up /usr/local/include/iconv.h instead of base /usr/include/iconv.h This additional preprocessor define makes package's libiconv header compatible with system one, fixing the build. Closes issue #19958 --- libraries/base/base.cabal | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal index 85714bf05f..a43055c11a 100644 --- a/libraries/base/base.cabal +++ b/libraries/base/base.cabal @@ -440,6 +440,12 @@ Library System.CPUTime.Posix.RUsage System.CPUTime.Unsupported + -- The Ports framework always passes this flag when building software that + -- uses iconv to make iconv from Ports compatible with iconv from the base system + -- See /usr/ports/Mk/Uses/iconv.mk + if os(freebsd) + cc-options: -DLIBICONV_PLUG + -- We need to set the unit id to base (without a version number) -- as it's magic. ghc-options: -this-unit-id base -- cgit v1.2.1