-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
312 lines (274 loc) · 13.3 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
#
# Copyright (C) 2012-2013 Mamadou DIOP
# Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
# License: GPLv3 or commercial
# This file is part of webrtc2sip project <https://code.google.com/p/webrtc2sip/>
#
AC_PREREQ([2.0])
AC_INIT(webrtc2sip, 2.0.0, doubango[at]googlegroups(dot)com)
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([mp_mediaproxy.cc])
dnl find suitable C and C++ compilers
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_SED
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
# DOUBANGO MINI REQUIRED VERSION
AC_SUBST(DOUBANGO_MINVER, 2.0.1089)
#echo Setting up build environment for ${target_cpu}${target_os}
### ENABLE-DEBUG
AC_MSG_CHECKING(whether to enable debugging)
debug_default="no"
AC_ARG_ENABLE(debug,
[ --enable-debug[=no/yes] turn on/off debugging
[[default=$debug_default]]],
[ if test "x$enableval" = "xyes" ; then
CFLAGS="$CFLAGS -O0 -g3 -DDEBUG"
AC_MSG_RESULT(yes)
else
CFLAGS="$CFLAGS -O3 -NDEBUG"
AC_MSG_RESULT(no)
fi
],
[])
### DEBUG-LEVEL: could be updated using config.xml
AC_ARG_WITH(debug-level,
[ --with-debug-level[=level] Set debug-level to level [[default=info]]
info: informational
warn: warnings
error [default]: errors
fatal: fatal],
[ if test "x$withval" = "xinfo" ; then
AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [info debug])
AC_MSG_RESULT(info)
elif test "x$withval" = "xwarn" ; then
AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [warn debug])
AC_MSG_RESULT(warn)
elif test "x$withval" = "xerror" ; then
AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_ERROR, [error debug])
AC_MSG_RESULT(error)
elif test "x$withval" = "xfatal" ; then
AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_FATAL, [fatal debug])
AC_MSG_RESULT(fatal)
fi
])
AC_CHECK_LIB(c, dlopen, AC_SUBST(LIBDL,""), AC_CHECK_LIB(dl, dlopen, AC_SUBST(LIBDL,-ldl)))
AH_TEMPLATE([HAVE_DNS_H], [Define if <dns.h> header exist])
AC_CHECK_HEADER([dns.h], AC_DEFINE(HAVE_DNS_H, 1), AC_DEFINE(HAVE_DNS_H, 0), [])
AH_TEMPLATE([TNET_HAVE_SS_LEN], [Define if sockaddr_storage.ss_len exists])
AC_CHECK_MEMBER([struct sockaddr_storage.ss_len], AC_DEFINE(TNET_HAVE_SS_LEN, 1), AC_DEFINE(TNET_HAVE_SS_LEN,0), [#include <sys/socket.h>])
AH_TEMPLATE([TNET_HAVE_SA_LEN], [Define if sockaddr.sa_len exists])
AC_CHECK_MEMBER([struct sockaddr.sa_len], AC_DEFINE(TNET_HAVE_SA_LEN, 1), AC_DEFINE(TNET_HAVE_SA_LEN, 0), [#include <netinet/in.h>])
###########
# DOUBANGO
###########
AC_SUBST(have_tinysak, no)
AC_SUBST(have_tinynet, no)
AC_SUBST(have_tinyhttp, no)
AC_SUBST(have_tinysip, no)
AC_SUBST(have_tinydav, no)
AC_SUBST(have_tinysdp, no)
AC_SUBST(have_tinybfcp, no)
AC_SUBST(have_tinysigcomp, no)
AC_SUBST(have_tinymedia, no)
AC_SUBST(have_tinyxcap, no)
AC_SUBST(have_tinysms, no)
AC_SUBST(have_tinymsrp, no)
AC_SUBST(have_tinyrtp, no)
AC_SUBST(have_tinyipsec, no)
PKG_CHECK_MODULES(TINYSAK, tinySAK >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinysak, yes), AC_MSG_WARN(Cannot find tinySAK >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYNET, tinyNET >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinynet, yes), AC_MSG_WARN(Cannot find tinyNET >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYHTTP, tinyHTTP >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinyhttp, yes), AC_MSG_WARN(Cannot find tinyHTTP >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYSIP, tinySIP >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinysip, yes), AC_MSG_WARN(Cannot find tinySIP >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYDAV, tinyDAV >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinydav, yes), AC_MSG_WARN(Cannot find tinyDAV >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYSDP, tinySDP >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinysdp, yes), AC_MSG_WARN(Cannot find tinySDP >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYBFCP, tinyBFCP >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinybfcp, yes), AC_MSG_WARN(Cannot find tinyBFCP >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYSIGCOMP, tinySIGCOMP >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinysigcomp, yes), AC_MSG_WARN(Cannot find tinySIGCOMP >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYMEDIA, tinyMEDIA >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinymedia, yes), AC_MSG_WARN(Cannot find tinyMEDIA >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYXCAP, tinyXCAP >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinyxcap, yes), AC_MSG_WARN(Cannot find tinyxcap >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYSMS, tinySMS >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinysms, yes), AC_MSG_WARN(Cannot find tinySMS >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYMSRP, tinyMSRP >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinymsrp, yes), AC_MSG_WARN(Cannot find tinyMSRP >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYRTP, tinyRTP >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinyrtp, yes), AC_MSG_WARN(Cannot find tinyRTP >= ${DOUBANGO_MINVER} using pkg-config))
PKG_CHECK_MODULES(TINYIPSEC, tinyIPSec >= ${DOUBANGO_MINVER}, AC_SUBST(have_tinyipsec, yes), AC_MSG_WARN(Cannot find tinyIPSec >= ${DOUBANGO_MINVER} using pkg-config))
if test $have_tinysak:$have_tinynet:$have_tinyhttp:$have_tinysip:$have_tinydav:$have_tinysdp:$have_tinybfcp:$have_tinysigcomp:$have_tinymedia:$have_tinyxcap:$have_tinysms:$have_tinymsrp:$have_tinyrtp:$have_tinyipsec != yes:yes:yes:yes:yes:yes:yes:yes:yes:yes:yes:yes:yes:yes ; then
AC_MSG_WARN([
***
*** Failed to find all DOUBANGO libraries using pkg-config.
*** This most likely means the DOUBANGO pkg files (*.pc) are not
*** in the default path where pkg-config expect them.
***
*** Please set your PKG_CONFIG_PATH environment variable to include the
*** directory in which the *.pc files are installed. Most likely
*** these files are installed in /usr/local/lib/pkgconfig; if that is the
*** case, try:
***
*** export PKG_CONFIG_PATH="\$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
***
*** then run this ./configure <your options here> again.
***
*** or, try:
***
*** PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure <your options here>
***
*** Anyways, we're trying another way to find DOUBANGO.
***
]);
AC_SUBST(DOUBANGO_INCLUDES_PATH,/usr/local/include)
AC_SUBST(DOUBANGO_LIBS_FALLBACK,-L/usr/local/lib)
AC_SUBST(TINYSAK_LIBS,-ltinySAK) AC_SUBST(TINYSAK_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinysak)
AC_SUBST(TINYNET_LIBS,-ltinyNET) AC_SUBST(TINYNET_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinynet)
AC_SUBST(TINYHTTP_LIBS,-ltinyHTTP) AC_SUBST(TINYHTTP_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinyhttp)
AC_SUBST(TINYSIP_LIBS,-ltinySIP) AC_SUBST(TINYSIP_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinysip)
AC_SUBST(TINYDAV_LIBS,-ltinyDAV) AC_SUBST(TINYDAV_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinydav)
AC_SUBST(TINYSDP_LIBS,-ltinySDP) AC_SUBST(TINYSDP_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinysdp)
AC_SUBST(TINYBFCP_LIBS,-ltinyBFCP) AC_SUBST(TINYBFCP_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinybfcp)
AC_SUBST(TINYSIGCOMP_LIBS,-ltinySIGCOMP) AC_SUBST(TINYSIGCOMP_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinysigcomp)
AC_SUBST(TINYMEDIA_LIBS,-ltinyMEDIA) AC_SUBST(TINYMEDIA_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinymedia)
AC_SUBST(TINYXCAP_LIBS,-ltinyXCAP) AC_SUBST(TINYXCAP_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinyxcap)
AC_SUBST(TINYSMS_LIBS,-ltinySMS) AC_SUBST(TINYSMS_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinysms)
AC_SUBST(TINYMSRP_LIBS,-ltinyMSRP) AC_SUBST(TINYMSRP_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinymsrp)
AC_SUBST(TINYRTP_LIBS,-ltinyRTP) AC_SUBST(TINYRTP_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinyrtp)
AC_SUBST(TINYIPSEC_LIBS,-ltinyIPSec) AC_SUBST(TINYIPSEC_CFLAGS,-I${DOUBANGO_INCLUDES_PATH}/tinyipsec)
fi
if test $have_tinysak != yes; then
AC_CHECK_HEADERS(tinysak/tinysak_config.h,
AC_CHECK_LIB(tinySAK, tsk_object_new, AC_SUBST(have_tinysak, yes), AC_MSG_ERROR(Failed to find libtinySAK), [${LIBDL}])
)
fi
if test $have_tinynet != yes; then
AC_CHECK_HEADERS(tinynet/tinynet_config.h,
AC_CHECK_LIB(tinyNET, tnet_startup, AC_SUBST(have_tinynet, yes), AC_MSG_ERROR(Failed to find libtinyNET), [-ltinySAK ${LIBDL}])
)
fi
if test $have_tinyhttp != yes; then
AC_CHECK_HEADERS(tinyhttp/tinyhttp_config.h,
AC_CHECK_LIB(tinyHTTP, thttp_stack_create, AC_SUBST(have_tinyhttp, yes), AC_MSG_ERROR(Failed to find libtinyHTTP), [-ltinySAK -ltinyNET ${LIBDL}])
)
fi
if test $have_tinysip != yes; then
AC_CHECK_HEADERS(tinysip/tinysip_config.h,
AC_CHECK_LIB(tinySIP, tsip_stack_create, AC_SUBST(have_tinysip, yes), AC_MSG_ERROR(Failed to find libtinySIP), [-ltinySAK -ltinyNET -ltinyHTTP -ltinyIPSec -ltinySDP -ltinyMEDIA -ltinySIGCOMP ${LIBDL} -lm])
)
fi
if test $have_tinydav != yes; then
AC_CHECK_HEADERS(tinydav/tinydav_config.h,
AC_CHECK_LIB(tinyDAV, tdav_init, AC_SUBST(have_tinydav, yes), AC_MSG_ERROR(Failed to find libtinyDAV), [-ltinySAK -ltinyNET -ltinySDP -ltinyRTP -ltinyMEDIA -ltinyMSRP ${LIBDL}])
)
fi
if test $have_tinysdp != yes; then
AC_CHECK_HEADERS(tinysdp/tinysdp_config.h,
AC_CHECK_LIB(tinySDP, tsdp_message_create, AC_SUBST(have_tinysdp, yes), AC_MSG_ERROR(Failed to find libtinySDP), [-ltinySAK ${LIBDL}])
)
fi
if test $have_tinybfcp != yes; then
AC_CHECK_HEADERS(tinybfcp/tinybfcp_config.h,
AC_CHECK_LIB(tinyBFCP, tbfcp_pkt_create, AC_SUBST(have_tinybfcp, yes), AC_MSG_ERROR(Failed to find libtinyBFCP), [-ltinySAK -ltinyNET ${LIBDL}])
)
fi
if test $have_tinysigcomp != yes; then
AC_CHECK_HEADERS(tinysigcomp/tinysigcomp_config.h,
AC_CHECK_LIB(tinySIGCOMP, tcomp_manager_create, AC_SUBST(have_tinysigcomp, yes), AC_MSG_ERROR(Failed to find libtinySIGCOMP), [-ltinySAK ${LIBDL} -lm])
)
fi
if test $have_tinymedia != yes; then
AC_CHECK_HEADERS(tinymedia/tinymedia_config.h,
AC_CHECK_LIB(tinyMEDIA, tmedia_session_mgr_create, AC_SUBST(have_tinymedia, yes), AC_MSG_ERROR(Failed to find libtinyMEDIA), [-ltinySAK -ltinyNET -ltinySDP ${LIBDL}])
)
fi
if test $have_tinyxcap != yes; then
AC_CHECK_HEADERS(tinyxcap/tinyxcap_config.h,
AC_CHECK_LIB(tinyXCAP, txcap_stack_create, AC_SUBST(have_tinyxcap, yes), AC_MSG_ERROR(Failed to find libtinyXCAP), [-ltinySAK -ltinyHTTP -ltinyNET ${LIBDL}])
)
fi
if test $have_tinysms != yes; then
AC_CHECK_HEADERS(tinysms/tinysms_config.h,
AC_CHECK_LIB(tinySMS, tsms_tpdu_message_init, AC_SUBST(have_tinysms, yes), AC_MSG_ERROR(Failed to find libtinySMS), [-ltinySAK ${LIBDL}])
)
fi
if test $have_tinymsrp != yes; then
AC_CHECK_HEADERS(tinymsrp/tinymsrp_config.h,
AC_CHECK_LIB(tinyMSRP, tmsrp_create_report, AC_SUBST(have_tinymsrp, yes), AC_MSG_ERROR(Failed to find libtinyMSRP), [-ltinySAK -ltinyNET -ltinySDP -ltinyHTTP ${LIBDL}])
)
fi
if test $have_tinyrtp != yes; then
AC_CHECK_HEADERS(tinyrtp/tinyrtp_config.h,
AC_CHECK_LIB(tinyRTP, trtp_manager_create, AC_SUBST(have_tinyrtp, yes), AC_MSG_ERROR(Failed to find libtinyRTP), [-ltinySAK -ltinyNET -ltinyMEDIA ${LIBDL}])
)
fi
if test $have_tinyipsec != yes; then
AC_CHECK_HEADERS(tinyipsec/tinyipsec_config.h,
AC_CHECK_LIB(tinyIPSec, tipsec_ctx_create, AC_SUBST(have_tinyipsec, yes) , AC_MSG_ERROR(Failed to find libtinyIPSec), [-ltinySAK ${LIBDL}])
)
fi
#############
# LIBXML2
#############
AC_SUBST(LIBXML2_INCLUDE, "/usr/include/libxml2")
AC_SUBST(LIBXML2_LIB, "/usr/lib")
AC_MSG_CHECKING([for libxml2])
AC_ARG_WITH([libxml2], [AC_HELP_STRING([--with-libxml2=PATH], [path to installed libxml2 [default=/usr]])], [
LIBXML2_INCLUDE="${withval}/include/libxml2"
LIBXML2_LIB="${withval}/lib"
AC_MSG_RESULT("${withval}")
], [
LIBXML2_INCLUDE="/usr/include/libxml2"
LIBXML2_LIB="/usr/lib"
AC_MSG_RESULT(/usr)
])
##########
# PTHREAD
##########
AC_SUBST(LIBPTHREAD_INCLUDE, "/usr/include")
AC_SUBST(LIBPTHREAD_LIB, "/usr/lib")
AC_MSG_CHECKING([for libpthread])
AC_ARG_WITH([libpthread], [AC_HELP_STRING([--with-libpthread=PATH], [path to installed libpthread [default=/usr]])], [
LIBPTHREAD_INCLUDE="${withval}/include"
LIBPTHREAD_LIB="${withval}/lib"
AC_MSG_RESULT("${withval}")
], [
LIBPTHREAD_INCLUDE="/usr/include"
LIBPTHREAD_LIB="/usr/lib"
AC_MSG_RESULT(/usr)
])
AC_OUTPUT(
Makefile
)
AC_MSG_NOTICE([
**************************************************************************
CONGRATULATIONS
**************************************************************************
Host setup: ${host}
Install prefix: ${prefix}
Compiler: ${CC}
DOUBANGO
MIN_VER: ${DOUBANGO_MINVER}
TINYSAK: ${have_tinysak}
TINYNET: ${have_tinynet}
TINYHTTP: ${have_tinyhttp}
TINYSIP: ${have_tinysip}
TINYDAV: ${have_tinydav}
TINYSDP: ${have_tinysdp}
TINYBFCP: ${have_tinybfcp}
TINYSIGCOMP: ${have_tinysigcomp}
TINYMEDIA: ${have_tinymedia}
TINYMEDIA: ${have_tinyxcap}
TINYSMS: ${have_tinysms}
TINYMSRP: ${have_tinymsrp}
TINYRTP: ${have_tinyrtp}
TINYIPSEC: ${have_tinyipsec}
LIBXML2_INCLUDE: ${LIBXML2_INCLUDE}
LIBXML2_LIB: ${LIBXML2_LIB}
LIBPTHREAD_INCLUDE: ${LIBPTHREAD_INCLUDE}
LIBPTHREAD_LIB: ${LIBPTHREAD_LIB}
Report issues at https://groups.google.com/group/doubango
-------------------------------------------------------------------------
Next steps
1) run 'make' to build the source
2) run 'make install' to install
-------------------------------------------------------------------------
])