summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <6yearold@gmail.com>2021-06-09 21:17:12 +0300
committerZubin <zubin.duggal@gmail.com>2021-06-25 09:15:59 +0000
commit07c26e17c75cb2f9568add83e1cdd83cc6daed51 (patch)
tree410b08a89c9bae1d5719f46185e4bb5d4f03ffb3
parent8306501020cd66f683ad9c215fa8e16c2d62357d (diff)
downloadhaskell-07c26e17c75cb2f9568add83e1cdd83cc6daed51.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 (cherry picked from commit 5d3d9925d54988f3d2475de656c695289e5f0082)
-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 b03250cb99..0c1fe7e2cd 100644
--- a/libraries/base/base.cabal
+++ b/libraries/base/base.cabal
@@ -404,6 +404,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