From 48e50938f71acaac5f3aa38b29364cda726e2a3d Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 18 May 2009 22:32:19 +0000 Subject: [PATCH] Got the build system to use specific versions of some packages Eventually we should probably do this for all packages, but we certainly need it for base on GHC 6.10 (this avoids dealing with some other things, such as base being split up), and I needed it for QuickCheck too, since something had installed the latest version. --- Makefile.am | 4 ++-- configure.ac | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 145c8c9..b3a86bf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,7 @@ GHC_OPTS = \ \ -hide-all-packages \ -package array \ - -package base \ + -package @LIB_VER_base@ \ -package containers \ -package directory \ -package fgl \ @@ -23,7 +23,7 @@ GHC_OPTS = \ -package parsec \ -package pretty \ -package process \ - -package QuickCheck \ + -package @LIB_VER_quickcheck@ \ -package random \ -package regex-compat \ \ diff --git a/configure.ac b/configure.ac index a9cabd8..f74270c 100644 --- a/configure.ac +++ b/configure.ac @@ -64,6 +64,7 @@ AC_DEFUN([AC_NEED_HASKELL_LIB], ]) AC_NEED_HASKELL_LIB([array],LIB_array) +AC_NEED_HASKELL_LIB([base],LIB_base) AC_NEED_HASKELL_LIB([containers],LIB_containers) AC_NEED_HASKELL_LIB([directory],LIB_directory) AC_NEED_HASKELL_LIB([mtl],LIB_mtl) @@ -78,6 +79,24 @@ AC_NEED_HASKELL_LIB([regex-base],LIB_regexbase) AC_NEED_HASKELL_LIB([regex-compat],LIB_regexcompat) AC_NEED_HASKELL_LIB([regex-posix],LIB_regexposix) +AC_DEFUN([AC_PICK_HASKELL_LIB_VER], +[ + AC_MSG_CHECKING([for $1 library, major version $2]) + $3=`ghc-pkg list $1 | grep $1 | grep -oE "$1-$2[[.0-9]]+" | tail -n 1` + if test "x$$3" = "x"; then + AC_MSG_ERROR([$1-$2* not found]) + else + AC_MSG_RESULT([$$3]) + fi +]) + +#GHC 6.10 and later have base-3 and base-4. For now, we're sticking with +#base-3, but we need to know the exact version to tell GHC. We filter +#for base-3, and take the last one (since ghc-pkg lists them in ascending order) +AC_PICK_HASKELL_LIB_VER([base],[3],[LIB_VER_base]) +#For now, we need QuickCheck 1: +AC_PICK_HASKELL_LIB_VER([QuickCheck],[1],[LIB_VER_quickcheck]) + PKG_CHECK_MODULES(CCSP, ccsp-1.6 >= 1.6.3,, AC_MSG_WARN([CCSP not located using pkg-config; you will not be able to compile output from the C backend on this machine: ] $CCSP_PKG_ERRORS) ccsp_available=false @@ -264,6 +283,8 @@ AC_SUBST(TOCK_CXXLDFLAGS) AC_SUBST(ccsp_available) AC_SUBST(cppcsp_available) AC_SUBST(MKDIR_P) +AC_SUBST(LIB_VER_base) +AC_SUBST(LIB_VER_quickcheck) AC_CONFIG_FILES([Makefile config/TypeSizes.hs config/CompilerCommands.hs]) AC_OUTPUT