summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <6yearold@gmail.com>2021-06-09 21:17:12 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-18 12:27:36 -0400
commit5d3d9925d54988f3d2475de656c695289e5f0082 (patch)
treec1a91910a98ffdd1a5f70d608cc2169d8e53de44
parentdb7e6dc5e510a132e256674d0ba4b9e7a55afaf6 (diff)
downloadhaskell-5d3d9925d54988f3d2475de656c695289e5f0082.tar.gz
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
-rw-r--r--libraries/base/base.cabal6
1 files changed, 6 insertions, 0 deletions
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