summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <6yearold@gmail.com>2021-06-09 21:17:12 +0300
committerMatthew Pickering <matthewtpickering@gmail.com>2021-06-19 11:38:17 +0100
commitc55a2adbbafb4066561d3aae9410b158ad5d9950 (patch)
tree4ca05e7cddcf7f96bd8d10d961785bc4fff10dae
parenta0622459f1d9a7068e81b8a707ffc63e153444f8 (diff)
downloadhaskell-wip/mr5930.tar.gz
Pass -DLIBICONV_PLUG when building base library on FreeBSD.wip/mr5930
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