-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
41 lines (34 loc) · 1.3 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
AC_INIT([Haskell RTS-serialisation support module ], [0.0.0.0], [[email protected]], [rts-serialisation])
# Safety check: Ensure that we are in the correct source directory.
AC_CONFIG_SRCDIR([rts-serialisation.cabal])
# figure out GHC to use
AC_ARG_WITH([compiler],
[AC_HELP_STRING([--with-compiler=ARG],
[Use path ARG for GHC (we only support GHC!)])],
[WithGhc="$withval"],
[if test "$HC" = ""; then
AC_PATH_PROG([GHC], [ghc])
fi
WithGhc="$GHC"])
AC_SUBST([WithGhc])
# we require it to be really GHC
AS_IF([test "$WithGhc" == ""],
AC_MSG_ERROR([GHC is required for this library.]))
# GHC should be callable
AS_IF([$WithGhc --version],[],
AC_MSG_ERROR([Your GHC does not work!]))
AC_MSG_CHECKING([for serialisation support in GHC runtime system])
# create Haskell which imports primitives
rm -f conftest.*;
cat > conftest.hs << EOF
{-# OPTIONS_GHC -XMagicHash #-}
module Serialisationtest where
import GHC.Base(serialize#, deserialize#, trySerialize# )
test s = trySerialize# s
EOF
#try to compile this, using WithGhc:
AS_IF( $WithGhc -c conftest.hs 2>&AS_MESSAGE_LOG_FD ,
[AC_MSG_RESULT([OK])],
[AC_MSG_RESULT([not found]);
AC_MSG_ERROR([Your GHC does not support serialisation primitives required by this package.])]
)