ports/devel/hs-c2hs/files/patch-src_C2HS_Config.hs
Tobias C. Berner 932e6dc413 Switch C compiler used to compile GHC to base Clang.
This removes build dependency on gcc and runtime dependency on gcc's runtime libraries.

Big thanks to Gleb for working on this.

PR:		225185
Submitted by:	Gleb Popov <6yearold@gmail.com>
Exp-run by:	antoine
Reviewed by:	pgj
Differential Revision:	https://reviews.freebsd.org/D12043
2018-02-10 08:03:22 +00:00

30 lines
993 B
Haskell

Hide the scary c11 features from c2hs, which does not understand them:
gtk2hsC2hs: Error in C header file.
/usr/include/sys/_types.h:104: (column 61) [FATAL]
>>> Syntax error!
The symbol `long' does not fit here.
*** Error code 1
--- src/C2HS/Config.hs.orig 2017-03-21 18:33:51 UTC
+++ src/C2HS/Config.hs
@@ -56,14 +56,17 @@ cpp = case os of
-- understood at least on Linux, FreeBSD, and Solaris and seems to make a
-- difference over the default language setting on FreeBSD
--
+-- * Pass -std=c99 as c2hs get's confused by the c11 parts in the FreeBSD
+-- system headers.
+--
-- * @-P@ would suppress @#line@ directives
--
cppopts :: [String]
cppopts = case (os,cpp) of
-- why is gcc different between all these platforms?
("openbsd","cpp") -> ["-xc"]
- (_,"cpp") -> ["-x", "c"]
- (_,"gcc") -> ["-E", "-x", "c"]
+ (_,"cpp") -> ["-x", "c"]
+ (_,"gcc") -> ["-E", "-x", "c"]
_ -> []
-- | C2HS Library file name