-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
51 lines (40 loc) · 1.43 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
41
42
43
44
45
46
47
48
49
50
#
#
AC_PREREQ(2.60)
AC_INIT([scoop],[1.0],[[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([autotools])
AM_INIT_AUTOMAKE([foreign])
AC_USE_SYSTEM_EXTENSIONS
MAJOR_VERSION=`echo "$VERSION" | sed -e 's/^\([[0-9]]*\)\.[[0-9]]*.*$/\1/'`
MINOR_VERSION=`echo "$VERSION" | sed -e 's/^[[0-9]]*\.\([[0-9]]*\).*$/\1/'`
AC_DEFINE_UNQUOTED([MAJOR_VERSION], [$MAJOR_VERSION], [Scoop's major version.])
AC_DEFINE_UNQUOTED([MINOR_VERSION], [$MINOR_VERSION], [Scoop's minor version.])
AC_PROG_CC
CHECK_GHC
AC_MSG_CHECKING([if dynamic packages are available])
GHCFLAGS="-dynamic"
TRY_COMPILE_GHC([
main = putStr "Hello world!\n"
],[],
AC_MSG_FAILURE(
"GHC's dynamic packages could not be found.
Without GHC's dynamic packages neither scoop nor libscoop can be built.
On Ubuntu GHC's dynamic packages are in aptitude's ghc-dynamic package.
Install them before continuing."
))
AC_MSG_CHECKING([if hashmap is available])
TRY_COMPILE_GHC([
import Data.HashMap
main = putStr "Hello world!\n"
],[have_hashmap=yes],
AC_MSG_WARN(scoop will not be built: hashmap not found.))
AM_CONDITIONAL([HAVE_HASHMAP], [test x"$have_hashmap" != "x"])
AC_MSG_CHECKING([if happy is available])
AC_CHECK_PROGS(HAPPY, [happy])
if test x"$HAPPY" = x ; then
AC_MSG_ERROR([Please install happy before trying to build scoop.])
fi
AC_CONFIG_FILES([Makefile src/Makefile])
AC_DEFINE(HAVE_SCOOP,,[define if the SCOOP library is available])
AC_OUTPUT