]> git.ipfire.org Git - thirdparty/freeswitch.git/blame - configure.ac
FS-6500: use correct type in ftdm callback
[thirdparty/freeswitch.git] / configure.ac
CommitLineData
4da77ea5
AM
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
8ef2aa54
MJ
4# Must change all of the below together
5# For a release, set revision for that tagged release as well and uncomment
674a9984 6AC_INIT([freeswitch], [1.5.12b], bugs@freeswitch.org)
8ef2aa54 7AC_SUBST(SWITCH_VERSION_MAJOR, [1])
308a8396 8AC_SUBST(SWITCH_VERSION_MINOR, [5])
674a9984 9AC_SUBST(SWITCH_VERSION_MICRO, [12b])
a330febb
KR
10AC_SUBST(SWITCH_VERSION_REVISION, [])
11AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])
8ef2aa54
MJ
12
13AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template])
7a5bc3b7 14
e8b9a4f7 15AC_CONFIG_AUX_DIR(build/config)
2513388d 16AM_INIT_AUTOMAKE
b324e263 17m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
4da77ea5 18AC_CONFIG_SRCDIR([src/switch.c])
42e78242 19AC_CONFIG_HEADER([src/include/switch_private.h])
8574988c 20AC_CONFIG_HEADER([libs/esl/src/include/esl_config_auto.h])
4062b636 21AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h])
42e78242 22
a642381f 23AC_PREFIX_DEFAULT(/usr/local/freeswitch)
94206d80
MJ
24# AC_PREFIX_DEFAULT does not get expanded until too late so we need to do this to use prefix in this script
25if test "x$prefix" = "xNONE" ; then
26 prefix='/usr/local/freeswitch'
27fi
55b3e6cb 28
31d1e20f
BW
29AC_CANONICAL_HOST
30
55b3e6cb
MJ
31# Absolute source/build directory
32switch_srcdir=`(cd $srcdir && pwd)`
33switch_builddir=`pwd`
34AC_SUBST(switch_srcdir)
35AC_SUBST(switch_builddir)
36
6452f12b
BW
37#
38# --enable-64 has been moved up higher prior to AC_PROG_CC so that we can tuck in the -m64 flag
39# so devs on with Solaris wanting to build 64bit can not bother with adding any additional
40# flags on the ./configure line. User friendly.
41#
42
43# Enable 64 bit build
44AC_ARG_ENABLE(64,
45[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
46
47if test "${enable_64}" = "yes"; then
48 case "$host" in
49 *-solaris2*)
50 # All three have to have -m64 for AC_PROG_CC to pick the right libtool
51 CFLAGS="$CFLAGS -m64"
52 LDFLAGS="$LDFLAGS -m64"
53 CXXFLAGS="$CXXFLAGS -m64"
54 ;;
55 *)
56 ;;
57 esac
58fi
59
f5ecbc84
TC
60# Whether to follow FHS
61AC_ARG_ENABLE([fhs],
62 [AS_HELP_STRING([--enable-fhs],
63 [Follow the FHS when placing files and directories])],,
64 [enable_fhs="no"])
65AM_CONDITIONAL([ENABLE_FHS],[test "${enable_fhs}" = "yes"])
1481d37f 66
88aa159b
MJ
67if test "$localstatedir" = "\${prefix}/var" ; then
68 rundir="$prefix/run"
7ae3f5b7 69 logdir="${prefix}/log"
88aa159b
MJ
70else
71 rundir="$localstatedir/run/freeswitch"
7ae3f5b7 72 logdir="$localstatedir/log/freeswitch"
88aa159b 73fi
f5ecbc84
TC
74
75default_certsdir="$prefix/certs"
76default_dbdir="$prefix/db"
77default_grammardir="$prefix/grammar"
78default_htdocsdir="$prefix/htdocs"
79default_logfiledir="$logdir"
80default_modulesdir="$prefix/mod"
81default_pkgconfigdir="$libdir/pkgconfig"
82default_recordingsdir="$prefix/recordings"
83default_runtimedir="$rundir"
84default_scriptdir="$prefix/scripts"
85default_soundsdir="$prefix/sounds"
86default_storagedir="$prefix/storage"
87
88if test "$enable_fhs" = yes; then
b04bbc6c
TC
89 prefix="/usr" exec_prefix="$prefix"
90 libdir="$(eval echo "$libdir")"
ab350968 91 sysconfdir="/etc/freeswitch"
f5ecbc84
TC
92 localstatedir="/var"
93 default_certsdir="/etc/freeswitch/tls"
94 default_dbdir="/var/lib/freeswitch/db"
95 default_grammardir="/usr/share/freeswitch/grammar"
96 default_htdocsdir="/usr/share/freeswitch/htdocs"
97 default_logfiledir="/var/log/freeswitch"
98 default_modulesdir="$libdir/freeswitch/mod"
99 default_pkgconfigdir="$libdir/pkgconfig"
100 default_recordingsdir="/var/lib/freeswitch/recordings"
101 default_runtimedir="/var/run/freeswitch"
102 default_scriptdir="/usr/share/freeswitch/scripts"
103 default_soundsdir="/usr/share/freeswitch/sounds"
104 default_storagedir="/var/lib/freeswitch/storage"
105fi
106
107# Where to install the modules
108AC_ARG_WITH([modinstdir],
109 [AS_HELP_STRING([--with-modinstdir=DIR], [Install modules into this location (default: $prefix/mod)])], [modulesdir="$withval"], [modulesdir="${default_modulesdir}"])
110AC_SUBST(modulesdir)
111AC_DEFINE_UNQUOTED([SWITCH_MOD_DIR],"${modulesdir}",[where to install the modules to])
112
107f9135
MJ
113# Where to put pidfile
114AC_ARG_WITH([rundir],
f5ecbc84 115 [AS_HELP_STRING([--with-rundir=DIR], [Put pidfile into this location (default: $prefix/run)])], [runtimedir="$withval"], [runtimedir="${default_runtimedir}"])
5ccac21d
MJ
116AC_SUBST(runtimedir)
117AC_DEFINE_UNQUOTED([SWITCH_RUN_DIR],"${runtimedir}",[where to put pidfile to])
118
7ae3f5b7 119AC_ARG_WITH([logfiledir],
f5ecbc84 120 [AS_HELP_STRING([--with-logfiledir=DIR], [Put logfiles into this location (default: $localstatedir/log)])], [logfiledir="$withval"], [logfiledir="${default_logfiledir}"])
5ccac21d
MJ
121AC_SUBST(logfiledir)
122AC_DEFINE_UNQUOTED([SWITCH_LOG_DIR],"${logfiledir}",[where to put log files])
107f9135 123
7ae3f5b7 124AC_ARG_WITH([dbdir],
f5ecbc84 125 [AS_HELP_STRING([--with-dbdir=DIR], [Put database files into this location (default: $prefix/db)])], [dbdir="$withval"], [dbdir="${default_dbdir}"])
5ccac21d
MJ
126AC_SUBST(dbdir)
127AC_DEFINE_UNQUOTED([SWITCH_DB_DIR],"${dbdir}",[where to put db files])
128
7ae3f5b7 129AC_ARG_WITH([htdocsdir],
f5ecbc84 130 [AS_HELP_STRING([--with-htdocsdir=DIR], [Put html files into this location (default: $prefix/htdocs)])], [htdocsdir="$withval"], [htdocsdir="${default_htdocsdir}"])
89ae5f47
MJ
131AC_SUBST(htdocsdir)
132AC_DEFINE_UNQUOTED([SWITCH_HTDOCS_DIR],"${htdocsdir}",[where to put htdocs files])
133
7ae3f5b7 134AC_ARG_WITH([soundsdir],
f5ecbc84 135 [AS_HELP_STRING([--with-soundsdir=DIR], [Put sound files into this location (default: $prefix/sounds)])], [soundsdir="$withval"], [soundsdir="${default_soundsdir}"])
d1c60899
MJ
136AC_SUBST(soundsdir)
137AC_DEFINE_UNQUOTED([SWITCH_SOUNDS_DIR],"${soundsdir}",[where to put sounds files])
138
7ae3f5b7 139AC_ARG_WITH([grammardir],
f5ecbc84 140 [AS_HELP_STRING([--with-grammardir=DIR], [Put grammar files into this location (default: $prefix/grammar)])], [grammardir="$withval"], [grammardir="${default_grammardir}"])
89ae5f47
MJ
141AC_SUBST(grammardir)
142AC_DEFINE_UNQUOTED([SWITCH_GRAMMAR_DIR],"${grammardir}",[where to put grammar files])
143
dabb85c3 144AC_ARG_WITH([certsdir],
f5ecbc84 145 [AS_HELP_STRING([--with-certsdir=DIR], [Put certs files into this location (default: $prefix/certs)])], [certsdir="$withval"], [certsdir="${default_certsdir}"])
dabb85c3
AM
146AC_SUBST(certsdir)
147AC_DEFINE_UNQUOTED([SWITCH_CERTS_DIR],"${certsdir}",[where to put certs files])
148
7ae3f5b7 149AC_ARG_WITH([scriptdir],
f5ecbc84 150 [AS_HELP_STRING([--with-scriptdir=DIR], [Put script files into this location (default: $prefix/scripts)])], [scriptdir="$withval"], [scriptdir="${default_scriptdir}"])
5ccac21d
MJ
151AC_SUBST(scriptdir)
152AC_DEFINE_UNQUOTED([SWITCH_SCRIPT_DIR],"${scriptdir}",[where to put script files])
107f9135 153
7ae3f5b7 154AC_ARG_WITH([recordingsdir],
f5ecbc84 155 [AS_HELP_STRING([--with-recordingsdir=DIR], [Put recordings files into this location (default: $prefix/recordings)])], [recordingsdir="$withval"], [recordingsdir="${default_recordingsdir}"])
c064a2a5
MJ
156AC_SUBST(recordingsdir)
157AC_DEFINE_UNQUOTED([SWITCH_RECORDINGS_DIR],"${recordingsdir}",[where to put recording files])
158
f3d851d1 159AC_ARG_WITH([storagedir],
f5ecbc84 160 [AS_HELP_STRING([--with-storagedir=DIR], [Put storage files into this location (default: $prefix/storage)])], [storagedir="$withval"], [storagedir="${default_storagedir}"])
f3d851d1
TC
161AC_SUBST(storagedir)
162AC_DEFINE_UNQUOTED([SWITCH_STORAGE_DIR],"${storagedir}",[where to put storage files])
163
911e4a09
MJ
164if test "$sysconfdir" = "\${prefix}/etc" ; then
165 confdir="$prefix/conf"
166else
167 confdir="$sysconfdir"
168fi
169
5ccac21d
MJ
170sysconfdir="$confdir"
171
911e4a09 172AC_SUBST(confdir)
7da7790b 173AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[directory for configuration files])
911e4a09 174
8b3f71cc
MJ
175AC_SUBST(libdir)
176AC_SUBST(bindir)
177AC_SUBST(includedir)
178
f20ba4d1 179AC_ARG_WITH([pkgconfigdir],
78472897 180 [AS_HELP_STRING([--with-pkgconfigdir=DIR], [Installation directory for pkgconfig file (default: ${libdir}/pkgconfig)])],
f20ba4d1
SK
181 [case "${withval}" in
182 yes|no) AC_MSG_ERROR([Invalid value ${withval} for option --with-pkgconfigdir]) ;;
183 *) pkgconfigdir="${withval}" ;;
184 esac
185 ],
f5ecbc84 186 [pkgconfigdir="${default_pkgconfigdir}"]
f20ba4d1
SK
187)
188AC_SUBST([pkgconfigdir])
189
6bc48b70
MJ
190#Set default language
191AC_LANG_C
4da77ea5
AM
192# Checks for programs.
193AC_PROG_CC
80eec6e5 194AC_PROG_CXX
40f18d30
MJ
195
196#check if the g++ compiler works
197AC_CACHE_CHECK([whether the C++ compiler works], [ac_cv_sys_cxx_works], [
198 AC_LANG_PUSH([C++])
3dd36873 199 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() { }])], [ac_cv_sys_cxx_works=yes],
40f18d30
MJ
200 [ac_cv_sys_cxx_works=no])
201 AC_LANG_POP([C++])
202 ])
203[ if [ "x$ac_cv_sys_cxx_works" = "xno" ]; then ]
204 AC_MSG_FAILURE([The C++ compiler does not work. Please (re)install the C++ compiler])
205[ fi ]
206
bac1e3fd 207AC_PROG_AWK
4da77ea5 208AC_PROG_MAKE_SET
4da77ea5 209AC_PROG_INSTALL
3de6a7e9
MJ
210
211#override some default libtool behavior and invoke AC_PROG_LIBTOOL (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html)
212m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
213m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:])
214m4_defun([_LT_AC_LANG_RC_CONFIG], [:])
5b3f19fb 215AM_PROG_CC_C_O
bac1e3fd 216AC_PROG_LIBTOOL
4da77ea5 217
6bc48b70
MJ
218#Check for compiler vendor
219AX_COMPILER_VENDOR
220
1681b041
MJ
221# Set CC_FOR_BUILD
222if test "x${cross_compiling}" = "xyes"; then
223 CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
ab2cab26 224 case "$host" in
0876df6a 225 arm*-linux-gnueabi*|arm*-*-linux-gnueabi*)
ab2cab26
MJ
226 # spandsp modem
227 ac_cv_file__dev_ptmx=yes
1e51e868
MJ
228 # libjs
229 export ac_cv_va_copy=yes
ab2cab26 230 # srtp
1e51e868 231 export ac_cv_file__dev_urandom=yes
ab2cab26 232 # rpl_malloc
1e51e868
MJ
233 export ac_cv_func_realloc_0_nonnull=yes
234 export ac_cv_func_malloc_0_nonnull=yes
ab2cab26 235 # apr
1e51e868
MJ
236 export ac_cv_func_setpgrp_void=yes
237 export ac_cv_file__dev_zero=yes
238 export apr_cv_tcp_nodelay_with_cork=yes
239 export ac_cv_file_dbd_apr_dbd_mysql_c=no
240 export ac_cv_sizeof_ssize_t=4
241 export apr_cv_mutex_recursive=yes
242 export ac_cv_func_pthread_rwlock_init=yes
243 export apr_cv_type_rwlock_t=yes
244 export apr_cv_process_shared_works=yes
245 export apr_cv_mutex_robust_shared=yes
ab2cab26
MJ
246 ;;
247 esac
1681b041
MJ
248else
249 CC_FOR_BUILD='$(CC)'
250fi
251AC_SUBST(CC_FOR_BUILD)
252
ab2cab26
MJ
253if test -n "$lt_sysroot" ; then
254 APR_ADDTO(CFLAGS, --sysroot=$lt_sysroot)
255 APR_ADDTO(CXXFLAGS, --sysroot=$lt_sysroot)
0fd1e164 256 APR_ADDTO(CPPFLAGS, --sysroot=$lt_sysroot)
ab2cab26
MJ
257 APR_ADDTO(LDFLAGS, --sysroot=$lt_sysroot)
258 PKG_CONFIG_SYSROOT_DIR=$lt_sysroot
259fi
260
6bc48b70
MJ
261# Optimize
262AC_ARG_ENABLE(optimization,
263[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])
264
265if test "${enable_optimizer}" = "yes" ; then
266 AC_DEFINE([OPTIMZER],[],[Enable Optimization.])
267 AX_CC_MAXOPT
268fi
269
55b3e6cb 270# set defaults for use on all platforms
1c5e6144
MJ
271SWITCH_AM_CFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src"
272SWITCH_AM_CXXFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src"
1953ac5c 273SWITCH_AM_LDFLAGS="-lm"
55b3e6cb
MJ
274
275#set SOLINK variable based on compiler and host
276if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
277 SOLINK="-Bdynamic -dy -G"
44d5d43b 278elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
55b3e6cb 279 case "$host" in
44d5d43b 280 *darwin*)
5e7986bf
MJ
281 SOLINK="-dynamic -force-flat-namespace"
282 ;;
44d5d43b 283 *)
7549be4b 284 SOLINK="-shared -Xlinker -x"
44d5d43b
MJ
285 ;;
286
287 esac
288elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
289 case "$host" in
290# older Xcode test for darwin, Xcode 4/5 use clang above
6ae16d15 291 *darwin*)
55b3e6cb
MJ
292 SOLINK="-dynamic -bundle -force-flat-namespace"
293 ;;
872c349f
MB
294 *-solaris2*)
295 SOLINK="-shared -Xlinker"
296 ;;
55b3e6cb
MJ
297 *)
298 SOLINK="-shared -Xlinker -x"
299 ;;
300 esac
b8f1a177
BW
301elif test "x${ax_cv_c_compiler_vendor}" = "xintel" ; then
302 case "$host" in
303 *)
304 SOLINK="-shared -Xlinker -x"
305 ;;
306 esac
55b3e6cb
MJ
307else
308 AC_ERROR([Please update configure.in with SOLINK values for your compiler])
309fi
55b3e6cb 310
4a77854b
SK
311##
312# detect libtool major version,
313# set libtool library extension based on this
314# to work around some brokeness when using 'la' with libtool-1.5
315#
316AC_MSG_CHECKING([libtool major version])
317libtool="${switch_builddir}/libtool"
df33a43a 318LIBTOOL_MAJOR_VERSION="`$libtool --version 2>/dev/null| sed -e 's/([[^)]]*)//g;s/^[[^0-9]]*//;s/[[- ]].*//g;q'| awk 'BEGIN { FS = "." } { print $1 }' `"
0c0a4a53 319if test -z "$LIBTOOL_MAJOR_VERSION" ; then
751c2894 320 LIBTOOL_MAJOR_VERSION="`sed -n -e '/^VERSION/{s/^.*=\"\{0,1\}\([[0-9]]\{1,\}\)\..*/\1/;p;}' ${switch_srcdir}/build/config/ltmain.sh`"
0c0a4a53
SK
321fi
322if test -z "$LIBTOOL_MAJOR_VERSION" ; then
323 AC_MSG_ERROR([Failed to detect your libtool version, please open a bug report on http://jira.freeswitch.org/])
324fi
4a77854b 325AC_MSG_RESULT([${LIBTOOL_MAJOR_VERSION}])
02141e30 326
4216e3e0 327LIBTOOL_LIB_EXTEN=so
02141e30 328
4a77854b 329if test "${LIBTOOL_MAJOR_VERSION}" = "2" ; then
02141e30
MJ
330 LIBTOOL_LIB_EXTEN="la"
331fi
4a77854b
SK
332AC_MSG_RESULT([using libtool library extension... ${LIBTOOL_LIB_EXTEN}])
333
02141e30 334
55b3e6cb
MJ
335# tweak compiler specific flags
336if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
337 APR_ADDTO(SWITCH_AM_CFLAGS, -KPIC)
338 APR_ADDTO(SWITCH_AM_CFLAGS, -DPIC)
99913ce3
MJ
339 APR_ADDTO(SWITCH_AM_CFLAGS, -erroff=E_END_OF_LOOP_CODE_NOT_REACHED)
340 APR_ADDTO(SWITCH_AM_CFLAGS, -errtags=yes)
2343708a 341 APR_ADDTO(SWITCH_AM_CFLAGS, -D__FUNCTION__=__func__ )
342 APR_ADDTO(SWITCH_AM_CFLAGS, -mt)
99913ce3 343 APR_ADDTO(SWITCH_AM_CXXFLAGS, -errtags=yes)
514bde18
MJ
344 APR_ADDTO(SWITCH_AM_CXXFLAGS, -KPIC)
345 APR_ADDTO(SWITCH_AM_CXXFLAGS, -DPIC)
f32f6f24 346 APR_ADDTO(SWITCH_AM_CXXFLAGS, "-features=extensions")
2343708a 347 APR_ADDTO(SWITCH_AM_CXXFLAGS, -D__FUNCTION__=__func__)
348 APR_ADDTO(SWITCH_AM_CXXFLAGS, -mt)
f32f6f24 349
55b3e6cb 350 APR_ADDTO(SWITCH_AM_LDFLAGS, -R${prefix}/lib)
6d45f5f5
MJ
351 if test "${enable_64}" = "yes"; then
352 APR_ADDTO(SWITCH_AM_CFLAGS, -m64)
5b2d20bf
MJ
353 APR_ADDTO(SWITCH_AM_CXXFLAGS, -m64)
354 APR_ADDTO(SWITCH_AM_LDFLAGS, -m64)
1953ac5c 355 LIBS="$LIBS -m64"
6d45f5f5 356 fi
d755b340
BW
357elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
358 APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
359 APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
55b3e6cb
MJ
360elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
361 APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
514bde18 362 APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
44ef8650 363 APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)
1953ac5c 364 if test "${enable_64}" = "yes"; then
5e7986bf 365 case "$host" in
851db97a 366 *darwin12.*|*darwin11.*|*darwin10.*|*darwin9.*|*darwin8.*)
5e7986bf 367 APR_ADDTO(CFLAGS, -arch x86_64)
148f67e0
BW
368 APR_ADDTO(LDFLAGS, -arch x86_64)
369 APR_ADDTO(CXXFLAGS, -arch x86_64)
5e7986bf 370 ;;
148f67e0
BW
371 *-solaris2*)
372 APR_ADDTO(CFLAGS, -m64)
148f67e0
BW
373 APR_ADDTO(LDFLAGS, -m64)
374 APR_ADDTO(CXXFLAGS, -m64)
375 ;;
7803a752
MJ
376 *)
377 LIBS="$LIBS -m64"
378 ;;
5e7986bf 379 esac
1953ac5c 380 fi
55b3e6cb
MJ
381fi
382
ffe2ad4b
MJ
383#
384# gcc visibility cflag checks
385#
386AC_ARG_ENABLE([visibility],
387 [AS_HELP_STRING([--disable-visibility], [Disable or enable API visibility support (default: use if available)])],
388 [enable_visibility="${enableval}"],
389 [enable_visibility="detect"]
390)
391HAVE_VISIBILITY="no"
392
393if test "x${enable_visibility}" != "xno" ; then
394
395 case "${ax_cv_c_compiler_vendor}" in
396 gnu)
397 save_CFLAGS="${CFLAGS}"
398 CFLAGS="${CFLAGS} -fvisibility=hidden"
399 AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden])
400 AC_COMPILE_IFELSE(
401 [AC_LANG_PROGRAM(
402 [int foo __attribute__ ((visibility("default")));],
403 [;]
404 )],
405
406 [AC_MSG_RESULT([yes])
407 APR_ADDTO([SWITCH_AM_CFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
408 APR_ADDTO([SWITCH_AM_CXXFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
409 HAVE_VISIBILITY="yes"],
410
411 [AC_MSG_RESULT([no])]
412 )
413 CFLAGS="${save_CFLAGS}"
414 ;;
415
900907a2 416 sun)
96114867
SK
417 # save_CFLAGS="${CFLAGS}"
418 # CFLAGS="${CFLAGS} -xldscope=hidden"
419 # AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden])
420 # AC_COMPILE_IFELSE(
421 # [AC_LANG_PROGRAM(
422 # [int foo __attribute__ ((visibility("default")));],
423 # [;]
424 # )],
425 #
426 # [AC_MSG_RESULT([yes])
427 # APR_ADDTO([SWITCH_AM_CFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
428 # APR_ADDTO([SWITCH_AM_CXXFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
429 # HAVE_VISIBILITY="yes"],
430 #
431 # [AC_MSG_RESULT([no])]
432 # )
433 # CFLAGS="${save_CFLAGS}"
900907a2
MJ
434 ;;
435
ffe2ad4b
MJ
436 *)
437 if test "x${enable_visibility}" = "xyes" ; then
900907a2 438 AC_MSG_ERROR([Non-GNU / SUN compilers are currently unsupported])
ffe2ad4b 439 else
900907a2 440 AC_MSG_WARN([Non-GNU / SUN compilers are currently unsupported])
ffe2ad4b
MJ
441 fi
442 ;;
443 esac
444
445 #
446 # visibility explicitly requested but not supported by this compiler => error
447 #
448 if test "x${enable_visibility}" = "xyes" -a "x${HAVE_VISIBILITY}" = "xno" ; then
449 AC_MSG_ERROR([API visibility not supported by this compiler])
450 fi
451fi
452
fcd2a7b0
SK
453# Enable debugging (default: on)
454# (rename option if the default is changed)
2faabff7 455AC_ARG_ENABLE(debug,
fcd2a7b0 456[AC_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"])
2faabff7
AM
457
458if test "${enable_debug}" = "yes"; then
459 AC_DEFINE([DEBUG],[],[Enable extra debugging.])
554f476c 460 saved_CFLAGS="$CFLAGS"
44ea66c2 461 CFLAGS=
2faabff7 462 AX_CFLAGS_WARN_ALL_ANSI
02c7a3ac 463 SWITCH_ANSI_CFLAGS=$CFLAGS
554f476c 464 CFLAGS="$saved_CFLAGS"
2faabff7
AM
465
466 if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
467 APR_ADDTO(SWITCH_AM_CFLAGS, -g -ggdb)
37845b42 468 export DEBUG_CFLAGS="-g -ggdb"
2faabff7
AM
469 fi
470
471fi
472
59ba5a15
MJ
473AC_ARG_ENABLE(cpp,
474[AC_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"])
475
476AM_CONDITIONAL([ENABLE_CPP],[test "${enable_cpp}" = "yes"])
477
714e3133
MJ
478AC_ARG_ENABLE([system-xmlrpc-c],
479 [AS_HELP_STRING([--enable-system-xmlrpc-c],
480 [use system lib for xmlrpc-c])],,
481 [enable_xmlrpcc="no"])
482
483if test "${enable_xmlrpcc}" = "yes" ; then
484SYS_XMLRPC_CFLAGS=`xmlrpc-c-config --cflags`
485SYS_XMLRPC_LDFLAGS=`xmlrpc-c-config --libs`
486fi
487AC_SUBST(SYS_XMLRPC_CFLAGS)
488AC_SUBST(SYS_XMLRPC_LDFLAGS)
489AM_CONDITIONAL([SYSTEM_XMLRPCC],[test "${enable_xmlrpcc}" = "yes"])
490
a8b87ffe
AM
491AC_ARG_ENABLE(srtp,
492[AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"])
493
494AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"])
495
861bd209
BW
496AC_ARG_ENABLE(zrtp,
497 [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"])
498if test "x$enable_zrtp" = "xyes" ; then
393b63b7 499 LIBS="-lpthread $LIBS"
861bd209
BW
500 APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
501fi
ae67ecce 502
c4d13331
MJ
503PA_LIBS=
504
505PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
506if test "x$have_jack" = "xyes" ; then
507PA_LIBS+=$JACK_LIBS
508fi
509
ae67ecce 510AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
1911a262 511if test "x$have_alsa" = "xyes" ; then
c4d13331 512PA_LIBS+=-lasound
ae67ecce 513fi
c4d13331
MJ
514
515AC_SUBST(PA_LIBS)
ae67ecce 516
861bd209
BW
517AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"])
518
a4a52620
SK
519AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
520
ab2bc7c6
TC
521AC_ARG_ENABLE(core-odbc-support,
522 [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support (default is optional)])],,[enable_core_odbc_support="optional"])
523if ! test "$enable_core_odbc_support" = "no"; then
524 AX_LIB_ODBC
525 if test "$ac_cv_found_odbc" = "yes" ; then
526 enable_core_odbc_support="yes"
527 elif test "$enable_core_odbc_support" = "yes"; then
528 AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent])
529 else
530 enable_core_odbc_support="no"
531 fi
ffc8e81b
TC
532fi
533
6e9fa3ba
AM
534CHECK_LIBUUID
535SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS"
536SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS"
537
5cb354dd
EG
538AC_ARG_ENABLE(core-pgsql-support,
539 [AS_HELP_STRING([--enable-core-pgsql-support], [Compile with PGSQL Support])],,[enable_core_pgsql_support="no"])
ba052c22 540AC_ARG_ENABLE(core-pgsql-pkgconfig,
299081ed 541 [AS_HELP_STRING([--disable-core-pgsql-pkgconfig], [Use pg_config to get PGQSL build options])],[enable_core_pgsql_pkgconfig="$enableval"],[enable_core_pgsql_pkgconfig="yes"])
5cb354dd
EG
542
543if test x"$enable_core_pgsql_support" = x"yes" ; then
ba052c22
TC
544 AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
545 AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
ba052c22
TC
546 if test "$PKG_CONFIG" = "no" \
547 || test x"$enable_core_pgsql_pkgconfig" = x"no" \
548 || ! pkg-config libpq; then
81185aa9
KR
549 if test "$PG_CONFIG" != "no"; then
550 AC_MSG_CHECKING([for PostgreSQL libraries via pg_config])
551 POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
552 POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`"
553 POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
554 POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
555 POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL ([0-9]+).[0-9]+.?[0-9]+?#\1#'`
556 POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL [0-9]+.([0-9]+).?[0-9]+?#\1#'`
557 POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL [0-9]+.[0-9]+.?([0-9]+)?#\1#'`
558 else
559 AC_MSG_ERROR([no usable pkg-config or pg_config; please install libpq devel package or equivalent])
560 fi
ba052c22 561 else
81185aa9
KR
562 AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config])
563 POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`"
564 POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`"
ba052c22
TC
565 POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
566 POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
567 POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1`"
568 POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2`"
569 POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3`"
570 fi
81185aa9
KR
571 save_LIBS="$LIBS"
572 LIBS="$POSTGRESQL_LIBDIR $LIBS"
573 AC_MSG_RESULT([$POSTGRESQL_LIBDIR])
574
ba052c22
TC
575 AC_DEFINE([SWITCH_HAVE_PGSQL], [1], [Define to 1 if PostgreSQL libraries are available])
576 AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
577 AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
578 AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
579 AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
81185aa9 580
ba052c22
TC
581 AC_CHECK_LIB([pq], [PQgetvalue],, AC_MSG_ERROR([no usable libpq; please install PostgreSQL devel package or equivalent]))
582 AC_MSG_RESULT([yes])
81185aa9 583 SWITCH_AM_CXXFLAGS="$POSTGRESQL_CFLAGS $SWITCH_AM_CXXFLAGS"
ba052c22 584 SWITCH_AM_LDFLAGS="$POSTGRESQL_LDFLAGS $SWITCH_AM_LDFLAGS"
81185aa9
KR
585
586 LIBS="$save_LIBS"
5cb354dd 587fi
25c725c2 588
603f3eff
MJ
589AC_ARG_ENABLE(deprecated-core-db-events,
590 [AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"])
591
592if test x"$enable_deprecated_core_db_events" = x"yes" ; then
593 AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events])
594fi
595
25c725c2
AM
596AC_ARG_ENABLE(timerfd-wrapper,
597[AC_HELP_STRING([--enable-timerfd-wrapper],[timerfd is in the kernel but not in your libc])],[enable_timer_fd_wrapper="$enableval"],[enable_timer_fd_wrapper="no"])
d28b2391
AM
598AM_CONDITIONAL([ENABLE_TIMERFD_WRAPPER],[test "x$enable_timer_fd_wrapper" != "xno"])
599
f2067001
BW
600ESL_LDFLAGS=
601PLATFORM_CORE_LDFLAGS=
602PLATFORM_CORE_LIBS=
d28b2391 603
3b1278a3
TC
604path_remove () {
605 echo "$1" | sed 's/:/\n/g' | grep -Fxv "$2" | tr '\n' ':' | sed 's/:$/\n/'
606}
607path_push_unique () {
608 x="$(eval echo \$$1)"
609 x="$(path_remove "$x" "$2")"
03132e3f 610 eval export $1="$2:$x"
3b1278a3
TC
611}
612
55b3e6cb
MJ
613# tweak platform specific flags
614case "$host" in
c9bdf3b4 615 *darwin13.*|*darwin12.*|*darwin11.*)
0952a99a 616 APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
ec044e62
JLC
617 APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp -Wno-deprecated-declarations)
618 APR_ADDTO(CPPFLAGS, -I/usr/local/opt/openssl/include)
85d6b9af 619 APR_ADDTO(LDFLAGS, -pipe -bind_at_load -L/usr/local/opt/openssl/lib)
0952a99a
MJ
620 APR_ADDTO(CXXFLAGS, -pipe)
621 APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
622 if test "x$enable_core_odbc_support" != "xno"; then
623 APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
624 fi
625 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
626 ;;
5e7986bf
MJ
627 *darwin10.*)
628 APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
ec044e62
JLC
629 APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp)
630 APR_ADDTO(CPPFLAGS, -I/usr/local/opt/openssl/include)
85d6b9af 631 APR_ADDTO(LDFLAGS, -pipe -bind_at_load -L/usr/local/opt/openssl/lib)
5e7986bf
MJ
632 APR_ADDTO(CXXFLAGS, -pipe)
633 APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
634 if test "x$enable_core_odbc_support" != "xno"; then
a48da3b4 635 APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
5e7986bf 636 fi
cdabd564 637 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
5e7986bf 638 ;;
6ae16d15 639 *darwin*)
ec044e62 640 APR_ADDTO(CPPFLAGS, -I/usr/local/opt/openssl/include)
85d6b9af 641 APR_ADDTO(LDFLAGS, -L/usr/local/opt/openssl/lib)
55b3e6cb
MJ
642 APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
643 APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
9a9ba4c3 644 if test "x$enable_core_odbc_support" != "xno"; then
a48da3b4 645 APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
9a9ba4c3 646 fi
cdabd564 647 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
55b3e6cb
MJ
648 ;;
649 *-solaris2*)
148f67e0 650 if test "${enable_64}" = "yes"; then
ec044e62 651 APR_ADDTO(CPPFLAGS, [-I/opt/64/include])
148f67e0 652 APR_ADDTO(LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib])
4dddcafc
BW
653 APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/64/include])
654 APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib])
148f67e0 655 else
ec044e62 656 APR_ADDTO(CPPFLAGS, [-I/opt/include])
148f67e0
BW
657 APR_ADDTO(LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib])
658 APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/include])
659 APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib])
660 fi
cb1cb69e 661 APR_ADDTO(SWITCH_AM_CFLAGS, -DPATH_MAX=2048 -D__EXTENSIONS__)
54a9eba4 662 APR_ADDTO(SWITCH_AM_LDFLAGS, -lsendfile -lresolv -lsocket -lnsl -luuid)
bb33c4e7 663 APR_ADDTO(ESL_LDFLAGS, -lnsl -lsocket)
a48da3b4 664 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt -lsendfile -lresolv -lsocket -lnsl -luuid])
55b3e6cb 665 ;;
4f2e0f19 666 *dragonfly*)
ec044e62 667 APR_ADDTO(CPPFLAGS, -I/usr/local/include)
4f2e0f19
MJ
668 APR_ADDTO(LDFLAGS, -L/usr/local/lib)
669 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
670 ;;
eab96981 671 *openbsd*)
ec044e62 672 APR_ADDTO(CPPFLAGS, -I/usr/local/include)
eab96981
MJ
673 APR_ADDTO(LDFLAGS, -L/usr/local/lib)
674 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
675 ;;
a91ba93d 676 *netbsd*)
ec044e62 677 APR_ADDTO(CPPFLAGS, -I/usr/pkg/include)
783a4083 678 APR_ADDTO(LDFLAGS, [-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib])
a91ba93d
BW
679 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/pkg/include)
680 ;;
f0b58efb 681 *bsd*)
ec044e62 682 APR_ADDTO(CPPFLAGS, -I/usr/local/include)
ec718814 683 APR_ADDTO(LDFLAGS, -L/usr/local/lib)
f0b58efb 684 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
041e3bf0 685 APR_ADDTO([PLATFORM_CORE_LIBS], [-lcrypt -lrt])
a48da3b4
SK
686 ;;
687 *linux*)
688 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt])
f0b58efb 689 ;;
55b3e6cb
MJ
690esac
691
514bde18
MJ
692APR_REMOVEFROM(SWITCH_AM_CXXFLAGS, -std=c99)
693
9b85b9c9
MJ
694AC_CHECK_LIB(z, inflateReset, have_libz=yes, AC_MSG_ERROR([no usable zlib; please install zlib devel package or equivalent]))
695if test "x$have_libz" = "xyes" ; then
696APR_ADDTO([PLATFORM_CORE_LIBS], [-lz])
697fi
698
48712895
TC
699AC_CHECK_LIB(apr-1, apr_pool_mutex_set, use_system_apr=yes, use_system_apr=no)
700AM_CONDITIONAL([SYSTEM_APR],[test "${use_system_apr}" = "yes"])
701AC_CHECK_LIB(aprutil-1, apr_queue_pop_timeout, use_system_aprutil=yes, use_system_aprutil=no)
702AM_CONDITIONAL([SYSTEM_APRUTIL],[test "${use_system_aprutil}" = "yes"])
703
9b85b9c9
MJ
704AC_CHECK_LIB(jpeg, jpeg_std_error,, AC_MSG_ERROR([no usable libjpeg; please install libjpeg devel package or equivalent]))
705
706AC_CHECK_LIB(jbig, jbg_enc_out, have_libjbig=yes, have_libjbig=no)
707if test "x$have_libjbig" = "xyes" ; then
708SPANDSP_LA_JBIG="-ljbig"
709AC_SUBST(SPANDSP_LA_JBIG)
710fi
711
712AC_CHECK_LIB(lzma, lzma_code, have_liblzma=yes, have_liblzma=no)
713if test "x$have_liblzma" = "xyes" ; then
714SPANDSP_LA_LZMA="-llzma"
715AC_SUBST(SPANDSP_LA_LZMA)
716fi
717
718AC_CHECK_LIB(resolv, res_init, have_libresolv=yes, have_libresolv=no)
719if test "x$have_libresolv" = "xyes" ; then
720APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv)
721fi
722
55b3e6cb 723AC_SUBST(SWITCH_AM_CFLAGS)
02c7a3ac 724AC_SUBST(SWITCH_ANSI_CFLAGS)
514bde18 725AC_SUBST(SWITCH_AM_CXXFLAGS)
55b3e6cb 726AC_SUBST(SWITCH_AM_LDFLAGS)
3ec59cdb 727AC_SUBST(ESL_LDFLAGS)
a48da3b4
SK
728AC_SUBST(PLATFORM_CORE_LDFLAGS)
729AC_SUBST(PLATFORM_CORE_LIBS)
6bc48b70 730AC_SUBST(SOLINK)
02141e30 731AC_SUBST(LIBTOOL_LIB_EXTEN)
6bc48b70 732
4da77ea5
AM
733# Checks for header files.
734AC_HEADER_DIRENT
735AC_HEADER_STDC
6b6c83a7 736AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/select.h netdb.h execinfo.h])
56008e2b 737
56008e2b
AM
738if test x"$ac_cv_header_wchar_h" = xyes; then
739 HAVE_WCHAR_H_DEFINE=1
740else
741 HAVE_WCHAR_H_DEFINE=0
742fi
743AC_SUBST(HAVE_WCHAR_H_DEFINE)
4da77ea5 744
6b6c83a7
JL
745# Needed by Abyss on Solaris:
746
747if test x"$ac_cv_header_sys_filio_h" = xyes; then
748 HAVE_SYS_FILIO_H_DEFINE=1
749else
750 HAVE_SYS_FILIO_H_DEFINE=0
751fi
752AC_SUBST(HAVE_SYS_FILIO_H_DEFINE)
753
754# Needed by Abyss on Solaris:
755
756if test x"$ac_cv_header_sys_ioctl_h" = xyes; then
757 HAVE_SYS_IOCTL_H_DEFINE=1
758else
759 HAVE_SYS_IOCTL_H_DEFINE=0
760fi
761AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
762
763if test x"$ac_cv_header_sys_select_h" = xyes; then
764 HAVE_SYS_SELECT_H_DEFINE=1
765else
766 HAVE_SYS_SELECT_H_DEFINE=0
767fi
768AC_SUBST(HAVE_SYS_SELECT_H_DEFINE)
769
4da77ea5
AM
770# Checks for typedefs, structures, and compiler characteristics.
771AC_C_CONST
772AC_C_INLINE
773AC_TYPE_SIZE_T
774AC_HEADER_TIME
775AC_STRUCT_TM
776
777# Checks for library functions.
778AC_PROG_GCC_TRADITIONAL
a7bf6f8d 779AC_FUNC_MALLOC
4da77ea5
AM
780AC_TYPE_SIGNAL
781AC_FUNC_STRFTIME
d91f67d0 782AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt])
ea5c0c21 783AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups])
4062b636 784AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp])
b382c0a4 785
8bcf3b4f
SK
786# Check availability and return type of strerror_r
787# (NOTE: apr-1-config sets -D_GNU_SOURCE at build-time, need to run the check with it too)
788save_CPPFLAGS="$CPPFLAGS"
789CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
790AC_FUNC_STRERROR_R
791CPPFLAGS="$save_CPPFLAGS"
792
ea5c0c21
MJ
793AX_HAVE_CPU_SET
794
eb9f9fb2 795AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
d314f254 796AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])])
eb9f9fb2 797AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
6627dc86 798AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
5f469ad2 799
4062b636 800AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
eb9f9fb2 801
d91f67d0
AM
802AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
803AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
804
bf988471 805AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
21159328
MJ
806#include <sys/types.h>
807#include <time.h>])
808
bf988471 809AC_CHECK_MEMBERS([struct tm.tm_zone],,,[
21159328
MJ
810#include <sys/types.h>
811#include <time.h>])
812
b382c0a4
MJ
813AC_CHECK_DECL([RLIMIT_MEMLOCK],
814 [AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],,
815 [#ifdef HAVE_SYS_RESOURCE_H
816 #include <sys/resource.h>
817 #endif])
818
819AC_CHECK_DECL([SCHED_RR],
820 [AC_DEFINE([HAVE_SCHED_RR],[1],[SCHED_RR constant for sched_setscheduler])],,
821 [#ifdef HAVE_SCHED_H
822 #include <sched.h>
823 #endif])
824
817439d7
AM
825AC_CHECK_DECL([SCHED_FIFO],
826 [AC_DEFINE([HAVE_SCHED_FIFO],[1],[SCHED_FIFO constant for sched_setscheduler])],,
827 [#ifdef HAVE_SCHED_H
828 #include <sched.h>
829 #endif])
830
b382c0a4
MJ
831#
832# use mlockall only on linux (for now; if available)
833#
834if test "x${ac_cv_func_mlockall}" = "xyes"; then
835 AC_MSG_CHECKING([whether to use mlockall])
836 case "$host" in
837 *-linux-*)
838 AC_DEFINE([USE_MLOCKALL],[1],[Enable mlockall support])
839 AC_MSG_RESULT([yes])
840 USE_MLOCKALL=yes
841 ;;
842 *-freebsd*)
883de14f
JL
843 APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
844 APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
b382c0a4
MJ
845 AC_MSG_RESULT([no, broken for non-root users])
846 ;;
847 *)
848 AC_MSG_RESULT([no])
849 ;;
850 esac
851
852 #
853 # setrlimit prerequisites
854 #
855 if test "x${USE_MLOCKALL}" = "xyes" -a \
856 "x${ac_cv_func_setrlimit}" = "xyes" -a \
857 "x${ac_cv_have_decl_RLIMIT_MEMLOCK}" = "xyes"
858 then
859 AC_DEFINE([USE_SETRLIMIT],[1],[Use setrlimit to disable mlock limit for non-root users])
860 fi
861fi
862
863#
864# sched_setcheduler + round-robin scheduler prerequisites
865#
866if test "x${ac_cv_func_sched_setscheduler}" = "xyes" -a \
867 "x${ac_cv_have_decl_SCHED_RR}" = "xyes"
868then
869 AC_DEFINE([USE_SCHED_SETSCHEDULER],[1],[Enable round-robin scheduler using sched_setscheduler])
870fi
4062b636
AM
871#
872# xmlrpc-c checks
873#
874
6b6c83a7 875AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull)
4062b636
AM
876
877HAVE_LIBWWW_SSL_DEFINE=0
878AC_SUBST(HAVE_LIBWWW_SSL_DEFINE)
879
880DIRECTORY_SEPARATOR="/"
881AC_SUBST(DIRECTORY_SEPARATOR)
882
883va_list_is_array=no
884AC_MSG_CHECKING(whether va_list is an array)
885AC_TRY_COMPILE([
886#include <stdarg.h>
887], [va_list list1, list2; list1 = list2;], ,
888va_list_is_array=yes)
889AC_MSG_RESULT($va_list_is_array)
890if test x"$va_list_is_array" = xyes; then
891 VA_LIST_IS_ARRAY_DEFINE=1
892else
893 VA_LIST_IS_ARRAY_DEFINE=0
894fi
895AC_SUBST(VA_LIST_IS_ARRAY_DEFINE)
896
554f476c 897
4062b636
AM
898AC_MSG_CHECKING(whether compiler has __attribute__)
899AC_TRY_COMPILE(, [int x __attribute__((__unused__));],
900compiler_has_attribute=yes,
901compiler_has_attribute=no)
902AC_MSG_RESULT($compiler_has_attribute)
903if test x"$compiler_has_attribute" = xyes; then
904 ATTR_UNUSED="__attribute__((__unused__))"
905else
906 ATTR_UNUSED=
907fi
908AC_SUBST(ATTR_UNUSED)
909
910
554f476c
MJ
911saved_CFLAGS="$CFLAGS"
912AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [
913CFLAGS="$CFLAGS -Wdeclaration-after-statement"
914AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no])
915])
916AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement)
917if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then
918 APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wdeclaration-after-statement)
919fi
920CFLAGS="$saved_CFLAGS"
4da77ea5 921
c7ccf84a
MJ
922if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
923 # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off
924 AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [
925 AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no])
926 ])
927 AC_MSG_RESULT($ac_cv_clang_extended_offsetof)
928 if test x"$ac_cv_clang_extended_offsetof" = xyes; then
929 APR_ADDTO(CFLAGS, -Wno-extended-offsetof)
930 fi
44d5d43b
MJ
931fi
932
eb8ff5a0
MOC
933# Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready
934# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_skypopen mod_h323 mod_khomp
935# mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed
936#
937#saved_CFLAGS="$CFLAGS"
938#AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [
939#CFLAGS="$CFLAGS -Wunused-but-set-variable"
940#AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no])
941#])
942#AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable)
943#if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then
944# APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wunused-but-set-variable)
945#fi
946#CFLAGS="$saved_CFLAGS"
f952719e 947
44cc7d5c 948AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
49a0eb29 949
42e78242
MJ
950# Checks for integer size
951AC_CHECK_SIZEOF(char, 1)
952AC_CHECK_SIZEOF(int, 4)
953AC_CHECK_SIZEOF(long, 4)
954AC_CHECK_SIZEOF(short, 2)
955AC_CHECK_SIZEOF(long long, 8)
956AC_TYPE_SIZE_T
957AC_CHECK_TYPE(ssize_t, int)
958
959# Checks for pointer size
960AC_CHECK_SIZEOF(void*, 4)
961
962if test "x$ac_cv_sizeof_voidp" != "x"; then
963 voidp_size=$ac_cv_sizeof_voidp
964else
965 AC_ERROR([Cannot determine size of void*])
966fi
967
968if test "$ac_cv_sizeof_short" = "2"; then
969 short_value=short
970fi
971if test "$ac_cv_sizeof_int" = "4"; then
972 int_value=int
973fi
974
975if test "$ac_cv_sizeof_int" = "8"; then
976 int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
977 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
978 int64_value="int"
979 long_value=int
980elif test "$ac_cv_sizeof_long" = "8"; then
981 int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
982 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
983 int64_value="long"
984 long_value=long
764b7958 985 case "$host" in
44410b71
BW
986 *pc-solaris2*)
987 ;;
f6fe2667 988 *-solaris2*|*apple-darwin*|*-openbsd*)
764b7958
MJ
989 if test "$ac_cv_sizeof_long_long" = "8"; then
990 int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
991 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
992 int64_value="long long"
993 long_value="long long"
994 fi
995 ;;
996 esac
42e78242
MJ
997elif test "$ac_cv_sizeof_long_long" = "8"; then
998 int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
999 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
1000 int64_value="long long"
1001 long_value="long long"
1002elif test "$ac_cv_sizeof_longlong" = "8"; then
1003 int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
1004 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
1005 int64_value="__int64"
1006 long_value="__int64"
1007else
1008 AC_ERROR([could not detect a 64-bit integer type])
1009fi
1010
1011if test "$ac_cv_type_size_t" = "yes"; then
1012 size_t_value="size_t"
1013else
1014 size_t_value="switch_int32_t"
1015fi
1016
1017if test "$ac_cv_type_ssize_t" = "yes"; then
1018 ssize_t_value="ssize_t"
1019else
1020 ssize_t_value="switch_int32_t"
1021fi
1022
1023APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
1024
1025if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
1026 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
1027elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
1028 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1029else
1030 ssize_t_fmt='#error Can not determine the proper size for ssize_t'
1031fi
1032
1033APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
1034
1035if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
1036 size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
1037elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
1038 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
1039else
d90bac38 1040 size_t_fmt='#define SWITCH_SIZE_T_FMT "zu"'
42e78242
MJ
1041fi
1042
1043# Basically, we have tried to figure out the correct format strings
1044# for SWITCH types which vary between platforms, but we don't always get
1045# it right. If you find that we don't get it right for your platform,
1046# you can override our decision below.
1047# NOTE: borrowed much of this logic from apr.
1048case $host in
1049 s390*linux*)
1050 # uniquely, the 31-bit Linux/s390 uses "unsigned long int"
1051 # for size_t rather than "unsigned int":
1052 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
1053 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1054 ;;
1055 *-os2*)
1056 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
1057 ;;
6d66ecfd
MJ
1058 *-openbsd*)
1059 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
1060 ;;
42e78242
MJ
1061 *aix4*|*aix5*)
1062 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1063 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
1064 ;;
1065 *beos*)
1066 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1067 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
1068 ;;
1069 *apple-darwin*)
1070 osver=`uname -r`
1071 case $osver in
1072 [0-7].*)
1073 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
1074 ;;
1075 *)
1076 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1077 ;;
1078 esac
1079 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
1080 ;;
1081esac
1082
1083AC_SUBST(voidp_size)
1084AC_SUBST(short_value)
1085AC_SUBST(int_value)
1086AC_SUBST(long_value)
1087AC_SUBST(int64_value)
1088AC_SUBST(size_t_value)
1089AC_SUBST(ssize_t_value)
1090AC_SUBST(int64_t_fmt)
1091AC_SUBST(uint64_t_fmt)
1092AC_SUBST(ssize_t_fmt)
1093AC_SUBST(size_t_fmt)
42e78242 1094
f6fe2667
MJ
1095case $host in
1096 *-openbsd*)
1097 # OpenBSD's gunzip and friends don't like -d because its redundant, only gzip does
1098 AC_PATH_PROGS(ZCAT, gzip)
1099 ;;
1100 *)
1101 AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat)
1102 ;;
1103esac
1104
50328a66
TC
1105AC_PATH_PROGS(BZIP, bzip2)
1106AC_PATH_PROGS(XZ, xz)
bc34fb76
MJ
1107AC_PATH_PROGS(TAR, gtar tar)
1108AC_PATH_PROGS(WGET, wget)
1109AC_PATH_PROGS(CURL, curl)
d2cf7f86 1110GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getlib.sh"
c99d8c9b 1111AC_SUBST(GETLIB)
17d52112
MJ
1112GETG729="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getg729.sh"
1113AC_SUBST(GETG729)
d2cf7f86 1114GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh"
3d5fcabe 1115AC_SUBST(GETSOUNDS)
c99d8c9b 1116
d1045b12
MJ
1117case $host in
1118 *-darwin*)
1119 path_push_unique PKG_CONFIG_PATH /usr/local/opt/curl/lib/pkgconfig
169a264c 1120 path_push_unique PKG_CONFIG_PATH /usr/local/opt/sqlite/lib/pkgconfig/
d1045b12
MJ
1121 ;;
1122esac
1123
cd650f60 1124# temporary workaround for Debian libldns-dev package bug
a3e1b7df 1125if test "$cross_compiling" != "yes" && test -f /usr/lib/pkg-config/libldns.pc; then
cd650f60
TC
1126 path_push_unique PKG_CONFIG_PATH /usr/lib/pkg-config
1127fi
1128
bcfb72cb 1129PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20])
ad094b7a 1130PKG_CHECK_MODULES([CURL], [libcurl >= 7.19])
74da7aaf 1131PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
b283db63 1132PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1])
f9d065cd
TC
1133PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[
1134 AM_CONDITIONAL([HAVE_YAML],[true])],[
c86b939f 1135 AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_YAML],[false])])
cd650f60
TC
1136PKG_CHECK_MODULES([LDNS], [libldns >= 1.6.6],[
1137 AM_CONDITIONAL([HAVE_LDNS],[true])],[
1138 AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false])])
4d62a1ad 1139
4bdb7129
JLC
1140PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 0.31],[
1141 AM_CONDITIONAL([HAVE_MEMCACHED],[true])
1142 MEMCACHED_LIBS="${MEMCACHED_LIBS} -lpthread"
1143 save_LIBS="${LIBS}"
1144 save_CPPFLAGS="${CPPFLAGS}"
1145 LIBS="${MEMCACHED_LIBS}"
1146 CPPFLAGS="${MEMCACHED_CFLAGS}"
1147 AC_CHECK_FUNCS([memcached_server_name memcached_stat_execute])
1148 AC_CHECK_TYPES([memcached_instance_st*],,, [[#include <libmemcached/memcached.h>]])
1149 LIBS="${save_LIBS}"
1150 CPPFLAGS="${save_CPPFLAGS}"
1151],[
1152 AC_MSG_RESULT([no])
1153 AM_CONDITIONAL([HAVE_MEMCACHED],[false])
1154])
1155
c5c13c26 1156AC_ARG_ENABLE(core-libedit-support,
8574988c 1157 [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])])
c5c13c26 1158
4bdef6e6
JLC
1159AS_IF([test "x$enable_core_libedit_support" != "xno"],[
1160 PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],,[
1161 AC_MSG_RESULT([no])
1162 AC_CHECK_LIB([edit], [el_line], [LIBEDIT_LIBS=-ledit])
1163 AC_CHECK_HEADER([histedit.h], [], [unset LIBEDIT_LIBS])
1164 AS_IF([test "x$LIBEDIT_LIBS" = "x"], [
1165 AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support])
1166 ])])])
8574988c
TC
1167
1168AS_IF([test "x$enable_core_libedit_support" != "xno"], [
1169 # If making changes here, don't forget to run autoheader and
1170 # update libs/esl/src/include/esl_config_auto.h.in manually.
1171 AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if you have libedit is available])
1172 save_LIBS="${LIBS}"
1173 save_CPPFLAGS="${CPPFLAGS}"
1174 LIBS="${LIBEDIT_LIBS}"
1175 CPPFLAGS="${LIBEDIT_CFLAGS}"
1176 AC_CHECK_DECLS([EL_PROMPT_ESC, EL_REFRESH],,, [[#include <histedit.h>]])
1177 AC_CHECK_FUNCS([el_wset])
1178 LIBS="${save_LIBS}"
1179 CPPFLAGS="${save_CPPFLAGS}"
1180])
28213aad 1181
219a2ecc
AT
1182SAC_OPENSSL
1183
9d6d8a1c
AT
1184if test x$HAVE_OPENSSL = x1; then
1185 openssl_CFLAGS="$openssl_CFLAGS -DHAVE_OPENSSL";
1d18b58b 1186 APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL)
2fe3ef03 1187 AC_CHECK_LIB(ssl, SSL_CTX_set_tlsext_use_srtp, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS_SRTP, 1, HAVE_OPENSSL_DTLS_SRTP), AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required]))
85d6b9af 1188 AC_CHECK_LIB(ssl, DTLSv1_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS, 1, HAVE_OPENSSL_DTLS), AC_MSG_ERROR([OpenSSL >= 1.0.1e and associaed developement headers required]))
15f219ea 1189else
f2331de6 1190 AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required])
9d6d8a1c
AT
1191fi
1192
e69fe7e3 1193AX_CHECK_JAVA
7df787b7 1194
2e32d105
PO
1195# Option to enable static linking of Google's V8 inside mod_v8
1196AC_ARG_ENABLE(static-v8,
1197[AS_HELP_STRING([--enable-static-v8], [Statically link V8 into mod_v8])], [enable_static_v8="$enableval"], [enable_static_v8="no"])
1198AM_CONDITIONAL([ENABLE_STATIC_V8],[test "x$enable_static_v8" != "xno"])
c8fa0f0c
PO
1199
1200# Option to disable parallel build of Google's V8
1201AC_ARG_ENABLE(parallel-build-v8,
1202[AS_HELP_STRING([--disable-parallel-build-v8], [Disable parallel build of V8])], [enable_parallel_build_v8="$enableval"], [enable_parallel_build_v8="yes"])
1203AM_CONDITIONAL([ENABLE_PARALLEL_BUILD_V8],[test "x$enable_parallel_build_v8" != "xno"])
753fa8fb 1204
31b743d6 1205AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
778a82cc 1206AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
49a0eb29 1207
719d37db
BW
1208#
1209# perl checks
1210#
1211
5014b80d
BW
1212AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no])
1213AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_have_perl" != "xno"])
1214
1215if test "x$ac_cv_have_perl" != "xno" ; then
230b2178 1216 PERL=perl
5014b80d
BW
1217 PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{sitelibexp}'`"
1218 PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE"
1219 PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`"
1220 PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts` -DEMBED_PERL"
1221 PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts` `$PERL -MConfig -e 'print $Config{libs}'`"
1222 PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`"
1223 AC_SUBST(PERL_SITEDIR)
1224 AC_SUBST(PERL_LIBDIR)
1225 AC_SUBST(PERL_LIBS)
1226 AC_SUBST(PERL_CFLAGS)
1227 AC_SUBST(PERL_LDFLAGS)
1228 AC_SUBST(PERL_INC)
1229fi
1230
719d37db
BW
1231#
1232# php checks
1233#
1234
1235AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no])
1236AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no])
1237AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"])
1238
1239if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then
1240 PHP=php
1241 PHP_CONFIG=php-config
1242 PHP_LDFLAGS="`$PHP_CONFIG --ldflags`"
1243 PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto)//g'`"
1244 PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`"
1245 PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`"
1246 PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`"
1247 PHP_CFLAGS="`$PHP_CONFIG --includes`"
1248 AC_SUBST(PHP_LDFLAGS)
1249 AC_SUBST(PHP_LIBS)
1250 AC_SUBST(PHP_EXT_DIR)
1251 AC_SUBST(PHP_INC_DIR)
1252 AC_SUBST(PHP_INI_DIR)
1253 AC_SUBST(PHP_CFLAGS)
1254fi
1255
e8c88aa1
SK
1256#
1257# Python checks for mod_python
1258#
1259AC_ARG_WITH(
1260 [python],
1261 [AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])],
1262 [with_python="$withval"],
1263 [with_python="try"]
1264)
1265
e8c88aa1
SK
1266if test "$with_python" != "no"
1267then
2d14539e
SK
1268 save_CFLAGS="$CFLAGS"
1269 save_LIBS="$LIBS"
1270
e8c88aa1
SK
1271 if test "$with_python" != "yes" -a "$with_python" != "try" ; then
1272 AC_MSG_CHECKING([for python])
1273 if test ! -x "$with_python" ; then
1274 AC_MSG_ERROR([Specified python does not exist or is not executable: $with_python])
1275 fi
1276 AC_MSG_RESULT([$with_python])
1277 AC_SUBST([PYTHON], ["$with_python"])
1278 else
1279 AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
1280 fi
1281
1282 if test "$PYTHON" != "no" ; then
1283 AC_MSG_CHECKING([python version])
1284 PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`"
1285
1286 if test -z "$PYTHON_VER" ; then
1287 AC_MSG_ERROR([Unable to detect python version])
1288 fi
1289 AC_MSG_RESULT([$PYTHON_VER])
1290
2d14539e 1291 AC_MSG_CHECKING([for python distutils])
baf944eb
SK
1292 python_result="`$PYTHON -c 'import distutils;' 2>&1`"
1293 if test -z "$python_result" ; then
2d14539e 1294 python_has_distutils="yes"
baf944eb
SK
1295 else
1296 python_has_distutils="no"
2d14539e
SK
1297 fi
1298 AC_MSG_RESULT([$python_has_distutils])
1299
baf944eb 1300 if test "$python_has_distutils" != "no" ; then
f08ac862
SK
1301 AC_MSG_CHECKING([location of site-packages])
1302
83680470 1303 PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
f08ac862
SK
1304
1305 if test -z "$PYTHON_SITE_DIR" ; then
1306 AC_MSG_ERROR([Unable to detect python site-packages path])
1307 elif test ! -d "$PYTHON_SITE_DIR" ; then
1308 AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!])
1309 fi
1310 AC_MSG_RESULT([$PYTHON_SITE_DIR])
1311 AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR])
1312
2d14539e
SK
1313 #
1314 # python distutils found, get settings from python directly
1315 #
93129e32 1316 PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print(\" \".join(flags));' | sed -e 's/-arch i386//g;s/-arch x86_64//g'`"
83680470
SK
1317 PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print(\" \".join(libs));'`"
1318 PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`"
1319 PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
ba892c27
SK
1320
1321 # handle python being installed into /usr/local
1322 AC_MSG_CHECKING([python libdir])
1323 if test -z "`echo $PYTHON_LIBDIR | grep "/usr/lib"`" ; then
1324 PYTHON_LDFLAGS="-L$PYTHON_LIBDIR $PYTHON_LDFLAGS"
1325 LIBS="-L$PYTHON_LIBDIR $LIBS"
1326 fi
1327 AC_MSG_RESULT([$PYTHON_LIBDIR])
e8c88aa1 1328
2d14539e
SK
1329 # check libpython
1330 AC_CHECK_LIB([$PYTHON_LIB], [main], [has_libpython="yes"], [has_libpython="no"])
1331
1332 if test "$has_libpython" = "no" ; then
1333 AS_IF([test "$with_python" = "try"],
1334 [AC_MSG_WARN([$PYTHON_LIB is unusable])],
1335 [AC_MSG_ERROR([$PYTHON_LIB is unusable])]
1336 )
1337 fi
e8c88aa1
SK
1338
1339 # check whether system libpython is usable and has threads support
2d14539e 1340 CFLAGS="$PYTHON_CFLAGS"
e8c88aa1
SK
1341 LIBS="$PYTHON_LDFLAGS"
1342 AC_CHECK_FUNC([PyThread_init_thread], [python_has_threads="yes"], [python_has_threads="no"])
e8c88aa1 1343
2d14539e
SK
1344 if test "$python_has_threads" = "no"; then
1345 AS_IF([test "$with_python" = "try"],
1346 [AC_MSG_WARN([Your python lacks threads support, can not build mod_python])],
1347 [AC_MSG_ERROR([Your python lacks threads support, can not build mod_python])]
1348 )
e8c88aa1
SK
1349 else
1350 AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf])
2d14539e 1351 AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS])
e8c88aa1
SK
1352 AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS])
1353 fi
1354 else
2d14539e 1355 AS_IF([test "$with_python" = "try"],
baf944eb
SK
1356 [AC_MSG_WARN([Could not find or use python distutils module: $python_result])],
1357 [AC_MSG_ERROR([Could not find or use python distutils module: $python_result])]
2d14539e 1358 )
e8c88aa1
SK
1359 fi
1360
2d14539e
SK
1361 LIBS="$save_LIBS"
1362 CFLAGS="$save_CFLAGS"
1363
1364 unset python_has_threads
1365 unset python_has_distutils
baf944eb 1366 unset python_result
2d14539e
SK
1367 else
1368 AS_IF([test "$with_python" = "try"],
1369 [AC_MSG_WARN([Could not find python, mod_python will not build, use --with-python to specify the location])],
1370 [AC_MSG_ERROR([Could not find python, use --with-python to specify the location])]
1371 )
e8c88aa1
SK
1372 fi
1373else
1374 AC_MSG_WARN([python support disabled, building mod_python will fail!])
1375fi
1376
ea0316b8
AT
1377CHECK_ERLANG
1378
7dba19ce
MJ
1379# we never use this, and hard setting it will make cross compile work better
1380ac_cv_file_dbd_apr_dbd_mysql_c=no
1381
42e78242 1382AC_CONFIG_FILES([Makefile
7b3d3f7e
AM
1383 build/Makefile
1384 src/Makefile
1385 src/mod/Makefile
bcd9f49f
MJ
1386 src/mod/applications/mod_abstraction/Makefile
1387 src/mod/applications/mod_avmd/Makefile
1388 src/mod/applications/mod_blacklist/Makefile
1389 src/mod/applications/mod_callcenter/Makefile
1390 src/mod/applications/mod_cidlookup/Makefile
1391 src/mod/applications/mod_cluechoo/Makefile
1392 src/mod/applications/mod_commands/Makefile
1393 src/mod/applications/mod_conference/Makefile
1394 src/mod/applications/mod_curl/Makefile
1395 src/mod/applications/mod_db/Makefile
1396 src/mod/applications/mod_directory/Makefile
1397 src/mod/applications/mod_distributor/Makefile
1398 src/mod/applications/mod_dptools/Makefile
1399 src/mod/applications/mod_easyroute/Makefile
1400 src/mod/applications/mod_enum/Makefile
1401 src/mod/applications/mod_esf/Makefile
1402 src/mod/applications/mod_esl/Makefile
aad61cad 1403 src/mod/applications/mod_expr/Makefile
bcd9f49f
MJ
1404 src/mod/applications/mod_fifo/Makefile
1405 src/mod/applications/mod_fsk/Makefile
1406 src/mod/applications/mod_fsv/Makefile
1407 src/mod/applications/mod_hash/Makefile
1408 src/mod/applications/mod_httapi/Makefile
1409 src/mod/applications/mod_http_cache/Makefile
1410 src/mod/applications/mod_ladspa/Makefile
1411 src/mod/applications/mod_lcr/Makefile
1412 src/mod/applications/mod_limit/Makefile
1413 src/mod/applications/mod_memcache/Makefile
1414 src/mod/applications/mod_mongo/Makefile
1415 src/mod/applications/mod_mp4/Makefile
1416 src/mod/applications/mod_nibblebill/Makefile
1417 src/mod/applications/mod_oreka/Makefile
dc06a039 1418 src/mod/applications/mod_osp/Makefile
bcd9f49f
MJ
1419 src/mod/applications/mod_rad_auth/Makefile
1420 src/mod/applications/mod_random/Makefile
1421 src/mod/applications/mod_redis/Makefile
1422 src/mod/applications/mod_rss/Makefile
1423 src/mod/applications/mod_skel/Makefile
1424 src/mod/applications/mod_sms/Makefile
1425 src/mod/applications/mod_snapshot/Makefile
1426 src/mod/applications/mod_snipe_hunt/Makefile
1427 src/mod/applications/mod_snom/Makefile
1428 src/mod/applications/mod_sonar/Makefile
1429 src/mod/applications/mod_soundtouch/Makefile
1430 src/mod/applications/mod_spandsp/Makefile
1431 src/mod/applications/mod_spy/Makefile
ea181ca4 1432 src/mod/applications/mod_stress/Makefile
bcd9f49f
MJ
1433 src/mod/applications/mod_translate/Makefile
1434 src/mod/applications/mod_valet_parking/Makefile
1435 src/mod/applications/mod_vmd/Makefile
1436 src/mod/applications/mod_voicemail/Makefile
1437 src/mod/applications/mod_voicemail_ivr/Makefile
1438 src/mod/asr_tts/mod_cepstral/Makefile
1439 src/mod/asr_tts/mod_flite/Makefile
1440 src/mod/asr_tts/mod_pocketsphinx/Makefile
1441 src/mod/asr_tts/mod_tts_commandline/Makefile
1442 src/mod/asr_tts/mod_unimrcp/Makefile
1443 src/mod/codecs/mod_amr/Makefile
1444 src/mod/codecs/mod_amrwb/Makefile
1445 src/mod/codecs/mod_b64/Makefile
1446 src/mod/codecs/mod_bv/Makefile
1447 src/mod/codecs/mod_celt/Makefile
1448 src/mod/codecs/mod_codec2/Makefile
17d52112 1449 src/mod/codecs/mod_com_g729/Makefile
bcd9f49f
MJ
1450 src/mod/codecs/mod_dahdi_codec/Makefile
1451 src/mod/codecs/mod_g723_1/Makefile
1452 src/mod/codecs/mod_g729/Makefile
1453 src/mod/codecs/mod_h26x/Makefile
1454 src/mod/codecs/mod_ilbc/Makefile
1455 src/mod/codecs/mod_isac/Makefile
1456 src/mod/codecs/mod_mp4v/Makefile
1457 src/mod/codecs/mod_opus/Makefile
1458 src/mod/codecs/mod_sangoma_codec/Makefile
1459 src/mod/codecs/mod_silk/Makefile
1460 src/mod/codecs/mod_siren/Makefile
1461 src/mod/codecs/mod_skel_codec/Makefile
1462 src/mod/codecs/mod_theora/Makefile
1463 src/mod/codecs/mod_vp8/Makefile
1464 src/mod/dialplans/mod_dialplan_asterisk/Makefile
1465 src/mod/dialplans/mod_dialplan_directory/Makefile
1466 src/mod/dialplans/mod_dialplan_xml/Makefile
1467 src/mod/directories/mod_ldap/Makefile
1468 src/mod/endpoints/mod_alsa/Makefile
1469 src/mod/endpoints/mod_dingaling/Makefile
524c566e 1470 src/mod/endpoints/mod_gsmopen/Makefile
bcd9f49f
MJ
1471 src/mod/endpoints/mod_h323/Makefile
1472 src/mod/endpoints/mod_khomp/Makefile
1473 src/mod/endpoints/mod_loopback/Makefile
1474 src/mod/endpoints/mod_opal/Makefile
59472c23 1475 src/mod/endpoints/mod_portaudio/Makefile
bcd9f49f
MJ
1476 src/mod/endpoints/mod_reference/Makefile
1477 src/mod/endpoints/mod_rtmp/Makefile
ad4eb5e0 1478 src/mod/endpoints/mod_skinny/Makefile
99e55ae0 1479 src/mod/endpoints/mod_skypopen/Makefile
7b3d3f7e 1480 src/mod/endpoints/mod_sofia/Makefile
bcd9f49f
MJ
1481 src/mod/endpoints/mod_unicall/Makefile
1482 src/mod/event_handlers/mod_cdr_csv/Makefile
1483 src/mod/event_handlers/mod_cdr_mongodb/Makefile
1484 src/mod/event_handlers/mod_cdr_pg_csv/Makefile
1485 src/mod/event_handlers/mod_cdr_sqlite/Makefile
1486 src/mod/event_handlers/mod_erlang_event/Makefile
1487 src/mod/event_handlers/mod_event_multicast/Makefile
1488 src/mod/event_handlers/mod_event_socket/Makefile
1489 src/mod/event_handlers/mod_event_test/Makefile
1490 src/mod/event_handlers/mod_format_cdr/Makefile
1491 src/mod/event_handlers/mod_json_cdr/Makefile
1492 src/mod/event_handlers/mod_radius_cdr/Makefile
1493 src/mod/event_handlers/mod_rayo/Makefile
1494 src/mod/event_handlers/mod_snmp/Makefile
c19bb4d1 1495 src/mod/event_handlers/mod_event_zmq/Makefile
bcd9f49f
MJ
1496 src/mod/formats/mod_local_stream/Makefile
1497 src/mod/formats/mod_native_file/Makefile
1498 src/mod/formats/mod_shell_stream/Makefile
1499 src/mod/formats/mod_shout/Makefile
1500 src/mod/formats/mod_sndfile/Makefile
1501 src/mod/formats/mod_ssml/Makefile
1502 src/mod/formats/mod_tone_stream/Makefile
1503 src/mod/formats/mod_vlc/Makefile
59472c23 1504 src/mod/formats/mod_portaudio_stream/Makefile
7b3d3f7e 1505 src/mod/languages/mod_java/Makefile
9b8392bc 1506 src/mod/languages/mod_lua/Makefile
bcd9f49f
MJ
1507 src/mod/languages/mod_managed/Makefile
1508 src/mod/languages/mod_perl/Makefile
7b3d3f7e 1509 src/mod/languages/mod_python/Makefile
b7623326 1510 src/mod/languages/mod_v8/Makefile
bcd9f49f 1511 src/mod/languages/mod_yaml/Makefile
3a273629 1512 src/mod/languages/mod_basic/Makefile
bcd9f49f 1513 src/mod/legacy/languages/mod_lua/Makefile
b0bcc011 1514 src/mod/legacy/languages/mod_spidermonkey/Makefile
bcd9f49f
MJ
1515 src/mod/loggers/mod_console/Makefile
1516 src/mod/loggers/mod_logfile/Makefile
1517 src/mod/loggers/mod_syslog/Makefile
1518 src/mod/say/mod_say_de/Makefile
1519 src/mod/say/mod_say_en/Makefile
1520 src/mod/say/mod_say_es/Makefile
1521 src/mod/say/mod_say_fa/Makefile
1522 src/mod/say/mod_say_fr/Makefile
1523 src/mod/say/mod_say_he/Makefile
1524 src/mod/say/mod_say_hr/Makefile
1525 src/mod/say/mod_say_hu/Makefile
1526 src/mod/say/mod_say_it/Makefile
1527 src/mod/say/mod_say_ja/Makefile
1528 src/mod/say/mod_say_nl/Makefile
1529 src/mod/say/mod_say_pl/Makefile
1530 src/mod/say/mod_say_pt/Makefile
1531 src/mod/say/mod_say_ru/Makefile
1532 src/mod/say/mod_say_sv/Makefile
1533 src/mod/say/mod_say_th/Makefile
1534 src/mod/say/mod_say_zh/Makefile
1535 src/mod/timers/mod_posix_timer/Makefile
1536 src/mod/timers/mod_timerfd/Makefile
1537 src/mod/xml_int/mod_xml_cdr/Makefile
1538 src/mod/xml_int/mod_xml_curl/Makefile
1539 src/mod/xml_int/mod_xml_ldap/Makefile
1540 src/mod/xml_int/mod_xml_radius/Makefile
1541 src/mod/xml_int/mod_xml_rpc/Makefile
1542 src/mod/xml_int/mod_xml_scgi/Makefile
7b3d3f7e
AM
1543 src/include/switch_am_config.h
1544 build/getsounds.sh
1545 build/getlib.sh
17d52112 1546 build/getg729.sh
68b58406 1547 build/freeswitch.pc
7b3d3f7e 1548 build/modmake.rules
3ec53f0b 1549 libs/esl/Makefile
4e734db2 1550 libs/esl/perl/Makefile
719d37db 1551 libs/esl/php/Makefile
af192a2e 1552 libs/xmlrpc-c/include/xmlrpc-c/config.h
7b3d3f7e 1553 libs/xmlrpc-c/xmlrpc_config.h
6b6c83a7
JL
1554 libs/xmlrpc-c/config.mk
1555 libs/xmlrpc-c/srcdir.mk
1556 libs/xmlrpc-c/stamp-h
7b3d3f7e 1557 scripts/gentls_cert])
4da77ea5 1558
a6e9f279 1559AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
db399276 1560AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
fba1c2bf 1561AM_CONDITIONAL(ISFREEBSD, [test `uname -s` = FreeBSD])
a092a55a 1562AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
a6e9f279 1563
bcd9f49f
MJ
1564AM_CONDITIONAL(HAVE_AMR, [ test -d ${switch_srcdir}/libs/amr ])
1565AM_CONDITIONAL(HAVE_AMRWB, [ test -d ${switch_srcdir}/libs/amrwb ])
1566AM_CONDITIONAL(HAVE_G723_1, [ test -d ${switch_srcdir}/libs/libg723_1 ])
1567AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ])
1568
c7753b06
MJ
1569#some vars to sub into the Makefile.am's
1570#LIBS+=> core.log || error="yes";if test -n "$(VERBOSE)" -o "$$error" = "yes";then cat core.log;fi;if test "$$error" = "yes";then exit 1;fi
1a2a79d0 1571LIBTOOL='$(SHELL) $(switch_builddir)/libtool'
c7753b06 1572TOUCH_TARGET='if test -f "$@";then touch "$@";fi;'
afe7d97f 1573CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed -e "s|^.*/||" | sort | uniq )'
b9f2bdfb 1574CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed -e "s|^.*/||" | sort | uniq )'
afe7d97f
MJ
1575OUR_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
1576OUR_CLEAN_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
1577OUR_INSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
1578OUR_UNINSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
1579OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
1580OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
1581OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
1582OUR_DISABLED_UNINSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
ed960392
AM
1583
1584AM_MAKEFLAGS='"OUR_MODULES=$(OUR_MODS)" "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" `test -n "$(VERBOSE)" || echo -s`'
5f053e18 1585#AM_MAKEFLAGS='`test -n "$(VERBOSE)" || echo -s`'
c7753b06
MJ
1586AC_SUBST(LIBTOOL)
1587AC_SUBST(TOUCH_TARGET)
ed960392 1588AC_SUBST(CONF_DISABLED_MODULES)
5f053e18 1589AC_SUBST(CONF_MODULES)
ed960392 1590
5f053e18
MJ
1591AC_SUBST(OUR_MODS)
1592AC_SUBST(OUR_CLEAN_MODS)
1593AC_SUBST(OUR_INSTALL_MODS)
1594AC_SUBST(OUR_UNINSTALL_MODS)
ed960392
AM
1595AC_SUBST(OUR_DISABLED_MODS)
1596AC_SUBST(OUR_DISABLED_CLEAN_MODS)
1597AC_SUBST(OUR_DISABLED_INSTALL_MODS)
1598AC_SUBST(OUR_DISABLED_UNINSTALL_MODS)
c7753b06
MJ
1599AC_SUBST(AM_MAKEFLAGS)
1600
03844dcb 1601ac_configure_args="$ac_configure_args CONFIGURE_CFLAGS='$CFLAGS $CPPFLAGS' CONFIGURE_CXXFLAGS='$CXXFLAGS $CPPFLAGS' CONFIGURE_LDFLAGS='$LDFLAGS' "
452b0bde 1602
40ff9a41
MJ
1603# --prefix='$prefix' --exec_prefix='$exec_prefix' --libdir='$libdir' --libexecdir='$libexecdir' --bindir='$bindir' --sbindir='$sbindir' \
1604# --localstatedir='$localstatedir' --datadir='$datadir'"
8f9ab613 1605
46f6981d 1606# Run configure in all the subdirs
236bfeea 1607AC_CONFIG_SUBDIRS([libs/srtp])
48712895
TC
1608if test "$use_system_apr" != "yes"; then
1609 AC_CONFIG_SUBDIRS([libs/apr])
1610fi
1611if test "$use_system_aprutil" != "yes"; then
1612 AC_CONFIG_SUBDIRS([libs/apr-util])
1613fi
236bfeea 1614AC_CONFIG_SUBDIRS([libs/ilbc])
236bfeea
MJ
1615AC_CONFIG_SUBDIRS([libs/iksemel])
1616AC_CONFIG_SUBDIRS([libs/js/nsprpub])
1617AC_CONFIG_SUBDIRS([libs/js])
1618AC_CONFIG_SUBDIRS([libs/libdingaling])
1619AC_CONFIG_SUBDIRS([libs/libsndfile])
1620AC_CONFIG_SUBDIRS([libs/sofia-sip])
236bfeea
MJ
1621AC_CONFIG_SUBDIRS([libs/portaudio])
1622AC_CONFIG_SUBDIRS([libs/openzap])
1623AC_CONFIG_SUBDIRS([libs/freetdm])
1624AC_CONFIG_SUBDIRS([libs/unimrcp])
1625AC_CONFIG_SUBDIRS([libs/tiff-4.0.2])
1626AC_CONFIG_SUBDIRS([libs/spandsp])
1627AC_CONFIG_SUBDIRS([libs/broadvoice])
1628AC_CONFIG_SUBDIRS([libs/libg722_1])
1629AC_CONFIG_SUBDIRS([libs/silk])
1630AC_CONFIG_SUBDIRS([libs/libcodec2])
1631if test "x${enable_zrtp}" = "xyes"; then
e5a1b54e 1632 AC_CONFIG_SUBDIRS([libs/libzrtp])
393b63b7 1633fi
ee3fc89f 1634
f6fe2667 1635case $host in
fb41b0f6
BW
1636 *-openbsd*|*-netbsd*)
1637 # libtool won't link static libs against shared ones on NetBSD/OpenBSD unless we tell it not to be stupid
f6fe2667
MJ
1638 AC_CONFIG_COMMANDS([hacklibtool], [cp libtool libtool.orig && sed -e "s/deplibs_check_method=.*/deplibs_check_method=pass_all/g" libtool.orig > libtool])
1639 ;;
1640esac
1641
1642
6e81dda1 1643AC_OUTPUT
5ccac21d 1644
1ed00b4d
BW
1645##
1646## Registering for ClueCon
1647##
4ff9b2f1 1648if ! test -f noreg ; then
1ed00b4d
BW
1649echo ""
1650echo ""
1651echo $ECHO_N "Registering you for ClueCon http://www.cluecon.com $ECHO_C" 1>&6
82f77413 1652sleep 1
1ed00b4d 1653echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1654sleep 1
1ed00b4d 1655echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1656sleep 1
1ed00b4d 1657AC_MSG_RESULT([ See you in August. ;-)])
1ed00b4d 1658echo ""
17d52112 1659fi
1ed00b4d 1660
5ccac21d
MJ
1661##
1662## Configuration summary
1663##
1664
1665echo
8912b80e 1666echo "-------------------------- FreeSWITCH configuration --------------------------"
5ccac21d
MJ
1667echo ""
1668echo " Locations:"
fd1b0279 1669echo " FHS enabled: ${enable_fhs}"
5ccac21d
MJ
1670echo ""
1671echo " prefix: ${prefix}"
1672echo " exec_prefix: ${exec_prefix}"
1673echo " bindir: ${bindir}"
fd1b0279 1674echo " sysconfdir: ${sysconfdir}"
5ccac21d 1675echo " libdir: ${libdir}"
fd1b0279
TC
1676echo ""
1677echo " certsdir: ${certsdir}"
1678echo " dbdir: ${dbdir}"
1679echo " grammardir: ${grammardir}"
1680echo " htdocsdir: ${htdocsdir}"
1681echo " logfiledir: ${logfiledir}"
5ccac21d 1682echo " modulesdir: ${modulesdir}"
fd1b0279
TC
1683echo " pkgconfigdir: ${pkgconfigdir}"
1684echo " recordingsdir: ${recordingsdir}"
5ccac21d 1685echo " runtimedir: ${runtimedir}"
fd1b0279
TC
1686echo " scriptdir: ${scriptdir}"
1687echo " soundsdir: ${soundsdir}"
1688echo " storagedir: ${storagedir}"
5ccac21d 1689echo ""
8912b80e 1690echo "------------------------------------------------------------------------------"