forked from resiprocate/resiprocate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
423 lines (356 loc) · 13.5 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
AC_INIT(resiprocate,1.13.0~alpha1)
AC_CONFIG_SRCDIR(repro/repro.cxx)
SO_RELEASE=`echo $PACKAGE_VERSION | cut -f1,2 -d.`
AC_SUBST(SO_RELEASE)
########## End of release/version data ######################
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax])
m4_pattern_forbid([^PKG_])
AC_CANONICAL_HOST
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_SED
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AM_MISSING_PROG([GPERF], [gperf])
AC_GPERFVER
AX_CXX_COMPILE_STDCXX(11)
CPPFLAGS="${CPPFLAGS} -DENABLE_LOG_REPOSITORY_DETAILS"
AC_MSG_CHECKING([ for GNU warning flags])
if test "${GXX}"x = yesx; then
CXXFLAGS="${CXXFLAGS} -Wall -Wno-deprecated"
CFLAGS="${CFLAGS} -Wall -Wno-deprecated"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
ARCH_CPPFLAGS="-D_REENTRANT"
AM_CONDITIONAL([MACOSX], [false])
AS_IF([test "x$host_vendor" = "xapple"], [
AC_MSG_CHECKING([if building for macOS])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <stdio.h>
#include <TargetConditionals.h>
]], [[
#if TARGET_OS_IPHONE == 1
#error Not macOS
#endif
return 0;
]])
],[
AC_MSG_RESULT([yes])
AM_CONDITIONAL([MACOSX], [true])
],[
AC_MSG_RESULT([no])
])
])
AC_C_BIGENDIAN([AC_DEFINE_UNQUOTED(RESIP_BIG_ENDIAN, , RESIP_BIG_ENDIAN)])
CPPFLAGS="${CPPFLAGS} ${ARCH_CPPFLAGS}"
AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists])
AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),,
[#include <arpa/inet.h>])
AC_DEFINE(REPRO_BUILD_REV, PACKAGE_VERSION, REPRO_BUILD_REV)
AH_TEMPLATE([REPRO_BUILD_REV], [SVN revision])
AC_DEFINE_UNQUOTED(REPRO_BUILD_HOST, "localhost", REPRO_BUILD_HOST)
AH_TEMPLATE([REPRO_BUILD_HOST], [Host where package was configured])
AC_DEFINE(REPRO_RELEASE_VERSION, PACKAGE_VERSION, REPRO_RELEASE_VERSION)
AH_TEMPLATE([REPRO_RELEASE_VERSION], [Package version])
AC_DEFINE_UNQUOTED(DB_HEADER, "db_cxx.h", DB_HEADER)
AH_TEMPLATE([DB_HEADER], [Name of header for libdb])
AC_DEFINE_UNQUOTED(RESIP_SIP_MSG_MAX_BYTES, ${RESIP_SIP_MSG_MAX_BYTES:-10485760}, [Maximum SIP message size to try and parse (bytes)])
AM_CONDITIONAL(USE_ARES, true)
AM_CONDITIONAL(USE_CARES, false)
AC_ARG_WITH(c-ares,
[ --with-c-ares Link against libc-ares (rather than contrib/ares)],
[AC_DEFINE_UNQUOTED(USE_CARES, , USE_CARES)
AC_SUBST(LIBARES_LIBADD, "-lcares")
AM_CONDITIONAL(USE_ARES, false)
AM_CONDITIONAL(USE_CARES, true)
AC_SEARCH_LIBS(ares_init, cares, , [
AC_MSG_ERROR([unable to find ares_init(), install libcares and/or set LDFLAGS, or use contrib/ares])
])],
[ AC_DEFINE_UNQUOTED(USE_ARES, , USE_ARES)
CXXFLAGS="$CXXFLAGS -I\$(top_srcdir)/rutil/dns/ares"
LDFLAGS="$LDFLAGS -L\$(top_builddir)/rutil/dns/ares"
AC_SUBST(LIBARES_LIBADD, "\$(top_builddir)/rutil/dns/ares/libresipares.la")
# We no longer check for this because it gets built by us:
#AC_SEARCH_LIBS(ares_init, ares, , [
# AC_MSG_ERROR([unable to find ares_init(), must build contrib/ares or specify --with-c-ares])
#])
])
AM_CONDITIONAL(USE_SSL, false)
AC_ARG_WITH(ssl,
[ --with-ssl Link against OpenSSL libraries],
[AC_DEFINE_UNQUOTED(USE_SSL, , USE_SSL)
AC_SUBST(LIBSSL_LIBADD, "-lssl -lcrypto")
AM_CONDITIONAL(USE_SSL, true)],
[ AC_SUBST(LIBSSL_LIBADD, "")])
AM_CONDITIONAL(USE_POPT, false)
AC_ARG_WITH(popt,
[ --with-popt Link against POPT libraries],
[AC_DEFINE_UNQUOTED(HAVE_POPT_H, , HAVE_POPT_H)
AC_SUBST(LIBPOPT_LIBADD, "-lpopt")
AM_CONDITIONAL(USE_POPT, true)],
[ AC_SUBST(LIBPOPT_LIBADD, "")])
AC_ARG_WITH(sigcomp,
[ --with-sigcomp Link against Open SigComp libraries for SigComp],
AC_DEFINE_UNQUOTED(USE_SIGCOMP, , USE_SIGCOMP), )
AM_CONDITIONAL(USE_FMT, false)
AC_ARG_WITH(fmt,
[ --with-fmt Link against fmt library],
[AC_DEFINE_UNQUOTED(USE_FMT, , USE_FMT)
PKG_CHECK_MODULES([DEPS_FMT], [fmt])
AM_CONDITIONAL(USE_FMT, true)])
#LIBTOOL_VERSION_RELEASE="-version-info 0:0:0 -release @SO_RELEASE@"
LIBTOOL_VERSION_RELEASE="-release $SO_RELEASE"
AC_SUBST(LIBTOOL_VERSION_RELEASE)
AC_ARG_ENABLE(versioned-soname,
[ --enable-versioned-soname Enable version in SONAME],
[ if test "$enableval" = no; then
LIBTOOL_VERSION_RELEASE=""
AC_SUBST(LIBTOOL_VERSION_RELEASE)
fi
],
[
])
AC_ARG_ENABLE(android,
[ --enable-android Enable Android build],
[AC_SUBST(LIBPTHREAD_LIBADD, "")
AC_SUBST(LIBLOG_LIBADD, "-llog")],
[AC_SUBST(LIBPTHREAD_LIBADD, "-lpthread")
AC_SUBST(LIBLOG_LIBADD, "")
AC_SUBST(LIBSTL_LIBADD, "")])
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 Enable IPv6 support],
AC_DEFINE_UNQUOTED(USE_IPV6, , USE_IPV6), )
AC_ARG_ENABLE(dtls,
[ --enable-dtls Enable DTLS support (requires OpenSSL)],
[AC_DEFINE_UNQUOTED(USE_DTLS, 1, USE_DTLS)], )
AC_ARG_ENABLE(pedantic-stack,
[ --enable-pedantic-stack Enable pedantic behavior (fully parse all messages)],
[AC_DEFINE_UNQUOTED(PEDANTIC_STACK, 1, PEDANTIC_STACK)], )
AM_CONDITIONAL(USE_MYSQL, false)
AC_ARG_WITH(mysql,
[ --with-mysql Link against MySQL client libraries],
[AC_DEFINE_UNQUOTED(USE_MYSQL, , USE_MYSQL)
AC_SUBST(LIBMYSQL_LIBADD, "-lmysqlclient")
AM_CONDITIONAL(USE_MYSQL, true)],
[ AC_SUBST(LIBMYSQL_LIBADD, "")])
# some systems may have a newer version of libpq that is not
# compatible with the packaged version of soci_postgresql
AM_CONDITIONAL(USE_SOCI_POSTGRESQL, false)
AC_ARG_WITH(soci-postgresql,
[ --with-soci-postgresql Build recon with SOCI PostgreSQL support],
[AC_DEFINE_UNQUOTED(USE_SOCI_POSTGRESQL, , USE_SOCI_POSTGRESQL)
AM_CONDITIONAL(USE_SOCI_POSTGRESQL, true)], )
# can't have both MariaDB C client and SOCI MySQL at the same
# time in some environments, e.g. CentOS 8.1
AM_CONDITIONAL(USE_SOCI_MYSQL, false)
AC_ARG_WITH(soci-mysql,
[ --with-soci-mysql Build recon with SOCI MySQL support],
[AC_DEFINE_UNQUOTED(USE_SOCI_MYSQL, , USE_SOCI_MYSQL)
AM_CONDITIONAL(USE_SOCI_MYSQL, true)], )
AM_CONDITIONAL(USE_POSTGRESQL, false)
AC_ARG_WITH(postgresql,
[ --with-postgresql Link against PostgreSQL client libraries],
[AC_DEFINE_UNQUOTED(USE_POSTGRESQL, , USE_POSTGRESQL)
AC_SUBST(LIBPOSTGRESQL_LIBADD, "-lpq")
AM_CONDITIONAL(USE_POSTGRESQL, true)],
[ AC_SUBST(LIBPOSTGRESQL_LIBADD, "")])
AM_CONDITIONAL(USE_MAXMIND_GEOIP, false)
AC_ARG_WITH(geoip,
[ --with-geoip Link against MaxMind GeoIP libraries],
[AC_DEFINE_UNQUOTED(USE_MAXMIND_GEOIP, , USE_MAXMIND_GEOIP)
AC_SUBST(LIBGEOIP_LIBADD, "-lGeoIP")
AM_CONDITIONAL(USE_MAXMIND_GEOIP, true)],
[ AC_SUBST(LIBGEOIP_LIBADD, "")])
AM_CONDITIONAL(USE_RADIUS_CLIENT, false)
AC_SUBST(LIBRADIUS_LIBADD, "")
AC_ARG_WITH(radius,
[ --with-radius Link against RADIUS client libraries (ng)],
[AC_DEFINE_UNQUOTED(USE_RADIUS_CLIENT, , USE_RADIUS_CLIENT)
AC_SUBST(LIBRADIUS_LIBADD, "-lradiusclient-ng")
AM_CONDITIONAL(USE_RADIUS_CLIENT, true)])
AC_ARG_WITH(freeradius,
[ --with-freeradius Link against FreeRADIUS client libraries],
[AC_DEFINE_UNQUOTED(USE_RADIUS_CLIENT, , USE_RADIUS_CLIENT)
AC_DEFINE_UNQUOTED(RESIP_HAVE_FREERADIUS_CLIENT, , RESIP_HAVE_FREERADIUS_CLIENT)
AC_SUBST(LIBRADIUS_LIBADD, "-lfreeradius-client")
AM_CONDITIONAL(USE_RADIUS_CLIENT, true)])
AC_ARG_WITH(radcli,
[ --with-radcli Link against radcli RADIUS client library],
[AC_DEFINE_UNQUOTED(USE_RADIUS_CLIENT, , USE_RADIUS_CLIENT)
AC_DEFINE_UNQUOTED(RESIP_HAVE_RADCLI, , RESIP_HAVE_RADCLI)
AC_SUBST(LIBRADIUS_LIBADD, "-lradcli")
AM_CONDITIONAL(USE_RADIUS_CLIENT, true)])
AM_CONDITIONAL(USE_NETSNMP, false)
AC_ARG_WITH(netsnmp,
[ --with-netsnmp Link against NetSNMP client libraries],
[AC_DEFINE_UNQUOTED(USE_NETSNMP, , USE_NETSNMP)
AC_SUBST(LIBNETSNMP_LDADD, [`net-snmp-config --agent-libs`])
AM_CONDITIONAL(USE_NETSNMP, true)],
[ AC_SUBST(LIBNETSNMP_LDADD, "")])
AM_CONDITIONAL(BUILD_REPRO, false)
AC_ARG_WITH(repro,
[ --with-repro Build repro, requires CAJUN and bdb],
[AC_DEFINE_UNQUOTED(BUILD_REPRO, , BUILD_REPRO)
AM_CONDITIONAL(BUILD_REPRO, true)], )
AC_ARG_ENABLE(repro-plugins,
[ --enable-repro-plugins Enable support for DSO plugins in repro],
[AC_DEFINE_UNQUOTED(REPRO_DSO_PLUGINS, , REPRO_DSO_PLUGINS)
AM_CONDITIONAL(BUILD_REPRO_DSO_PLUGINS, true)],
AM_CONDITIONAL(BUILD_REPRO_DSO_PLUGINS, false))
AC_SUBST([reproplugindir])
reproplugindir='${pkglibdir}/repro/plugins'
AC_SUBST([returnpkglibdir])
returnpkglibdir='${pkglibdir}/reTurnServer'
AM_CONDITIONAL(BUILD_RETURN, false)
AC_ARG_WITH(return,
[ --with-return Build reTurn client and server],
[AC_DEFINE_UNQUOTED(BUILD_RETURN, , BUILD_RETURN)
AM_CONDITIONAL(BUILD_RETURN, true)], )
AM_CONDITIONAL(BUILD_REND, false)
AC_ARG_WITH(rend,
[ --with-rend Build rend],
[AC_DEFINE_UNQUOTED(BUILD_REND, , BUILD_REND)
AM_CONDITIONAL(BUILD_REND, true)], )
AM_CONDITIONAL(BUILD_TFM, false)
AC_ARG_WITH(tfm,
[ --with-tfm Build TFM, links against Netxx and cppunit],
[AC_DEFINE_UNQUOTED(BUILD_TFM, , BUILD_TFM)
AM_CONDITIONAL(BUILD_TFM, true)], )
AM_CONDITIONAL(BUILD_APPS, false)
AC_ARG_WITH(apps,
[ --with-apps Build apps, links against various things],
[AC_DEFINE_UNQUOTED(BUILD_APPS, , BUILD_APPS)
AM_CONDITIONAL(BUILD_APPS, true)], )
AM_CONDITIONAL(BUILD_ICHAT_GW, false)
AC_ARG_WITH(ichat-gw,
[ --with-ichat-gw Build iChat gateway, links against gloox],
[AC_DEFINE_UNQUOTED(BUILD_ICHAT_GW, , BUILD_ICHAT_GW)
AM_CONDITIONAL(BUILD_ICHAT_GW, true)], )
AM_CONDITIONAL(BUILD_TELEPATHY_CM, false)
AC_ARG_WITH(telepathy,
[ --with-telepathy Build the Telepathy Connection Manager],
[AC_DEFINE_UNQUOTED(BUILD_TELEPATHY_CM, , BUILD_TELEPATHY_CM)
AM_CONDITIONAL(BUILD_TELEPATHY_CM, true)
PKG_CHECK_MODULES([QT5], [Qt5Core, Qt5DBus Qt5Network])
PKG_CHECK_MODULES([TP_QT5], [TelepathyQt5, TelepathyQt5Service])])
AM_CONDITIONAL(BUILD_RECON, false)
AC_ARG_WITH(recon,
[ --with-recon Build recon],
[AC_DEFINE_UNQUOTED(BUILD_RECON, , BUILD_RECON)
AM_CONDITIONAL(BUILD_RECON, true)], )
AM_CONDITIONAL(USE_SRTP1, false)
AC_ARG_WITH(srtp1,
[ --with-srtp1 Use srtp 1.x instead of current version],
[AC_DEFINE_UNQUOTED(USE_SRTP1, , USE_SRTP1)
AM_CONDITIONAL(USE_SRTP1, true)], )
AM_CONDITIONAL(USE_SIPXTAPI, false)
AC_ARG_WITH(sipxtapi,
[ --with-sipxtapi Build recon with sipXtapi support],
[AC_DEFINE_UNQUOTED(USE_SIPXTAPI, , USE_SIPXTAPI)
AM_CONDITIONAL(USE_SIPXTAPI, true)], )
AM_CONDITIONAL(RECON_LOCAL_HW_TESTS, false)
AC_ARG_ENABLE(recon-local-hw-tests,
[ --enable-recon-local-hw-tests Attempt to use local audio hardware in unit tests],
[AC_DEFINE_UNQUOTED(RECON_LOCAL_HW_TESTS, , RECON_LOCAL_HW_TESTS)
AM_CONDITIONAL(RECON_LOCAL_HW_TESTS, true)
], )
AM_CONDITIONAL(BUILD_P2P, false)
AC_ARG_WITH(p2p,
[ --with-p2p Build P2P, links against S2C and SSL, unfinished],
[AC_DEFINE_UNQUOTED(BUILD_P2P, , BUILD_P2P)
AM_CONDITIONAL(BUILD_P2P, true)], )
AM_CONDITIONAL(BUILD_PYTHON, false)
AC_ARG_WITH(python,
[ --with-python Build components requiring Python],
[AC_DEFINE_UNQUOTED(BUILD_PYTHON, , BUILD_PYTHON)
AM_CONDITIONAL(BUILD_PYTHON, true)
PKG_CHECK_MODULES([DEPS_PYTHON], [python3 >= 3.6])
AC_SUBST(DEPS_PYTHON_VERSION)
AC_SUBST(PYCXX_SRCDIR)
if [ ! test -e "${PYCXX_SRCDIR}/cxx_extensions.cxx" ];
then
echo "Can't find \${PYCXX_SRCDIR}/cxx_extensions.cxx"
echo "Please check PYCXX_SRCDIR is defined correctly (current value: ${PYCXX_SRCDIR})"
exit 1
fi
], )
AM_CONDITIONAL(BUILD_QPID_PROTON, false)
AC_ARG_WITH(qpid-proton,
[ --with-qpid-proton Build components requiring qpid-proton (AMQP)],
[AC_DEFINE_UNQUOTED(BUILD_QPID_PROTON, , BUILD_QPID_PROTON)
AM_CONDITIONAL(BUILD_QPID_PROTON, true)], )
AM_CONDITIONAL(RESIP_ASSERT_SYSLOG, false)
AC_ARG_ENABLE(assert-syslog,
[ --enable-assert-syslog Log assertion failures with Syslog],
[AC_DEFINE_UNQUOTED(RESIP_ASSERT_SYSLOG, , RESIP_ASSERT_SYSLOG)
AM_CONDITIONAL(RESIP_ASSERT_SYSLOG, true)
], )
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(socket, socket)
#Used to look for realtime library requirement (-lrt)
CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
AX_HAVE_EPOLL(
[AC_DEFINE_UNQUOTED(HAVE_EPOLL, 1, HAVE_EPOLL)], )
AC_CHECK_LIB(dl, dlopen)
AM_CONDITIONAL(HAVE_LIBDL, [test x"$ac_cv_lib_dl_dlopen" = xyes])
AM_CONDITIONAL(BUILD_GSTREAMER, false)
AC_ARG_WITH(gstreamer,
[ --with-gstreamer Build components requiring GStreamer],
[AC_DEFINE_UNQUOTED(BUILD_GSTREAMER, , BUILD_GSTREAMER)
AM_CONDITIONAL(BUILD_GSTREAMER, true)
PKG_CHECK_MODULES([GSTREAMERMM_1_0], [gstreamermm-1.0])
], )
AM_MAINTAINER_MODE
AC_OUTPUT(Makefile \
rutil/dns/ares/Makefile \
rutil/Makefile \
rutil/test/Makefile \
resip/Makefile \
resip/stack/Makefile \
resip/stack/test/Makefile \
resip/dum/Makefile \
resip/dum/test/Makefile \
resip/certs/Makefile \
resip/rend/Makefile \
repro/Makefile \
repro/accountingconsumers/Makefile \
repro/reprocmd/Makefile \
repro/test/Makefile \
repro/plugins/Makefile \
repro/plugins/example/Makefile \
repro/plugins/pyroute/Makefile \
tfm/Makefile \
tfm/repro/Makefile \
tfm/tfdum/Makefile \
apps/Makefile \
apps/clicktocall/Makefile \
apps/clicktocall/test/Makefile \
apps/echoTest/Makefile \
apps/ichat-gw/Makefile \
apps/ichat-gw/jabberconnector/Makefile \
apps/sipdial/Makefile \
apps/telepathy/Makefile \
apps/telepathy/data/Makefile \
apps/registration-agent/Makefile \
apps/reConServer/Makefile \
resiprocate.spec \
reTurn/Makefile \
reTurn/test/Makefile \
reTurn/client/Makefile \
reTurn/client/test/Makefile \
reflow/Makefile \
reflow/dtls_wrapper/test/Makefile \
resip/recon/Makefile \
resip/recon/MOHParkServer/Makefile \
resip/recon/test/Makefile \
p2p/s2c/s2c/Makefile \
p2p/Makefile \
)