Minor refactoring of placeHolderPunRhs
[ghc-hetmet.git] / aclocal.m4
index 540ec3e..816e1f5 100644 (file)
@@ -1327,4 +1327,13 @@ case "$1" in
   esac
 ])
 
+# LIBRARY_VERSION(lib)
+# --------------------------------
+# Gets the version number of a library.
+# If $1 is ghc-prim, then we define LIBRARY_ghc_prim_VERSION as 1.2.3
+AC_DEFUN([LIBRARY_VERSION],[
+LIBRARY_[]translit([$1], [-], [_])[]_VERSION=`grep -i "^version:" libraries/$1/$1.cabal | sed "s/.* //"`
+AC_SUBST(LIBRARY_[]translit([$1], [-], [_])[]_VERSION)
+])
+
 # LocalWords:  fi