#3681: hsc2hs wrapper script ignores default flags
---------------------------+------------------------------------------------
    Reporter:  nwn         |       Owner:              
        Type:  bug         |      Status:  new         
    Priority:  normal      |   Component:  hsc2hs      
     Version:  6.12.1 RC1  |    Keywords:              
          Os:  MacOS X     |    Testcase:              
Architecture:  x86         |     Failure:  None/Unknown
---------------------------+------------------------------------------------
 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"

 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3681>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to