> Is there an easy way to get 'ghc' or one of the other binaries to tell me 
> where the GHC installation directory is? I want to put the includes 
> directory in a gcc -I flag in my makefile.

For ghc >= 5.00, but not on Windows:

    #!/bin/sh
    GHCDIR=`grep '^libdir' ${whichGHC} | head -1 | sed 's/^libdir=.\(.*\)./\1/'`    if 
[ ! -d $GHCDIR/imports ]
    then GHCDIR=`grep '^TOPDIROPT' ${whichGHC} | head -1 | sed 
's/^TOPDIROPT="*-B\([^";]*\).*/\1/'`
    fi
    echo $GHCDIR/imports

For ghc < 5.00, including on Windows:

    #!/bin/sh
    GHCDIR=`grep '^\$libdir=' ${whichGHC} | head -1 | sed 
's/^\$libdir=[^/]*\(.*\).;/\1/'` 
    if [ -d $GHCDIR/imports ]
    then echo $GHCDIR/imports
    elif [ -d $GHCDIR/lib/imports ]
    then echo $GHCDIR/lib/imports
    echo echo unknown
    fi

Regards,
    Malcolm

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to