-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
110 lines (90 loc) · 2.65 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
101
102
103
104
105
106
107
108
109
110
AC_PREREQ([2.61])
AC_INIT([dlvhex2-actionplugin],[2.0.0],[[email protected]])
AC_CONFIG_SRCDIR([src/ActionPlugin.cpp])
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_MACRO_DIR([m4])
# for documentation of the versioning scheme see
# https://sourceforge.net/apps/trac/dlvhex/wiki/LibraryVersions
DLVHEX_DEFINE_VERSION([ACTIONPLUGIN],[$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 other libraries here
#
# 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
#
# all needed makefiles
#
AC_CONFIG_FILES([
Makefile
src/Makefile
include/Makefile
include/acthex/Makefile
examples/Makefile
testsuite/Makefile
examples/BoolMatrix_2x/Makefile
examples/BoolMatrix_2x/src/Makefile
examples/BoolMatrix_2x/include/Makefile
examples/BoolMatrix_2x/examples/Makefile
examples/Utilities/Makefile
examples/Utilities/src/Makefile
examples/Utilities/include/Makefile
examples/Utilities/examples/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