forked from calaos/calaos_base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
261 lines (214 loc) · 7.68 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
CALAOS_VERSION
AC_INIT([calaos], [calaos_version], [[email protected]])
AC_PREREQ([2.59])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([tar-ustar 1.6 dist-xz subdir-objects foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_GNU_SOURCE
AC_SYS_LARGEFILE
LT_PREREQ([2.2])
LT_INIT([win32-dll])
AM_GNU_GETTEXT_VERSION([0.17])
m4_ifdef([AM_GNU_GETTEXT], [
AM_GNU_GETTEXT([external])
po_makefile_in=po/Makefile.in
have_po="yes"
],[
have_po="no"
])
AC_SUBST(LTLIBINTL)
if test "x${POSUB}" = "x" ; then
have_po="no"
fi
AM_CONDITIONAL([HAVE_PO], [test "x${have_po}" = "xyes"])
### Needed information
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
### Checks for programs
AC_PROG_CXX
AC_PROG_CC
AM_PROG_CC_C_O
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
# pkg-config
PKG_PROG_PKG_CONFIG
### Checks for libraries
efl_ver="1.7.10"
requirements_calaos_common="eina >= ${efl_ver} eet >= ${efl_ver} ecore >= ${efl_ver} ecore-file >= ${efl_ver} ecore-con >= ${efl_ver} sigc++-2.0 >= 2.4.1 jansson >= 2.5 libcurl >= 7.20.0 luajit"
PKG_CHECK_MODULES([CALAOS_COMMON], [${requirements_calaos_common}])
AC_SUBST([requirements_calaos_common])
requirements_calaos_server="eina >= ${efl_ver} eet >= ${efl_ver} ecore >= ${efl_ver} ecore-file >= ${efl_ver} ecore-con >= ${efl_ver} libcurl"
PKG_CHECK_MODULES([CALAOS_SERVER], [${requirements_calaos_server}])
AC_SUBST([requirements_calaos_server])
CALAOS_COMMON_LIBS="${CALAOS_COMMON_LIBS} ${LUA_LIBS} ${lua_libs}"
CALAOS_COMMON_CFLAGS="${CALAOS_COMMON_CFLAGS} ${LUA_CFLAGS}"
requirements_calaos_home="evas >= ${efl_ver} edje >= ${efl_ver} eina >= ${efl_ver} eet >= ${efl_ver} ecore >= ${efl_ver} ecore-file >= ${efl_ver} ecore-con >= ${efl_ver} elementary >= ${efl_ver} openssl >= 1.0.0 libcurl"
PKG_CHECK_MODULES([CALAOS_HOME], [${requirements_calaos_home}], [have_calaos_home_dep="no"], [have_calaos_home_dep="no"])
AM_CONDITIONAL([HAVE_CALAOS_HOME_BIN], [test "x${have_calaos_home_dep}" = "xyes"])
AC_SUBST([requirements_calaos_home])
### Check if elm_web_url_get is present. This function has been added in efl 1.8 and elm_web_uri_get
### has been deprecated and elm_web_uri_get has been removed in efl 1.10
PKG_CHECK_MODULES([ELM_WEB_URL], [elementary >= 1.7.99], [have_elm_web_url="yes"], [have_elm_web_url="no"])
AM_CONDITIONAL([HAVE_ELM_WEB_URL], [test "x${have_elm_web_url}" = "xyes"])
if test "x${have_elm_web_url}" == "xyes"
then
AC_DEFINE([HAVE_ELM_WEB_URL], [1], [elm_web_url])
fi
EFL_CHECK_FUNCS([CALAOS_HOME], [dlopen])
## Theme
AC_ARG_ENABLE([theme],
[AC_HELP_STRING(
[--disable-theme],
[disable theme. @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes"; then
build_theme="no"
else
build_theme="no"
fi
],
[build_theme="no"])
AM_CONDITIONAL([CALAOS_BUILD_THEME], [test "x${build_theme}" = "xyes"])
AC_MSG_CHECKING([whether Theme is to be built])
AC_MSG_RESULT([${build_theme}])
AM_CONDITIONAL([ENNA_BUILD_THEME], [test "x${build_theme}" = "xyes"])
### Checks for compiler characteristics
AC_C_BIGENDIAN
AC_C_INLINE
### Checks for linker characteristics
lt_enable_auto_import=""
case "${host_os}" in
mingw*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
AC_SUBST([lt_enable_auto_import])
EFL_CHECK_COMPILER_FLAGS([CALAOS_COMMON], [-Wall -Wextra -Wno-unused-parameter -Wshadow -Wpointer-arith -Wno-missing-field-initializers -fvisibility=hidden -fdata-sections -ffunction-sections])
### Checks for header files
AC_HEADER_ASSERT
AC_CHECK_HEADERS([unistd.h])
have_owcapi="no"
AC_CHECK_HEADERS([owcapi.h], [have_owcapi="yes"])
AM_CONDITIONAL([HAVE_OWCAPI], [test "x${have_owcapi}" = "xyes"])
if test "x${have_owcapi}" == "xyes"
then
AC_CHECK_LIB([owcapi], [OW_init],, AC_ERROR([Misssing owfs library]))
fi
have_ewebkit="no"
PKG_CHECK_MODULES([EWEBKIT], [ewebkit], [have_ewebkit="yes"], [have_ewebkit="no"])
AM_CONDITIONAL([HAVE_EWEBKIT], [test "x${have_ewebkit}" = "xyes"])
if test "x${have_ewebkit}" == "xyes"
then
AC_DEFINE([HAVE_EWEBKIT], [1], [ewebkit])
fi
have_ecore_x="no"
PKG_CHECK_MODULES([ECORE_X], [ecore-x x11 xext], [have_ecore_x="yes"], [have_ecore_x="no"])
AM_CONDITIONAL([HAVE_ECORE_X], [test "x${have_ecore_x}" = "xyes"])
if test "x${have_ecore_x}" == "xyes"
then
AC_DEFINE([HAVE_ECORE_X], [1], [ecore_x])
fi
have_libusb="no"
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], [have_libusb="yes"], [have_libusb="no"])
AM_CONDITIONAL([HAVE_LIBUSB], [test "x${have_libusb}" = "xyes"])
if test "x${have_libusb}" == "xyes"
then
AC_DEFINE([HAVE_LIBUSB], [1], [libusb])
fi
have_libola="no"
PKG_CHECK_MODULES([LIBOLA], [libola], [have_libola="yes"], [have_libola="no"])
AM_CONDITIONAL([HAVE_LIBOLA], [test "x${have_libola}" = "xyes"])
if test "x${have_libola}" == "xyes"
then
AC_DEFINE([HAVE_LIBOLA], [1], [libola])
fi
have_libknx="no"
AC_CHECK_HEADERS([eibclient.h], [have_libknx="yes"])
AM_CONDITIONAL([HAVE_LIBKNX], [test "x${have_libknx}" = "xyes"])
if test "x${have_libknx}" == "xyes"
then
AC_CHECK_LIB([eibclient], [EIBSocketLocal],, AC_ERROR([Missing eibclient library]))
AC_DEFINE([HAVE_LIBKNX], [1], [libknx])
fi
# Configure pthreads.
ACX_PTHREAD([have_pthread=yes])
#check for gtest
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([gtest/gtest.h], [have_gtest="yes"])
AM_CONDITIONAL([HAVE_GTEST], [test "x${have_gtest}" = "xyes"])
AC_LANG_POP([C++])
if test "x${have_gtest}" == "xyes"
then
GTEST_INFO="make check"
else
GTEST_INFO="install gtest to run this test"
fi
#check for autobahn test suite
AC_CHECK_PROG(HAVE_AUTOBAHN, wstest, yes)
AM_CONDITIONAL([HAVE_AUTOBAHN], [test "x${HAVE_AUTOBAHN}" = "xyes"])
if test "x${HAVE_AUTOBAHN}" == "xyes"
then
WS_INFO="make check"
else
WS_INFO="install autobahn testsuite to run this test"
fi
CALAOS_LTMODULE_FLAGS="-shared -module -avoid-version -export-dynamic"
AC_SUBST([CALAOS_LTMODULE_FLAGS])
AC_CONFIG_FILES([
Makefile
tests/Makefile
src/Makefile
src/lib/Makefile
src/bin/Makefile
src/bin/calaos_server/Makefile
src/bin/calaos_home/Makefile
src/bin/tools/Makefile
src/widgets/Makefile
src/widgets/clock/Makefile
src/widgets/note/Makefile
data/Makefile
data/debug/Makefile
data/debug/dist/Makefile
data/themes/Makefile
data/themes/default/Makefile
data/themes/widgets/Makefile
data/themes/widgets/clock/Makefile
data/themes/widgets/note/Makefile
$po_makefile_in
])
AC_OUTPUT
#####################################################################
## Info
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo
echo "Configuration Options Summary:"
echo
echo "Compilation............................: make (or gmake)"
echo " CPPFLAGS.............................: $CPPFLAGS"
echo " CFLAGS...............................: $CFLAGS"
echo " LDFLAGS..............................: $LDFLAGS"
echo
echo "Test Suite:"
echo " gtest library........................: $GTEST_INFO"
echo " Autobahn Websocket test suite........: $WS_INFO"
echo
echo "Installation...........................: make install (as root if needed, with 'su' or 'sudo')"
echo " prefix...............................: $prefix"
echo
echo " Build Calaos Server...................: yes"
echo " Build Calaos Home.....................: $have_calaos_home_dep"
echo " Build theme...........................: $build_theme"
echo
echo " One Wire support......................: ${have_owcapi}"
echo " EWebkit support.......................: ${have_ewebkit}"
echo " Ecore_X support.......................: ${have_ecore_x}"
echo " Libusb support........................: ${have_libusb}"
echo " Open Lightning Architecture support...: ${have_libola}"
echo " Eib/KNX support (eibd or knxd)........: ${have_libknx}"
echo