-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
100 lines (79 loc) · 2.34 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
AC_PREREQ([2.61])
AC_INIT([dlvhex-caspplugin],[0.0.1],[[email protected]])
AC_CONFIG_SRCDIR([src/CaspPlugin.cpp])
AC_CONFIG_HEADERS([src/config.h])
# for documentation of the versioning scheme see
# https://sourceforge.net/apps/trac/dlvhex/wiki/LibraryVersions
DLVHEX_DEFINE_VERSION([CASPPLUGIN],[$PACKAGE_VERSION])
DLVHEX_DEFINE_VERSION([DLVHEX_ABI],[7.0.0])
AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
# by default we look into /opt/local and /sw for include files (macports vs. fink)
case $host_os in
darwin*|macosx*)
CPPFLAGS="$CPPFLAGS -I/opt/local/include -I/sw/include"
;;
esac
# Checks for programs.
AC_PROG_CXX
AC_LANG([C++])
# Checks for header files.
AC_HEADER_DIRENT
AC_CHECK_HEADERS([sys/param.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
# Checks for library functions.
AC_LIBTOOL_DLOPEN # we build a module library
AC_DISABLE_STATIC # we don't need a static library
AC_PROG_LIBTOOL
#
# check for gecode library
#
# check for dlvhex, sets various variables
DLVHEX_REQUIRE([2.0.0])
# checking for boost libs
BOOST_REQUIRE([1.41.0])
BOOST_SMART_PTR
BOOST_STRING_ALGO
BOOST_TOKENIZER
# where the plugin will be installed by default.
# running configure will take sysplugindir from dlvhex.pc,
# running configure --enable-userinstall will take homeplugindir.
AC_ARG_ENABLE(userinstall,
[ --enable-userinstall Install plugin into home directory],
[plugindir=$HOME/$DLVHEX_USERPLUGINDIR],
[plugindir=$DLVHEX_SYSPLUGINDIR]
)
AC_SUBST([plugindir])
if test "x$plugindir" == "x"; then
AC_MSG_ERROR([Cannot determine nonempty value for plugindir!])
fi
CPPFLAGS="$CPPFLAGS -I/usr/include/gecode"
LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -lgecodeflatzinc -lgecodedriver -lgecodesearch -lgecodeminimodel -lgecodeset -lgecodeint -lgecodekernel -lgecodesupport"
#
# all needed makefiles
#
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
dnl output configuration
cat <<EOF
$PACKAGE_TARNAME $PACKAGE_VERSION configuration:
- Compiler settings
CC: $CC
CXX: $CXX
CFLAGS: $CFLAGS
CPPFLAGS: $CPPFLAGS
CXXFLAGS: $CXXFLAGS
LDFLAGS: $LDFLAGS
- from pkg-config
DLVHEX_CFLAGS: $DLVHEX_CFLAGS
DLVHEX_LIBS: $DLVHEX_LIBS
DLVHEX_BINDIR: $DLVHEX_BINDIR
- Path settings
prefix: $prefix
plugindir: $plugindir
EOF