Ticket #3681 (closed bug: fixed)
hsc2hs wrapper script throws away $HSC2HS_EXTRA's value when specified C compiler to use
| Reported by: | nwn | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.2 |
| Component: | hsc2hs | Version: | 6.12.1 RC1 |
| Keywords: | Cc: | bos@… | |
| Operating System: | MacOS X | Architecture: | x86 |
| Type of failure: | Other | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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"
Change History
Note: See
TracTickets for help on using
tickets.
