-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
79 lines (56 loc) · 2.25 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
AC_INIT([p44banditd], [1.1], [luz@plan44.ch], [p44banditd], [http://www.plan44.ch/])
AC_PREREQ([2.59])
AC_CONFIG_AUX_DIR(configure_aux)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.10 no-define foreign subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
AC_CONFIG_FILES([Makefile])
##### OPTIONS
AC_ARG_ENABLE(
[debug],
[AC_HELP_STRING([--enable-debug], [Debug build with extra debugging code])]
)
AM_CONDITIONAL([DEBUG], [test "x$enable_debug" = xyes])
AC_ARG_ENABLE(
[p44buildow],
[AC_HELP_STRING([--enable-p44buildow], [plan44 build for openwrt targets])]
)
AM_CONDITIONAL([P44_BUILD_OW], [test "x$enable_p44buildow" = xyes])
AC_CHECK_LIB(m, atan2, [], [AC_MSG_ERROR([Could not find math lib (m)])])
AC_CHECK_LIB(rt, clock_gettime, [], [AC_MSG_ERROR([Could not find rt lib for clock_gettime])])
AC_CHECK_LIB(dl, dlopen, [], [AC_MSG_ERROR([Could not find libdl])])
AC_CHECK_LIB(json-c, json_tokener_get_error, [], [AC_MSG_ERROR([Could not find JSON-C / libjson0 with json_tokener_get_error supported (>=0.10)])])
AC_CHECK_LIB(ssl, TLSv1_client_method, [], [AC_MSG_ERROR([Could not find libssl with TLSv1_client_method])])
AC_CHECK_LIB(crypto, SHA1_Init, [], [AC_MSG_ERROR([Could not find libcrypto with SHA1_Init])])
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([JSONC], [json-c >= 0.10 ], [], [
AC_MSG_ERROR([$JSON_PKG_ERRORS])
])
PKG_CHECK_MODULES([SQLITE3], [sqlite3], [], [
AC_MSG_ERROR([$SQLITE3_PKG_ERRORS])
])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h sys/resource.h], [], [AC_MSG_ERROR([required system header not found])])
ASSUMED_BOOST_VER=146
BOOST_REQUIRE([1.46],
[
unset boost_cv_version
unset boost_cv_inc_path
BOOST_REQUIRE([1.35],
[
AC_MSG_ERROR([could not find boost on your system])
])
ASSUMED_BOOST_VER=135
])
if test $ASSUMED_BOOST_VER -eq 135; then
AC_DEFINE([BOOST_VERSION_135], [1], [boost 1.35 or higher])
else
AC_DEFINE([BOOST_VERSION_146], [1], [boost 1.46 or higher])
fi
BOOST_BIND
BOOST_FOREACH
BOOST_FUNCTION
BOOST_SMART_PTR
AX_PTHREAD([], [ AC_MSG_ERROR([required pthread library not found]) ])
AC_OUTPUT