Skip to content

Instantly share code, notes, and snippets.

@jsl
Created January 4, 2015 16:13
Show Gist options
  • Save jsl/20c632557f6273d938b4 to your computer and use it in GitHub Desktop.
Save jsl/20c632557f6273d938b4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
GHC_VERSION_STRING=`ghc --version 2> /dev/null`
if [ $? -ne 0 ]
then
echo "Unable to obtain GHC version!"
exit 1
fi
+GHC_VERSION=`echo ${GHC_VERSION_STRING} | perl -n -e'/version (\d+\.\d+.\d+)/ && print $1'`
echo "executable: call-haskell-from-anything.so" > call-haskell-from-anything.buildinfo
echo "extra-libraries: HSrts-ghc${GHC_VERSION}" >> call-haskell-from-anything.buildinfo
@nh2
Copy link

nh2 commented Jan 4, 2015

You can use ghc --numeric-version to avaoid the perling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment