-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
137 lines (101 loc) · 4.03 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
AC_INIT([p44featured], [1.3.0], [[email protected]], [p44featured], [https://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_ARG_ENABLE(
[p44buildrb],
[AC_HELP_STRING([--enable-p44buildrb], [plan44 build for Raspbian targets])]
)
AM_CONDITIONAL([P44_BUILD_RB], [test "x$enable_p44buildrb" = xyes])
AC_ARG_ENABLE(
[ubus],
[AS_HELP_STRING([--enable-ubus], [Enable ubus API support (requires libubus)])]
)
AM_CONDITIONAL([ENABLE_UBUS], [test "x$enable_ubus" = xyes])
AC_ARG_ENABLE(
[rpiws281x],
[AS_HELP_STRING([--enable-rpiws281x], [Enable WS281x Ledchain support on RaspberryPi])]
)
AM_CONDITIONAL([ENABLE_RPIWS281X], [test "x$enable_rpiws281x" = xyes])
AC_ARG_ENABLE(
[png],
[AS_HELP_STRING([--enable-png], [Enable PNG image support for ledchains])]
)
AM_CONDITIONAL([ENABLE_PNG], [test "x$enable_png" = xyes])
AC_ARG_ENABLE(
[uwsc],
[AS_HELP_STRING([--enable-uwsc], [Enable libuwsc usage for websockets])]
)
AM_CONDITIONAL([ENABLE_UWSC], [test "x$enable_uwsc" = xyes])
AC_ARG_ENABLE(
[ev],
[AS_HELP_STRING([--enable-ev], [Enable libev usage for mainloop])]
)
AM_CONDITIONAL([ENABLE_EV], [test "x$enable_ev" = xyes])
AC_CHECK_LIB(m, atan2, [], [AC_MSG_ERROR([Could not find math lib (m) with atan2])])
AC_CHECK_LIB(rt, clock_gettime, [], [AC_MSG_ERROR([Could not find rt lib with clock_gettime])])
AC_CHECK_LIB(dl, dlopen, [], [AC_MSG_ERROR([Could not find libdl with dlopen])])
AM_COND_IF([ENABLE_UBUS], [
AC_CHECK_LIB(ubus, ubus_connect_ctx, [], [AC_MSG_ERROR([Could not find libubus with ubus_connect_ctx])])
AC_CHECK_LIB(ubox, uloop_init, [], [AC_MSG_ERROR([Could not find libubox with uloop_init])])
AC_CHECK_LIB(blobmsg_json, blobmsg_add_object, [], [AC_MSG_ERROR([Could not find libblobmsg_json with blobmsg_add_object])])
], [])
AM_COND_IF([ENABLE_UWSC], [
AC_CHECK_LIB(uwsc, uwsc_init, [], [AC_MSG_ERROR([Could not find libuwsc with uwsc_init])])
], [])
AM_COND_IF([ENABLE_EV], [
AC_CHECK_LIB(ev, ev_time, [], [AC_MSG_ERROR([Could not find libuwsc with ev_time])])
], [])
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])])
AC_CHECK_LIB(sqlite3, sqlite3_open, [], [AC_MSG_ERROR([Could not find sqlite3 with sqlite3_open])])
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])
])
AM_COND_IF([ENABLE_PNG], [
PKG_CHECK_MODULES([PNG], [libpng >= 1.6], [], [
AC_MSG_ERROR([$PNG_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