hsc2hs wrapper script throws away $HSC2HS_EXTRA's value when specified C compiler to use
hsc2hs wrapper script ignores default flags to build 32bit binary when specified C-compiler to use even if it was gcc.
This become a problem when building packages with Cabal. As usual, Cabal passes --cc=/path/to/gcc to hsc2hs. So default flags are ignored, built packages are broken.
I edited script to fix this problem. I think it's ugly fix, but it works.
{{{
#!/bin/sh
exedir="/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.0.20091121"
exeprog="hsc2hs"
executablename="exedir/exeprog"
datadir="/Library/Frameworks/GHC.framework/Versions/612/usr/share"
bindir="/Library/Frameworks/GHC.framework/Versions/612/usr/bin"
topdir="/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.0.20091121"
HSC2HS_EXTRA="--cflag=-m32 --lflag=-m32"
#!/bin/sh
tflag="--template=$topdir/template-hsc.h" Iflag="-I$topdir/include/"
for arg do
case "$arg" in
- gcc) break;;
-c*) HSC2HS_EXTRA=;;
--cc=*) HSC2HS_EXTRA=;;
-t*) tflag=;;
--template=*) tflag=;;
--) break;;
esac
done
exec "executablename" "tflag" $HSC2HS_EXTRA {1+"@"} "$Iflag"
}}}
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.12.1 RC1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | hsc2hs |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |