forked from resiprocate/resiprocate
-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
384 lines (327 loc) · 11.9 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
AC_INIT(resiprocate,1.11.0~beta2)
AC_CONFIG_SRCDIR(repro/repro.cxx)
SO_RELEASE=`echo $PACKAGE_VERSION | cut -f1,2 -d.`
AC_SUBST(SO_RELEASE)
#LIBTOOL_VERSION_RELEASE="-version-info 0:0:0 -release @SO_RELEASE@"
LIBTOOL_VERSION_RELEASE="-release $SO_RELEASE"
AC_SUBST(LIBTOOL_VERSION_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_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
OSVER=`uname -r | tr '()/' " " | cut -f1 -d-`.0.0.0
OS_MAJOR_VER=`echo $OSVER | cut -f1 -d.`
OS_MINOR_VER=`echo $OSVER | cut -f2 -d.`
OS_POINT_VER=`echo $OSVER | cut -f3 -d.`
OS_PATCH_VER=`echo $OSVER | cut -f4 -d.`
AC_DEFINE_UNQUOTED(OS_MAJOR_VER, $OS_MAJOR_VER)
AH_TEMPLATE([OS_MAJOR_VER], [Major OS version])
AC_DEFINE_UNQUOTED(OS_MINOR_VER, $OS_MINOR_VER)
AH_TEMPLATE([OS_MINOR_VER], [Minor OS version])
AC_DEFINE_UNQUOTED(OS_POINT_VER, $OS_POINT_VER)
AH_TEMPLATE([OS_POINT_VER], [Point OS version])
AC_DEFINE_UNQUOTED(OS_PATCH_VER, $OS_PATCH_VER)
AH_TEMPLATE([OS_PATCH_VER], [Patch OS version])
TOOLCHAIN_CPPFLAGS="-DRESIP_TOOLCHAIN_GNU"
case $host_os in
solaris*)
# CXXFLAGS="$CXXFLAGS -library=stlport4"
# CFLAGS="-mt"
# LDFLAGS="$LDFLAGS -DTHREAD=MULTI -mt -library=stlport4"
TOOLCHAIN_CPPFLAGS="-DRESIP_TOOLCHAIN_SUNPRO"
;;
*)
;;
esac
OSTYPE=`uname`
case $OSTYPE in
solaris*)
OSTYPE=SunOS
;;
freebsd*)
OSTYPE=FreeBSD
;;
linux*)
OSTYPE=Linux
;;
darwin*)
OSTYPE=Darwin
;;
msys*)
OSTYPE=MinGW
;;
MINGW*)
OSTYPE=MinGW
;;
*)
echo "Using native OSTYPE value: $OSTYPE"
;;
esac
ARCH=$host_cpu
case $host_cpu in
x86_64)
# LARCH=IA64
;;
i?86)
LARCH=IA32
;;
*)
LARCH="$host_cpu"
echo "Using native ARCH/LARCH value from \$host_cpu: $host_cpu"
;;
esac
OSTYPE_UPPER=`echo $OSTYPE | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
ARCH_UPPER=`echo $host_cpu | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
LARCH_UPPER=`echo $LARCH | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
ARCH_CPPFLAGS="-DRESIP_OSTYPE_${OSTYPE_UPPER} -DRESIP_ARCH_${ARCH_UPPER} -DRESIP_LARCH_${LARCH_UPPER} -D_REENTRANT"
AC_C_BIGENDIAN([AC_DEFINE_UNQUOTED(RESIP_BIG_ENDIAN, , RESIP_BIG_ENDIAN)])
CPPFLAGS="${CPPFLAGS} ${ARCH_CPPFLAGS} ${TOOLCHAIN_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`pwd`/rutil/dns/ares"
LDFLAGS="$LDFLAGS -L`pwd`/rutil/dns/ares"
AC_SUBST(LIBARES_LIBADD, "`pwd`/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), )
AC_ARG_ENABLE(android,
[ --enable-android Enable Android build],
[AC_SUBST(LIBPTHREAD_LIBADD, "")
AC_SUBST(LIBLOG_LIBADD, "-llog")
AC_SUBST(LIBSTL_LIBADD, "-lgnustl_shared")],
[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, "")])
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(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_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, links against sipX],
[AC_DEFINE_UNQUOTED(BUILD_RECON, , BUILD_RECON)
AM_CONDITIONAL(BUILD_RECON, 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], [python >= 2.7])
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, ,HAVE_EPOLL)], )
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/ichat-gw/Makefile \
apps/ichat-gw/jabberconnector/Makefile \
apps/sipdial/Makefile \
apps/telepathy/Makefile \
apps/telepathy/data/Makefile \
resiprocate.spec \
reTurn/Makefile \
reTurn/test/Makefile \
reTurn/client/Makefile \
reTurn/client/test/Makefile \
reflow/Makefile \
resip/recon/Makefile \
resip/recon/MOHParkServer/Makefile \
resip/recon/test/Makefile \
p2p/s2c/s2c/Makefile \
p2p/Makefile \
)