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