]> git.ipfire.org Git - thirdparty/freeswitch.git/blame - configure.ac
FS-7180: when using system lua, properly link against renamed library versions on...
[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
07d09b78 520AC_ARG_ENABLE([system-lua],[AS_HELP_STRING([--enable-system-lua],[use system lib for lua])],,[enable_system_lua="no"])
861961bd
BW
521if test "${enable_system_lua}" = "yes" ; then
522 PKG_CHECK_MODULES([LUA],[lua5.2],[have_lua=yes],[have_lua=no])
523 if test "${have_lua}" = "no" ; then
524 PKG_CHECK_MODULES([LUA],[lua5.1],[have_lua=yes],[have_lua=no])
525 fi
526 if test "${have_lua}" = "no" ; then
527 PKG_CHECK_MODULES([LUA],[lua],[have_lua=yes],[have_lua=no])
528 fi
529 if test x"${LUA_LIBS}" = x"" ; then
530 LUA_LIBS="-llua"
531 fi
532fi
07d09b78
MJ
533AM_CONDITIONAL([SYSTEM_LUA],[test "${enable_system_lua}" = "yes"])
534
a8b87ffe
AM
535AC_ARG_ENABLE(srtp,
536[AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"])
537
538AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"])
539
810717ca
AM
540have_openal=no
541AC_CHECK_LIB(openal, alMidiGainSOFT, [have_openal="yes"])
542AM_CONDITIONAL([HAVE_OPENAL],[test "${have_openal}" = "yes"])
543
861bd209
BW
544AC_ARG_ENABLE(zrtp,
545 [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"])
546if test "x$enable_zrtp" = "xyes" ; then
393b63b7 547 LIBS="-lpthread $LIBS"
861bd209
BW
548 APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
549fi
ae67ecce 550
c4d13331
MJ
551PA_LIBS=
552
553PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
554if test "x$have_jack" = "xyes" ; then
555PA_LIBS+=$JACK_LIBS
556fi
557
ae67ecce 558AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
1911a262 559if test "x$have_alsa" = "xyes" ; then
c4d13331 560PA_LIBS+=-lasound
ae67ecce 561fi
c4d13331
MJ
562
563AC_SUBST(PA_LIBS)
ae67ecce 564
861bd209
BW
565AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"])
566
a4a52620
SK
567AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
568
ab2bc7c6
TC
569AC_ARG_ENABLE(core-odbc-support,
570 [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support (default is optional)])],,[enable_core_odbc_support="optional"])
571if ! test "$enable_core_odbc_support" = "no"; then
572 AX_LIB_ODBC
573 if test "$ac_cv_found_odbc" = "yes" ; then
574 enable_core_odbc_support="yes"
575 elif test "$enable_core_odbc_support" = "yes"; then
576 AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent])
577 else
578 enable_core_odbc_support="no"
579 fi
ffc8e81b
TC
580fi
581
6e9fa3ba
AM
582CHECK_LIBUUID
583SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS"
584SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS"
585
5cb354dd
EG
586AC_ARG_ENABLE(core-pgsql-support,
587 [AS_HELP_STRING([--enable-core-pgsql-support], [Compile with PGSQL Support])],,[enable_core_pgsql_support="no"])
ba052c22 588AC_ARG_ENABLE(core-pgsql-pkgconfig,
299081ed 589 [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
590
591if test x"$enable_core_pgsql_support" = x"yes" ; then
ba052c22
TC
592 AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
593 AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
ba052c22
TC
594 if test "$PKG_CONFIG" = "no" \
595 || test x"$enable_core_pgsql_pkgconfig" = x"no" \
596 || ! pkg-config libpq; then
81185aa9
KR
597 if test "$PG_CONFIG" != "no"; then
598 AC_MSG_CHECKING([for PostgreSQL libraries via pg_config])
599 POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
600 POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`"
601 POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
285e7dc3
KR
602 POSTGRESQL_VERSION=`$PG_CONFIG --version | awk '{ print $NF }'`
603 POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $1 }'`
604 POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $2 }'`
605 POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'`
81185aa9
KR
606 else
607 AC_MSG_ERROR([no usable pkg-config or pg_config; please install libpq devel package or equivalent])
608 fi
ba052c22 609 else
81185aa9
KR
610 AC_MSG_CHECKING([for PostgreSQL libraries via pkg_config])
611 POSTGRESQL_CFLAGS="`$PKG_CONFIG --cflags libpq`"
612 POSTGRESQL_LIBDIR="`$PKG_CONFIG libpq --libs-only-L`"
ba052c22
TC
613 POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
614 POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
1933c7cb
TC
615 POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
616 POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
617 POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3 | sed 's/^\([[0-9]]*\)[[^0-9]].*/\1/'`"
618 test -n "$POSTGRESQL_PATCH_VERSION" || POSTGRESQL_PATCH_VERSION=0
ba052c22 619 fi
81185aa9
KR
620 save_LIBS="$LIBS"
621 LIBS="$POSTGRESQL_LIBDIR $LIBS"
622 AC_MSG_RESULT([$POSTGRESQL_LIBDIR])
623
ba052c22 624 AC_DEFINE([SWITCH_HAVE_PGSQL], [1], [Define to 1 if PostgreSQL libraries are available])
bb84b053 625 AM_CONDITIONAL([HAVE_PGSQL],[true])
ba052c22
TC
626 AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
627 AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
628 AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
629 AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
81185aa9 630
ba052c22
TC
631 AC_CHECK_LIB([pq], [PQgetvalue],, AC_MSG_ERROR([no usable libpq; please install PostgreSQL devel package or equivalent]))
632 AC_MSG_RESULT([yes])
81185aa9 633 SWITCH_AM_CXXFLAGS="$POSTGRESQL_CFLAGS $SWITCH_AM_CXXFLAGS"
ba052c22 634 SWITCH_AM_LDFLAGS="$POSTGRESQL_LDFLAGS $SWITCH_AM_LDFLAGS"
81185aa9
KR
635
636 LIBS="$save_LIBS"
bb84b053
TC
637else
638 AM_CONDITIONAL([HAVE_PGSQL],[false])
5cb354dd 639fi
25c725c2 640
603f3eff
MJ
641AC_ARG_ENABLE(deprecated-core-db-events,
642 [AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"])
643
644if test x"$enable_deprecated_core_db_events" = x"yes" ; then
645 AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events])
646fi
647
f2067001
BW
648ESL_LDFLAGS=
649PLATFORM_CORE_LDFLAGS=
650PLATFORM_CORE_LIBS=
d28b2391 651
3b1278a3 652path_remove () {
aef982dd 653 echo "$1" | tr ':' '\n' | grep -Fxv "$2" | tr '\n' ':' | sed 's/:$//'
3b1278a3
TC
654}
655path_push_unique () {
656 x="$(eval echo \$$1)"
657 x="$(path_remove "$x" "$2")"
0a56e643
TC
658 if test -z "$x"; then
659 eval export $1="$2"
660 else
661 eval export $1="$2:$x"
662 fi
3b1278a3
TC
663}
664
55b3e6cb
MJ
665# tweak platform specific flags
666case "$host" in
5dee5ce1
BW
667 *darwin*)
668 # Common Apple Darwin settings
0952a99a 669 APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
0952a99a 670 APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
ec044e62 671 APR_ADDTO(CPPFLAGS, -I/usr/local/opt/openssl/include)
85d6b9af 672 APR_ADDTO(LDFLAGS, -L/usr/local/opt/openssl/lib)
5dee5ce1
BW
673 if test "x$enable_core_odbc_support" != "xno"; then
674 APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
9a9ba4c3 675 fi
cdabd564 676 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
5dee5ce1
BW
677 # Get OSX and clang version
678 osxvrm=`sw_vers -productVersion` # Get version.release.modlevel
679 osxrel=`echo $osxvrm | cut -d. -f2` # Get release only
680 clangvers="`clang -v 2>&1 >/dev/null | grep version | sed -e 's/.*version \([[0-9]]*\).*$/\1/'`"
681 if test "$clangvers" -ge 6; then # Xcode 6 drops std lib search, add it to clang
682 APR_ADDTO(LDFLAGS, -L/usr/local/lib)
683 APR_ADDTO(CPPFLAGS, -I/usr/local/include)
684 fi
685 if test "$clangvers" -ge 4; then # Xcode 4 / 10.7 and up
686 APR_ADDTO(CFLAGS, -Wno-deprecated-declarations)
687 fi
688 if test "$osxrel" -ge 6; then # 10.6 and up
689 APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp)
690 APR_ADDTO(LDFLAGS, -pipe -bind_at_load)
691 APR_ADDTO(CXXFLAGS, -pipe)
692 fi
55b3e6cb
MJ
693 ;;
694 *-solaris2*)
148f67e0 695 if test "${enable_64}" = "yes"; then
ec044e62 696 APR_ADDTO(CPPFLAGS, [-I/opt/64/include])
148f67e0 697 APR_ADDTO(LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib])
4dddcafc
BW
698 APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/64/include])
699 APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/64/lib -Wl,-rpath,/opt/64/lib])
148f67e0 700 else
ec044e62 701 APR_ADDTO(CPPFLAGS, [-I/opt/include])
148f67e0
BW
702 APR_ADDTO(LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib])
703 APR_ADDTO(SWITCH_AM_CFLAGS, [-I/opt/include])
704 APR_ADDTO(SWITCH_AM_LDFLAGS, [-L/opt/lib -Wl,-rpath,/opt/lib])
705 fi
cb1cb69e 706 APR_ADDTO(SWITCH_AM_CFLAGS, -DPATH_MAX=2048 -D__EXTENSIONS__)
54a9eba4 707 APR_ADDTO(SWITCH_AM_LDFLAGS, -lsendfile -lresolv -lsocket -lnsl -luuid)
bb33c4e7 708 APR_ADDTO(ESL_LDFLAGS, -lnsl -lsocket)
a48da3b4 709 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt -lsendfile -lresolv -lsocket -lnsl -luuid])
55b3e6cb 710 ;;
4f2e0f19 711 *dragonfly*)
ec044e62 712 APR_ADDTO(CPPFLAGS, -I/usr/local/include)
4f2e0f19
MJ
713 APR_ADDTO(LDFLAGS, -L/usr/local/lib)
714 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
715 ;;
eab96981 716 *openbsd*)
ec044e62 717 APR_ADDTO(CPPFLAGS, -I/usr/local/include)
eab96981
MJ
718 APR_ADDTO(LDFLAGS, -L/usr/local/lib)
719 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
720 ;;
a91ba93d 721 *netbsd*)
ec044e62 722 APR_ADDTO(CPPFLAGS, -I/usr/pkg/include)
783a4083 723 APR_ADDTO(LDFLAGS, [-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib])
a91ba93d
BW
724 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/pkg/include)
725 ;;
f0b58efb 726 *bsd*)
ec044e62 727 APR_ADDTO(CPPFLAGS, -I/usr/local/include)
ec718814 728 APR_ADDTO(LDFLAGS, -L/usr/local/lib)
f0b58efb 729 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
041e3bf0 730 APR_ADDTO([PLATFORM_CORE_LIBS], [-lcrypt -lrt])
a48da3b4
SK
731 ;;
732 *linux*)
733 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt])
f0b58efb 734 ;;
55b3e6cb
MJ
735esac
736
514bde18
MJ
737APR_REMOVEFROM(SWITCH_AM_CXXFLAGS, -std=c99)
738
9b85b9c9
MJ
739AC_CHECK_LIB(z, inflateReset, have_libz=yes, AC_MSG_ERROR([no usable zlib; please install zlib devel package or equivalent]))
740if test "x$have_libz" = "xyes" ; then
741APR_ADDTO([PLATFORM_CORE_LIBS], [-lz])
742fi
743
48712895
TC
744AC_CHECK_LIB(apr-1, apr_pool_mutex_set, use_system_apr=yes, use_system_apr=no)
745AM_CONDITIONAL([SYSTEM_APR],[test "${use_system_apr}" = "yes"])
746AC_CHECK_LIB(aprutil-1, apr_queue_pop_timeout, use_system_aprutil=yes, use_system_aprutil=no)
747AM_CONDITIONAL([SYSTEM_APRUTIL],[test "${use_system_aprutil}" = "yes"])
748
a1d73dfd
CR
749save_LIBS="$LIBS"
750LIBS=
9b85b9c9
MJ
751AC_CHECK_LIB(jpeg, jpeg_std_error,, AC_MSG_ERROR([no usable libjpeg; please install libjpeg devel package or equivalent]))
752
753AC_CHECK_LIB(jbig, jbg_enc_out, have_libjbig=yes, have_libjbig=no)
754if test "x$have_libjbig" = "xyes" ; then
a1d73dfd 755SPANDSP_LA_JBIG="-ljbig $LIBS"
9b85b9c9
MJ
756AC_SUBST(SPANDSP_LA_JBIG)
757fi
a1d73dfd 758LIBS="$save_LIBS"
9b85b9c9
MJ
759
760AC_CHECK_LIB(lzma, lzma_code, have_liblzma=yes, have_liblzma=no)
761if test "x$have_liblzma" = "xyes" ; then
762SPANDSP_LA_LZMA="-llzma"
763AC_SUBST(SPANDSP_LA_LZMA)
764fi
765
766AC_CHECK_LIB(resolv, res_init, have_libresolv=yes, have_libresolv=no)
767if test "x$have_libresolv" = "xyes" ; then
768APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv)
769fi
770
55b3e6cb 771AC_SUBST(SWITCH_AM_CFLAGS)
02c7a3ac 772AC_SUBST(SWITCH_ANSI_CFLAGS)
514bde18 773AC_SUBST(SWITCH_AM_CXXFLAGS)
55b3e6cb 774AC_SUBST(SWITCH_AM_LDFLAGS)
3ec59cdb 775AC_SUBST(ESL_LDFLAGS)
a48da3b4
SK
776AC_SUBST(PLATFORM_CORE_LDFLAGS)
777AC_SUBST(PLATFORM_CORE_LIBS)
6bc48b70 778AC_SUBST(SOLINK)
02141e30 779AC_SUBST(LIBTOOL_LIB_EXTEN)
6bc48b70 780
4da77ea5
AM
781# Checks for header files.
782AC_HEADER_DIRENT
783AC_HEADER_STDC
ece5cd52 784AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h execinfo.h])
56008e2b 785
56008e2b
AM
786if test x"$ac_cv_header_wchar_h" = xyes; then
787 HAVE_WCHAR_H_DEFINE=1
788else
789 HAVE_WCHAR_H_DEFINE=0
790fi
791AC_SUBST(HAVE_WCHAR_H_DEFINE)
4da77ea5 792
6b6c83a7
JL
793# Needed by Abyss on Solaris:
794
795if test x"$ac_cv_header_sys_filio_h" = xyes; then
796 HAVE_SYS_FILIO_H_DEFINE=1
797else
798 HAVE_SYS_FILIO_H_DEFINE=0
799fi
800AC_SUBST(HAVE_SYS_FILIO_H_DEFINE)
801
802# Needed by Abyss on Solaris:
803
804if test x"$ac_cv_header_sys_ioctl_h" = xyes; then
805 HAVE_SYS_IOCTL_H_DEFINE=1
806else
807 HAVE_SYS_IOCTL_H_DEFINE=0
808fi
809AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
810
811if test x"$ac_cv_header_sys_select_h" = xyes; then
812 HAVE_SYS_SELECT_H_DEFINE=1
813else
814 HAVE_SYS_SELECT_H_DEFINE=0
815fi
816AC_SUBST(HAVE_SYS_SELECT_H_DEFINE)
817
4da77ea5
AM
818# Checks for typedefs, structures, and compiler characteristics.
819AC_C_CONST
820AC_C_INLINE
821AC_TYPE_SIZE_T
822AC_HEADER_TIME
823AC_STRUCT_TM
824
825# Checks for library functions.
826AC_PROG_GCC_TRADITIONAL
a7bf6f8d 827AC_FUNC_MALLOC
4da77ea5
AM
828AC_TYPE_SIGNAL
829AC_FUNC_STRFTIME
a2921e26 830AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt poll])
ea5c0c21 831AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups])
4062b636 832AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp])
b382c0a4 833
8bcf3b4f
SK
834# Check availability and return type of strerror_r
835# (NOTE: apr-1-config sets -D_GNU_SOURCE at build-time, need to run the check with it too)
836save_CPPFLAGS="$CPPFLAGS"
837CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
838AC_FUNC_STRERROR_R
839CPPFLAGS="$save_CPPFLAGS"
840
ea5c0c21
MJ
841AX_HAVE_CPU_SET
842
eb9f9fb2 843AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
d314f254 844AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])])
eb9f9fb2 845AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
6627dc86 846AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
5f469ad2 847
4062b636 848AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
eb9f9fb2 849
d91f67d0
AM
850AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
851AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
852
bf988471 853AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
21159328
MJ
854#include <sys/types.h>
855#include <time.h>])
856
bf988471 857AC_CHECK_MEMBERS([struct tm.tm_zone],,,[
21159328
MJ
858#include <sys/types.h>
859#include <time.h>])
860
b382c0a4
MJ
861AC_CHECK_DECL([RLIMIT_MEMLOCK],
862 [AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],,
863 [#ifdef HAVE_SYS_RESOURCE_H
864 #include <sys/resource.h>
865 #endif])
866
867AC_CHECK_DECL([SCHED_RR],
868 [AC_DEFINE([HAVE_SCHED_RR],[1],[SCHED_RR constant for sched_setscheduler])],,
869 [#ifdef HAVE_SCHED_H
870 #include <sched.h>
871 #endif])
872
817439d7
AM
873AC_CHECK_DECL([SCHED_FIFO],
874 [AC_DEFINE([HAVE_SCHED_FIFO],[1],[SCHED_FIFO constant for sched_setscheduler])],,
875 [#ifdef HAVE_SCHED_H
876 #include <sched.h>
877 #endif])
878
b382c0a4
MJ
879#
880# use mlockall only on linux (for now; if available)
881#
882if test "x${ac_cv_func_mlockall}" = "xyes"; then
883 AC_MSG_CHECKING([whether to use mlockall])
884 case "$host" in
885 *-linux-*)
886 AC_DEFINE([USE_MLOCKALL],[1],[Enable mlockall support])
887 AC_MSG_RESULT([yes])
888 USE_MLOCKALL=yes
889 ;;
890 *-freebsd*)
883de14f
JL
891 APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
892 APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
b382c0a4
MJ
893 AC_MSG_RESULT([no, broken for non-root users])
894 ;;
895 *)
896 AC_MSG_RESULT([no])
897 ;;
898 esac
899
900 #
901 # setrlimit prerequisites
902 #
903 if test "x${USE_MLOCKALL}" = "xyes" -a \
904 "x${ac_cv_func_setrlimit}" = "xyes" -a \
905 "x${ac_cv_have_decl_RLIMIT_MEMLOCK}" = "xyes"
906 then
907 AC_DEFINE([USE_SETRLIMIT],[1],[Use setrlimit to disable mlock limit for non-root users])
908 fi
909fi
910
911#
912# sched_setcheduler + round-robin scheduler prerequisites
913#
914if test "x${ac_cv_func_sched_setscheduler}" = "xyes" -a \
915 "x${ac_cv_have_decl_SCHED_RR}" = "xyes"
916then
917 AC_DEFINE([USE_SCHED_SETSCHEDULER],[1],[Enable round-robin scheduler using sched_setscheduler])
918fi
4062b636
AM
919#
920# xmlrpc-c checks
921#
922
6b6c83a7 923AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull)
4062b636
AM
924
925HAVE_LIBWWW_SSL_DEFINE=0
926AC_SUBST(HAVE_LIBWWW_SSL_DEFINE)
927
928DIRECTORY_SEPARATOR="/"
929AC_SUBST(DIRECTORY_SEPARATOR)
930
931va_list_is_array=no
932AC_MSG_CHECKING(whether va_list is an array)
933AC_TRY_COMPILE([
934#include <stdarg.h>
935], [va_list list1, list2; list1 = list2;], ,
936va_list_is_array=yes)
937AC_MSG_RESULT($va_list_is_array)
938if test x"$va_list_is_array" = xyes; then
939 VA_LIST_IS_ARRAY_DEFINE=1
940else
941 VA_LIST_IS_ARRAY_DEFINE=0
942fi
943AC_SUBST(VA_LIST_IS_ARRAY_DEFINE)
944
554f476c 945
4062b636
AM
946AC_MSG_CHECKING(whether compiler has __attribute__)
947AC_TRY_COMPILE(, [int x __attribute__((__unused__));],
948compiler_has_attribute=yes,
949compiler_has_attribute=no)
950AC_MSG_RESULT($compiler_has_attribute)
951if test x"$compiler_has_attribute" = xyes; then
952 ATTR_UNUSED="__attribute__((__unused__))"
953else
954 ATTR_UNUSED=
955fi
956AC_SUBST(ATTR_UNUSED)
957
958
554f476c
MJ
959saved_CFLAGS="$CFLAGS"
960AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [
961CFLAGS="$CFLAGS -Wdeclaration-after-statement"
962AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no])
963])
964AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement)
965if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then
966 APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wdeclaration-after-statement)
967fi
968CFLAGS="$saved_CFLAGS"
4da77ea5 969
c7ccf84a
MJ
970if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
971 # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off
972 AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [
973 AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no])
974 ])
975 AC_MSG_RESULT($ac_cv_clang_extended_offsetof)
976 if test x"$ac_cv_clang_extended_offsetof" = xyes; then
977 APR_ADDTO(CFLAGS, -Wno-extended-offsetof)
978 fi
44d5d43b
MJ
979fi
980
eb8ff5a0
MOC
981# Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready
982# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_skypopen mod_h323 mod_khomp
983# mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed
984#
985#saved_CFLAGS="$CFLAGS"
986#AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [
987#CFLAGS="$CFLAGS -Wunused-but-set-variable"
988#AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no])
989#])
990#AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable)
991#if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then
992# APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wunused-but-set-variable)
993#fi
994#CFLAGS="$saved_CFLAGS"
f952719e 995
44cc7d5c 996AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
49a0eb29 997
42e78242
MJ
998# Checks for integer size
999AC_CHECK_SIZEOF(char, 1)
1000AC_CHECK_SIZEOF(int, 4)
1001AC_CHECK_SIZEOF(long, 4)
1002AC_CHECK_SIZEOF(short, 2)
1003AC_CHECK_SIZEOF(long long, 8)
1004AC_TYPE_SIZE_T
1005AC_CHECK_TYPE(ssize_t, int)
1006
1007# Checks for pointer size
1008AC_CHECK_SIZEOF(void*, 4)
1009
1010if test "x$ac_cv_sizeof_voidp" != "x"; then
1011 voidp_size=$ac_cv_sizeof_voidp
1012else
1013 AC_ERROR([Cannot determine size of void*])
1014fi
1015
1016if test "$ac_cv_sizeof_short" = "2"; then
1017 short_value=short
1018fi
1019if test "$ac_cv_sizeof_int" = "4"; then
1020 int_value=int
1021fi
1022
1023if test "$ac_cv_sizeof_int" = "8"; then
1024 int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
1025 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
1026 int64_value="int"
1027 long_value=int
1028elif test "$ac_cv_sizeof_long" = "8"; then
1029 int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
1030 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
1031 int64_value="long"
1032 long_value=long
764b7958 1033 case "$host" in
44410b71
BW
1034 *pc-solaris2*)
1035 ;;
f6fe2667 1036 *-solaris2*|*apple-darwin*|*-openbsd*)
764b7958
MJ
1037 if test "$ac_cv_sizeof_long_long" = "8"; then
1038 int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
1039 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
1040 int64_value="long long"
1041 long_value="long long"
1042 fi
1043 ;;
1044 esac
42e78242
MJ
1045elif test "$ac_cv_sizeof_long_long" = "8"; then
1046 int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
1047 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
1048 int64_value="long long"
1049 long_value="long long"
1050elif test "$ac_cv_sizeof_longlong" = "8"; then
1051 int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
1052 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
1053 int64_value="__int64"
1054 long_value="__int64"
1055else
1056 AC_ERROR([could not detect a 64-bit integer type])
1057fi
1058
1059if test "$ac_cv_type_size_t" = "yes"; then
1060 size_t_value="size_t"
1061else
1062 size_t_value="switch_int32_t"
1063fi
1064
1065if test "$ac_cv_type_ssize_t" = "yes"; then
1066 ssize_t_value="ssize_t"
1067else
1068 ssize_t_value="switch_int32_t"
1069fi
1070
1071APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
1072
1073if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
1074 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
1075elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
1076 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1077else
1078 ssize_t_fmt='#error Can not determine the proper size for ssize_t'
1079fi
1080
1081APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
1082
1083if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
1084 size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
1085elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
1086 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
1087else
d90bac38 1088 size_t_fmt='#define SWITCH_SIZE_T_FMT "zu"'
42e78242
MJ
1089fi
1090
1091# Basically, we have tried to figure out the correct format strings
1092# for SWITCH types which vary between platforms, but we don't always get
1093# it right. If you find that we don't get it right for your platform,
1094# you can override our decision below.
1095# NOTE: borrowed much of this logic from apr.
1096case $host in
1097 s390*linux*)
1098 # uniquely, the 31-bit Linux/s390 uses "unsigned long int"
1099 # for size_t rather than "unsigned int":
1100 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
1101 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1102 ;;
1103 *-os2*)
1104 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
1105 ;;
6d66ecfd
MJ
1106 *-openbsd*)
1107 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
1108 ;;
42e78242
MJ
1109 *aix4*|*aix5*)
1110 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1111 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
1112 ;;
1113 *beos*)
1114 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1115 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
1116 ;;
1117 *apple-darwin*)
5dee5ce1
BW
1118 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
1119 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
42e78242
MJ
1120 ;;
1121esac
1122
1123AC_SUBST(voidp_size)
1124AC_SUBST(short_value)
1125AC_SUBST(int_value)
1126AC_SUBST(long_value)
1127AC_SUBST(int64_value)
1128AC_SUBST(size_t_value)
1129AC_SUBST(ssize_t_value)
1130AC_SUBST(int64_t_fmt)
1131AC_SUBST(uint64_t_fmt)
1132AC_SUBST(ssize_t_fmt)
1133AC_SUBST(size_t_fmt)
42e78242 1134
f6fe2667
MJ
1135case $host in
1136 *-openbsd*)
1137 # OpenBSD's gunzip and friends don't like -d because its redundant, only gzip does
1138 AC_PATH_PROGS(ZCAT, gzip)
1139 ;;
1140 *)
1141 AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat)
1142 ;;
1143esac
1144
50328a66
TC
1145AC_PATH_PROGS(BZIP, bzip2)
1146AC_PATH_PROGS(XZ, xz)
bc34fb76
MJ
1147AC_PATH_PROGS(TAR, gtar tar)
1148AC_PATH_PROGS(WGET, wget)
1149AC_PATH_PROGS(CURL, curl)
d2cf7f86 1150GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getlib.sh"
c99d8c9b 1151AC_SUBST(GETLIB)
17d52112
MJ
1152GETG729="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getg729.sh"
1153AC_SUBST(GETG729)
d2cf7f86 1154GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh"
3d5fcabe 1155AC_SUBST(GETSOUNDS)
c99d8c9b 1156
d1045b12
MJ
1157case $host in
1158 *-darwin*)
1159 path_push_unique PKG_CONFIG_PATH /usr/local/opt/curl/lib/pkgconfig
169a264c 1160 path_push_unique PKG_CONFIG_PATH /usr/local/opt/sqlite/lib/pkgconfig/
7da28a24 1161 path_push_unique PKG_CONFIG_PATH /usr/local/opt/ldns/lib/pkgconfig/
b186ca9f 1162 path_push_unique PKG_CONFIG_PATH /usr/local/opt/portaudio/lib/pkgconfig/
d1045b12
MJ
1163 ;;
1164esac
1165
c006db6f 1166if ! (test -x "$PKG_CONFIG" || test -x "$(which pkg-config)"); then
c96c733e
TC
1167 AC_MSG_ERROR([You need to install pkg-config to configure FreeSWITCH.])
1168fi
1169
cd650f60 1170# temporary workaround for Debian libldns-dev package bug
a3e1b7df 1171if test "$cross_compiling" != "yes" && test -f /usr/lib/pkg-config/libldns.pc; then
cd650f60
TC
1172 path_push_unique PKG_CONFIG_PATH /usr/lib/pkg-config
1173fi
1174
9d99c346
TC
1175module_enabled() {
1176 grep -v -e "\#" -e "^\$" modules.conf | sed -e "s|^.*/||" | grep "^${1}\$" >/dev/null
1177}
1178
bcfb72cb 1179PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20])
ad094b7a 1180PKG_CHECK_MODULES([CURL], [libcurl >= 7.19])
74da7aaf 1181PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
b283db63 1182PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1])
f9d065cd
TC
1183PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[
1184 AM_CONDITIONAL([HAVE_YAML],[true])],[
c86b939f 1185 AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_YAML],[false])])
a0e19e1c
TC
1186PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0 >= 19],[
1187 AM_CONDITIONAL([HAVE_PORTAUDIO],[true])],[
1188 AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PORTAUDIO],[false])])
cd650f60
TC
1189PKG_CHECK_MODULES([LDNS], [libldns >= 1.6.6],[
1190 AM_CONDITIONAL([HAVE_LDNS],[true])],[
c44404d4
TC
1191 AC_CHECK_LIB([ldns], [ldns_str2rdf_a], [LDNS_LIBS=-lldns])
1192 AS_IF([test -z "$LDNS_LIBS"],[
9d99c346
TC
1193 if module_enabled mod_enum; then
1194 AC_MSG_ERROR([You need to either install libldns-dev or disable mod_enum in modules.conf])
1195 else
1196 AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false])
1197 fi],[
c44404d4 1198 AM_CONDITIONAL([HAVE_LDNS],[true])])])
4d62a1ad 1199
4bdb7129
JLC
1200PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 0.31],[
1201 AM_CONDITIONAL([HAVE_MEMCACHED],[true])
1202 MEMCACHED_LIBS="${MEMCACHED_LIBS} -lpthread"
1203 save_LIBS="${LIBS}"
1204 save_CPPFLAGS="${CPPFLAGS}"
1205 LIBS="${MEMCACHED_LIBS}"
1206 CPPFLAGS="${MEMCACHED_CFLAGS}"
1207 AC_CHECK_FUNCS([memcached_server_name memcached_stat_execute])
1208 AC_CHECK_TYPES([memcached_instance_st*],,, [[#include <libmemcached/memcached.h>]])
1209 LIBS="${save_LIBS}"
1210 CPPFLAGS="${save_CPPFLAGS}"
1211],[
1212 AC_MSG_RESULT([no])
1213 AM_CONDITIONAL([HAVE_MEMCACHED],[false])
1214])
1215
c5c13c26 1216AC_ARG_ENABLE(core-libedit-support,
8574988c 1217 [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])])
c5c13c26 1218
4bdef6e6
JLC
1219AS_IF([test "x$enable_core_libedit_support" != "xno"],[
1220 PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],,[
1221 AC_MSG_RESULT([no])
1222 AC_CHECK_LIB([edit], [el_line], [LIBEDIT_LIBS=-ledit])
1223 AC_CHECK_HEADER([histedit.h], [], [unset LIBEDIT_LIBS])
1224 AS_IF([test "x$LIBEDIT_LIBS" = "x"], [
1225 AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support])
1226 ])])])
8574988c
TC
1227
1228AS_IF([test "x$enable_core_libedit_support" != "xno"], [
1229 # If making changes here, don't forget to run autoheader and
1230 # update libs/esl/src/include/esl_config_auto.h.in manually.
1231 AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if you have libedit is available])
1232 save_LIBS="${LIBS}"
1233 save_CPPFLAGS="${CPPFLAGS}"
1234 LIBS="${LIBEDIT_LIBS}"
1235 CPPFLAGS="${LIBEDIT_CFLAGS}"
1236 AC_CHECK_DECLS([EL_PROMPT_ESC, EL_REFRESH],,, [[#include <histedit.h>]])
1237 AC_CHECK_FUNCS([el_wset])
1238 LIBS="${save_LIBS}"
1239 CPPFLAGS="${save_CPPFLAGS}"
1240])
28213aad 1241
219a2ecc
AT
1242SAC_OPENSSL
1243
9d6d8a1c
AT
1244if test x$HAVE_OPENSSL = x1; then
1245 openssl_CFLAGS="$openssl_CFLAGS -DHAVE_OPENSSL";
1d18b58b 1246 APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL)
2fe3ef03 1247 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 1248 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 1249else
f2331de6 1250 AC_MSG_ERROR([OpenSSL >= 1.0.1e and associated developement headers required])
9d6d8a1c
AT
1251fi
1252
e69fe7e3 1253AX_CHECK_JAVA
7df787b7 1254
2e32d105
PO
1255# Option to enable static linking of Google's V8 inside mod_v8
1256AC_ARG_ENABLE(static-v8,
1257[AS_HELP_STRING([--enable-static-v8], [Statically link V8 into mod_v8])], [enable_static_v8="$enableval"], [enable_static_v8="no"])
1258AM_CONDITIONAL([ENABLE_STATIC_V8],[test "x$enable_static_v8" != "xno"])
c8fa0f0c
PO
1259
1260# Option to disable parallel build of Google's V8
1261AC_ARG_ENABLE(parallel-build-v8,
1262[AS_HELP_STRING([--disable-parallel-build-v8], [Disable parallel build of V8])], [enable_parallel_build_v8="$enableval"], [enable_parallel_build_v8="yes"])
1263AM_CONDITIONAL([ENABLE_PARALLEL_BUILD_V8],[test "x$enable_parallel_build_v8" != "xno"])
753fa8fb 1264
31b743d6 1265AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
778a82cc 1266AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
49a0eb29 1267
719d37db
BW
1268#
1269# perl checks
1270#
1271
5014b80d 1272AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no])
5014b80d 1273
82dbc5d2
MJ
1274# -a "x$ac_cv_have_EXTERN_h" != "xno"
1275
1276if test "x$ac_cv_have_perl" != "xno"; then
230b2178 1277 PERL=perl
82dbc5d2 1278 PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{archlib}'`"
5014b80d
BW
1279 PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE"
1280 PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`"
94f35990
MJ
1281 PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts | sed -e 's|-arch x86_64 -arch i386||'` -DEMBED_PERL"
1282 PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts| sed -e 's|-arch x86_64 -arch i386||'`"
5014b80d 1283 PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`"
82dbc5d2 1284
5dd77913
MJ
1285 save_CFLAGS="$CFLAGS"
1286 CFLAGS="$PERL_CFLAGS"
1287 AC_CHECK_HEADER([EXTERN.h], [ac_cv_have_EXTERN_h=yes], [ac_cv_have_EXTERN_h=no], [[#include <EXTERN.h>
1288# include <perl.h>]])
1289 CFLAGS="$save_CFLAGS"
82dbc5d2 1290
548be286
MJ
1291 save_LDFLAGS="$LDFLAGS"
1292 LDFLAGS="$PERL_LDFLAGS"
1293 AC_CHECK_LIB([perl], [perl_alloc], ac_cv_use_libperl=yes, ac_cv_use_libperl=no)
1294 LDFLAGS="$save_LDFLAGS"
1295
5014b80d
BW
1296 AC_SUBST(PERL_SITEDIR)
1297 AC_SUBST(PERL_LIBDIR)
1298 AC_SUBST(PERL_LIBS)
1299 AC_SUBST(PERL_CFLAGS)
1300 AC_SUBST(PERL_LDFLAGS)
1301 AC_SUBST(PERL_INC)
1302fi
1303
548be286 1304AM_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 1305
719d37db
BW
1306#
1307# php checks
1308#
1309
1310AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no])
1311AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no])
1312AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"])
1313
1314if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then
1315 PHP=php
1316 PHP_CONFIG=php-config
1317 PHP_LDFLAGS="`$PHP_CONFIG --ldflags`"
1318 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'`"
1319 PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`"
1320 PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`"
1321 PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`"
1322 PHP_CFLAGS="`$PHP_CONFIG --includes`"
1323 AC_SUBST(PHP_LDFLAGS)
1324 AC_SUBST(PHP_LIBS)
1325 AC_SUBST(PHP_EXT_DIR)
1326 AC_SUBST(PHP_INC_DIR)
1327 AC_SUBST(PHP_INI_DIR)
1328 AC_SUBST(PHP_CFLAGS)
1329fi
1330
e8c88aa1
SK
1331#
1332# Python checks for mod_python
1333#
1334AC_ARG_WITH(
1335 [python],
1336 [AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])],
1337 [with_python="$withval"],
1338 [with_python="try"]
1339)
1340
e8c88aa1
SK
1341if test "$with_python" != "no"
1342then
2d14539e
SK
1343 save_CFLAGS="$CFLAGS"
1344 save_LIBS="$LIBS"
1345
e8c88aa1
SK
1346 if test "$with_python" != "yes" -a "$with_python" != "try" ; then
1347 AC_MSG_CHECKING([for python])
1348 if test ! -x "$with_python" ; then
1349 AC_MSG_ERROR([Specified python does not exist or is not executable: $with_python])
1350 fi
1351 AC_MSG_RESULT([$with_python])
1352 AC_SUBST([PYTHON], ["$with_python"])
1353 else
1354 AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
1355 fi
1356
1357 if test "$PYTHON" != "no" ; then
1358 AC_MSG_CHECKING([python version])
1359 PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`"
1360
1361 if test -z "$PYTHON_VER" ; then
1362 AC_MSG_ERROR([Unable to detect python version])
1363 fi
1364 AC_MSG_RESULT([$PYTHON_VER])
1365
2d14539e 1366 AC_MSG_CHECKING([for python distutils])
baf944eb
SK
1367 python_result="`$PYTHON -c 'import distutils;' 2>&1`"
1368 if test -z "$python_result" ; then
2d14539e 1369 python_has_distutils="yes"
baf944eb
SK
1370 else
1371 python_has_distutils="no"
2d14539e
SK
1372 fi
1373 AC_MSG_RESULT([$python_has_distutils])
1374
baf944eb 1375 if test "$python_has_distutils" != "no" ; then
f08ac862
SK
1376 AC_MSG_CHECKING([location of site-packages])
1377
83680470 1378 PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
f08ac862
SK
1379
1380 if test -z "$PYTHON_SITE_DIR" ; then
1381 AC_MSG_ERROR([Unable to detect python site-packages path])
1382 elif test ! -d "$PYTHON_SITE_DIR" ; then
1383 AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!])
1384 fi
1385 AC_MSG_RESULT([$PYTHON_SITE_DIR])
1386 AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR])
1387
2d14539e
SK
1388 #
1389 # python distutils found, get settings from python directly
1390 #
93129e32 1391 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
1392 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));'`"
1393 PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`"
1394 PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
ba892c27
SK
1395
1396 # handle python being installed into /usr/local
1397 AC_MSG_CHECKING([python libdir])
1398 if test -z "`echo $PYTHON_LIBDIR | grep "/usr/lib"`" ; then
1399 PYTHON_LDFLAGS="-L$PYTHON_LIBDIR $PYTHON_LDFLAGS"
1400 LIBS="-L$PYTHON_LIBDIR $LIBS"
1401 fi
1402 AC_MSG_RESULT([$PYTHON_LIBDIR])
e8c88aa1 1403
2d14539e
SK
1404 # check libpython
1405 AC_CHECK_LIB([$PYTHON_LIB], [main], [has_libpython="yes"], [has_libpython="no"])
1406
1407 if test "$has_libpython" = "no" ; then
1408 AS_IF([test "$with_python" = "try"],
1409 [AC_MSG_WARN([$PYTHON_LIB is unusable])],
1410 [AC_MSG_ERROR([$PYTHON_LIB is unusable])]
1411 )
1412 fi
e8c88aa1
SK
1413
1414 # check whether system libpython is usable and has threads support
2d14539e 1415 CFLAGS="$PYTHON_CFLAGS"
e8c88aa1
SK
1416 LIBS="$PYTHON_LDFLAGS"
1417 AC_CHECK_FUNC([PyThread_init_thread], [python_has_threads="yes"], [python_has_threads="no"])
e8c88aa1 1418
2d14539e
SK
1419 if test "$python_has_threads" = "no"; then
1420 AS_IF([test "$with_python" = "try"],
1421 [AC_MSG_WARN([Your python lacks threads support, can not build mod_python])],
1422 [AC_MSG_ERROR([Your python lacks threads support, can not build mod_python])]
1423 )
e8c88aa1
SK
1424 else
1425 AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf])
2d14539e 1426 AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS])
e8c88aa1
SK
1427 AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS])
1428 fi
1429 else
2d14539e 1430 AS_IF([test "$with_python" = "try"],
baf944eb
SK
1431 [AC_MSG_WARN([Could not find or use python distutils module: $python_result])],
1432 [AC_MSG_ERROR([Could not find or use python distutils module: $python_result])]
2d14539e 1433 )
e8c88aa1
SK
1434 fi
1435
2d14539e
SK
1436 LIBS="$save_LIBS"
1437 CFLAGS="$save_CFLAGS"
1438
1439 unset python_has_threads
1440 unset python_has_distutils
baf944eb 1441 unset python_result
2d14539e
SK
1442 else
1443 AS_IF([test "$with_python" = "try"],
1444 [AC_MSG_WARN([Could not find python, mod_python will not build, use --with-python to specify the location])],
1445 [AC_MSG_ERROR([Could not find python, use --with-python to specify the location])]
1446 )
e8c88aa1
SK
1447 fi
1448else
1449 AC_MSG_WARN([python support disabled, building mod_python will fail!])
1450fi
1451
ea0316b8
AT
1452CHECK_ERLANG
1453
7dba19ce
MJ
1454# we never use this, and hard setting it will make cross compile work better
1455ac_cv_file_dbd_apr_dbd_mysql_c=no
1456
42e78242 1457AC_CONFIG_FILES([Makefile
7b3d3f7e
AM
1458 build/Makefile
1459 src/Makefile
1460 src/mod/Makefile
bcd9f49f
MJ
1461 src/mod/applications/mod_abstraction/Makefile
1462 src/mod/applications/mod_avmd/Makefile
fa3a1a0b 1463 src/mod/applications/mod_bert/Makefile
bcd9f49f
MJ
1464 src/mod/applications/mod_blacklist/Makefile
1465 src/mod/applications/mod_callcenter/Makefile
1466 src/mod/applications/mod_cidlookup/Makefile
1467 src/mod/applications/mod_cluechoo/Makefile
1468 src/mod/applications/mod_commands/Makefile
1469 src/mod/applications/mod_conference/Makefile
1470 src/mod/applications/mod_curl/Makefile
1471 src/mod/applications/mod_db/Makefile
1472 src/mod/applications/mod_directory/Makefile
1473 src/mod/applications/mod_distributor/Makefile
1474 src/mod/applications/mod_dptools/Makefile
1475 src/mod/applications/mod_easyroute/Makefile
1476 src/mod/applications/mod_enum/Makefile
1477 src/mod/applications/mod_esf/Makefile
1478 src/mod/applications/mod_esl/Makefile
aad61cad 1479 src/mod/applications/mod_expr/Makefile
bcd9f49f
MJ
1480 src/mod/applications/mod_fifo/Makefile
1481 src/mod/applications/mod_fsk/Makefile
1482 src/mod/applications/mod_fsv/Makefile
1483 src/mod/applications/mod_hash/Makefile
1484 src/mod/applications/mod_httapi/Makefile
1485 src/mod/applications/mod_http_cache/Makefile
1486 src/mod/applications/mod_ladspa/Makefile
1487 src/mod/applications/mod_lcr/Makefile
1488 src/mod/applications/mod_limit/Makefile
1489 src/mod/applications/mod_memcache/Makefile
1490 src/mod/applications/mod_mongo/Makefile
1491 src/mod/applications/mod_mp4/Makefile
1492 src/mod/applications/mod_nibblebill/Makefile
1493 src/mod/applications/mod_oreka/Makefile
dc06a039 1494 src/mod/applications/mod_osp/Makefile
a537d803 1495 src/mod/applications/mod_prefix/Makefile
bcd9f49f
MJ
1496 src/mod/applications/mod_rad_auth/Makefile
1497 src/mod/applications/mod_random/Makefile
1498 src/mod/applications/mod_redis/Makefile
1499 src/mod/applications/mod_rss/Makefile
1500 src/mod/applications/mod_skel/Makefile
1501 src/mod/applications/mod_sms/Makefile
1502 src/mod/applications/mod_snapshot/Makefile
1503 src/mod/applications/mod_snipe_hunt/Makefile
1504 src/mod/applications/mod_snom/Makefile
1505 src/mod/applications/mod_sonar/Makefile
1506 src/mod/applications/mod_soundtouch/Makefile
1507 src/mod/applications/mod_spandsp/Makefile
1508 src/mod/applications/mod_spy/Makefile
ea181ca4 1509 src/mod/applications/mod_stress/Makefile
bcd9f49f
MJ
1510 src/mod/applications/mod_translate/Makefile
1511 src/mod/applications/mod_valet_parking/Makefile
1512 src/mod/applications/mod_vmd/Makefile
1513 src/mod/applications/mod_voicemail/Makefile
1514 src/mod/applications/mod_voicemail_ivr/Makefile
1515 src/mod/asr_tts/mod_cepstral/Makefile
1516 src/mod/asr_tts/mod_flite/Makefile
1517 src/mod/asr_tts/mod_pocketsphinx/Makefile
1518 src/mod/asr_tts/mod_tts_commandline/Makefile
1519 src/mod/asr_tts/mod_unimrcp/Makefile
1520 src/mod/codecs/mod_amr/Makefile
1521 src/mod/codecs/mod_amrwb/Makefile
1522 src/mod/codecs/mod_b64/Makefile
1523 src/mod/codecs/mod_bv/Makefile
1524 src/mod/codecs/mod_celt/Makefile
1525 src/mod/codecs/mod_codec2/Makefile
17d52112 1526 src/mod/codecs/mod_com_g729/Makefile
bcd9f49f
MJ
1527 src/mod/codecs/mod_dahdi_codec/Makefile
1528 src/mod/codecs/mod_g723_1/Makefile
1529 src/mod/codecs/mod_g729/Makefile
1530 src/mod/codecs/mod_h26x/Makefile
1531 src/mod/codecs/mod_ilbc/Makefile
1532 src/mod/codecs/mod_isac/Makefile
1533 src/mod/codecs/mod_mp4v/Makefile
1534 src/mod/codecs/mod_opus/Makefile
1535 src/mod/codecs/mod_sangoma_codec/Makefile
1536 src/mod/codecs/mod_silk/Makefile
1537 src/mod/codecs/mod_siren/Makefile
1538 src/mod/codecs/mod_skel_codec/Makefile
1539 src/mod/codecs/mod_theora/Makefile
1540 src/mod/codecs/mod_vp8/Makefile
1541 src/mod/dialplans/mod_dialplan_asterisk/Makefile
1542 src/mod/dialplans/mod_dialplan_directory/Makefile
1543 src/mod/dialplans/mod_dialplan_xml/Makefile
1544 src/mod/directories/mod_ldap/Makefile
1545 src/mod/endpoints/mod_alsa/Makefile
1546 src/mod/endpoints/mod_dingaling/Makefile
524c566e 1547 src/mod/endpoints/mod_gsmopen/Makefile
bcd9f49f
MJ
1548 src/mod/endpoints/mod_h323/Makefile
1549 src/mod/endpoints/mod_khomp/Makefile
1550 src/mod/endpoints/mod_loopback/Makefile
1551 src/mod/endpoints/mod_opal/Makefile
59472c23 1552 src/mod/endpoints/mod_portaudio/Makefile
bcd9f49f
MJ
1553 src/mod/endpoints/mod_reference/Makefile
1554 src/mod/endpoints/mod_rtmp/Makefile
ad4eb5e0 1555 src/mod/endpoints/mod_skinny/Makefile
99e55ae0 1556 src/mod/endpoints/mod_skypopen/Makefile
7b3d3f7e 1557 src/mod/endpoints/mod_sofia/Makefile
bcd9f49f 1558 src/mod/endpoints/mod_unicall/Makefile
5138f4d5 1559 src/mod/endpoints/mod_rtc/Makefile
1ffb1ee0 1560 src/mod/endpoints/mod_verto/Makefile
bcd9f49f
MJ
1561 src/mod/event_handlers/mod_cdr_csv/Makefile
1562 src/mod/event_handlers/mod_cdr_mongodb/Makefile
1563 src/mod/event_handlers/mod_cdr_pg_csv/Makefile
1564 src/mod/event_handlers/mod_cdr_sqlite/Makefile
1565 src/mod/event_handlers/mod_erlang_event/Makefile
1566 src/mod/event_handlers/mod_event_multicast/Makefile
1567 src/mod/event_handlers/mod_event_socket/Makefile
1568 src/mod/event_handlers/mod_event_test/Makefile
1569 src/mod/event_handlers/mod_format_cdr/Makefile
1570 src/mod/event_handlers/mod_json_cdr/Makefile
1571 src/mod/event_handlers/mod_radius_cdr/Makefile
544c5faf 1572 src/mod/event_handlers/mod_odbc_cdr/Makefile
bcd9f49f
MJ
1573 src/mod/event_handlers/mod_rayo/Makefile
1574 src/mod/event_handlers/mod_snmp/Makefile
c19bb4d1 1575 src/mod/event_handlers/mod_event_zmq/Makefile
bcd9f49f
MJ
1576 src/mod/formats/mod_local_stream/Makefile
1577 src/mod/formats/mod_native_file/Makefile
1578 src/mod/formats/mod_shell_stream/Makefile
1579 src/mod/formats/mod_shout/Makefile
1580 src/mod/formats/mod_sndfile/Makefile
1581 src/mod/formats/mod_ssml/Makefile
1582 src/mod/formats/mod_tone_stream/Makefile
1583 src/mod/formats/mod_vlc/Makefile
59472c23 1584 src/mod/formats/mod_portaudio_stream/Makefile
7b3d3f7e 1585 src/mod/languages/mod_java/Makefile
9b8392bc 1586 src/mod/languages/mod_lua/Makefile
bcd9f49f
MJ
1587 src/mod/languages/mod_managed/Makefile
1588 src/mod/languages/mod_perl/Makefile
7b3d3f7e 1589 src/mod/languages/mod_python/Makefile
b7623326 1590 src/mod/languages/mod_v8/Makefile
bcd9f49f 1591 src/mod/languages/mod_yaml/Makefile
3a273629 1592 src/mod/languages/mod_basic/Makefile
bcd9f49f
MJ
1593 src/mod/legacy/languages/mod_lua/Makefile
1594 src/mod/loggers/mod_console/Makefile
b5816d34 1595 src/mod/loggers/mod_graylog2/Makefile
bcd9f49f
MJ
1596 src/mod/loggers/mod_logfile/Makefile
1597 src/mod/loggers/mod_syslog/Makefile
1598 src/mod/say/mod_say_de/Makefile
1599 src/mod/say/mod_say_en/Makefile
1600 src/mod/say/mod_say_es/Makefile
11e62dd4 1601 src/mod/say/mod_say_es_ar/Makefile
bcd9f49f
MJ
1602 src/mod/say/mod_say_fa/Makefile
1603 src/mod/say/mod_say_fr/Makefile
1604 src/mod/say/mod_say_he/Makefile
1605 src/mod/say/mod_say_hr/Makefile
1606 src/mod/say/mod_say_hu/Makefile
1607 src/mod/say/mod_say_it/Makefile
1608 src/mod/say/mod_say_ja/Makefile
1609 src/mod/say/mod_say_nl/Makefile
1610 src/mod/say/mod_say_pl/Makefile
1611 src/mod/say/mod_say_pt/Makefile
1612 src/mod/say/mod_say_ru/Makefile
1613 src/mod/say/mod_say_sv/Makefile
1614 src/mod/say/mod_say_th/Makefile
1615 src/mod/say/mod_say_zh/Makefile
1616 src/mod/timers/mod_posix_timer/Makefile
1617 src/mod/timers/mod_timerfd/Makefile
1618 src/mod/xml_int/mod_xml_cdr/Makefile
1619 src/mod/xml_int/mod_xml_curl/Makefile
1620 src/mod/xml_int/mod_xml_ldap/Makefile
1621 src/mod/xml_int/mod_xml_radius/Makefile
1622 src/mod/xml_int/mod_xml_rpc/Makefile
1623 src/mod/xml_int/mod_xml_scgi/Makefile
7b3d3f7e
AM
1624 src/include/switch_am_config.h
1625 build/getsounds.sh
1626 build/getlib.sh
17d52112 1627 build/getg729.sh
68b58406 1628 build/freeswitch.pc
7b3d3f7e 1629 build/modmake.rules
3ec53f0b 1630 libs/esl/Makefile
4e734db2 1631 libs/esl/perl/Makefile
719d37db 1632 libs/esl/php/Makefile
af192a2e 1633 libs/xmlrpc-c/include/xmlrpc-c/config.h
7b3d3f7e 1634 libs/xmlrpc-c/xmlrpc_config.h
6b6c83a7
JL
1635 libs/xmlrpc-c/config.mk
1636 libs/xmlrpc-c/srcdir.mk
1637 libs/xmlrpc-c/stamp-h
7b3d3f7e 1638 scripts/gentls_cert])
4da77ea5 1639
a6e9f279 1640AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
db399276 1641AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
fba1c2bf 1642AM_CONDITIONAL(ISFREEBSD, [test `uname -s` = FreeBSD])
a092a55a 1643AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
a6e9f279 1644
bcd9f49f
MJ
1645AM_CONDITIONAL(HAVE_AMR, [ test -d ${switch_srcdir}/libs/amr ])
1646AM_CONDITIONAL(HAVE_AMRWB, [ test -d ${switch_srcdir}/libs/amrwb ])
1647AM_CONDITIONAL(HAVE_G723_1, [ test -d ${switch_srcdir}/libs/libg723_1 ])
1648AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ])
1649
c7753b06
MJ
1650#some vars to sub into the Makefile.am's
1651#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 1652LIBTOOL='$(SHELL) $(switch_builddir)/libtool'
c7753b06 1653TOUCH_TARGET='if test -f "$@";then touch "$@";fi;'
afe7d97f 1654CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed -e "s|^.*/||" | sort | uniq )'
b9f2bdfb 1655CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed -e "s|^.*/||" | sort | uniq )'
afe7d97f
MJ
1656OUR_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 )'
1657OUR_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 )'
1658OUR_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 )'
1659OUR_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 )'
1660OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
1661OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
1662OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
1663OUR_DISABLED_UNINSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
ed960392 1664
31069f33 1665#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 1666#AM_MAKEFLAGS='`test -n "$(VERBOSE)" || echo -s`'
c7753b06
MJ
1667AC_SUBST(LIBTOOL)
1668AC_SUBST(TOUCH_TARGET)
ed960392 1669AC_SUBST(CONF_DISABLED_MODULES)
5f053e18 1670AC_SUBST(CONF_MODULES)
ed960392 1671
5f053e18
MJ
1672AC_SUBST(OUR_MODS)
1673AC_SUBST(OUR_CLEAN_MODS)
1674AC_SUBST(OUR_INSTALL_MODS)
1675AC_SUBST(OUR_UNINSTALL_MODS)
ed960392
AM
1676AC_SUBST(OUR_DISABLED_MODS)
1677AC_SUBST(OUR_DISABLED_CLEAN_MODS)
1678AC_SUBST(OUR_DISABLED_INSTALL_MODS)
1679AC_SUBST(OUR_DISABLED_UNINSTALL_MODS)
c7753b06
MJ
1680AC_SUBST(AM_MAKEFLAGS)
1681
03844dcb 1682ac_configure_args="$ac_configure_args CONFIGURE_CFLAGS='$CFLAGS $CPPFLAGS' CONFIGURE_CXXFLAGS='$CXXFLAGS $CPPFLAGS' CONFIGURE_LDFLAGS='$LDFLAGS' "
452b0bde 1683
40ff9a41
MJ
1684# --prefix='$prefix' --exec_prefix='$exec_prefix' --libdir='$libdir' --libexecdir='$libexecdir' --bindir='$bindir' --sbindir='$sbindir' \
1685# --localstatedir='$localstatedir' --datadir='$datadir'"
8f9ab613 1686
46f6981d 1687# Run configure in all the subdirs
236bfeea 1688AC_CONFIG_SUBDIRS([libs/srtp])
48712895
TC
1689if test "$use_system_apr" != "yes"; then
1690 AC_CONFIG_SUBDIRS([libs/apr])
1691fi
1692if test "$use_system_aprutil" != "yes"; then
1693 AC_CONFIG_SUBDIRS([libs/apr-util])
1694fi
236bfeea 1695AC_CONFIG_SUBDIRS([libs/ilbc])
236bfeea 1696AC_CONFIG_SUBDIRS([libs/iksemel])
236bfeea
MJ
1697AC_CONFIG_SUBDIRS([libs/libdingaling])
1698AC_CONFIG_SUBDIRS([libs/libsndfile])
1699AC_CONFIG_SUBDIRS([libs/sofia-sip])
236bfeea
MJ
1700AC_CONFIG_SUBDIRS([libs/freetdm])
1701AC_CONFIG_SUBDIRS([libs/unimrcp])
1702AC_CONFIG_SUBDIRS([libs/tiff-4.0.2])
1703AC_CONFIG_SUBDIRS([libs/spandsp])
1704AC_CONFIG_SUBDIRS([libs/broadvoice])
1705AC_CONFIG_SUBDIRS([libs/libg722_1])
1706AC_CONFIG_SUBDIRS([libs/silk])
1707AC_CONFIG_SUBDIRS([libs/libcodec2])
1708if test "x${enable_zrtp}" = "xyes"; then
e5a1b54e 1709 AC_CONFIG_SUBDIRS([libs/libzrtp])
393b63b7 1710fi
ee3fc89f 1711
f6fe2667 1712case $host in
fb41b0f6
BW
1713 *-openbsd*|*-netbsd*)
1714 # libtool won't link static libs against shared ones on NetBSD/OpenBSD unless we tell it not to be stupid
f6fe2667
MJ
1715 AC_CONFIG_COMMANDS([hacklibtool], [cp libtool libtool.orig && sed -e "s/deplibs_check_method=.*/deplibs_check_method=pass_all/g" libtool.orig > libtool])
1716 ;;
1717esac
1718
1719
6e81dda1 1720AC_OUTPUT
5ccac21d 1721
1ed00b4d
BW
1722##
1723## Registering for ClueCon
1724##
4ff9b2f1 1725if ! test -f noreg ; then
1ed00b4d
BW
1726echo ""
1727echo ""
1728echo $ECHO_N "Registering you for ClueCon http://www.cluecon.com $ECHO_C" 1>&6
82f77413 1729sleep 1
1ed00b4d 1730echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1731sleep 1
1ed00b4d 1732echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1733sleep 1
1ed00b4d 1734AC_MSG_RESULT([ See you in August. ;-)])
1ed00b4d 1735echo ""
17d52112 1736fi
1ed00b4d 1737
5ccac21d
MJ
1738##
1739## Configuration summary
1740##
1741
1742echo
8912b80e 1743echo "-------------------------- FreeSWITCH configuration --------------------------"
5ccac21d
MJ
1744echo ""
1745echo " Locations:"
fd1b0279 1746echo " FHS enabled: ${enable_fhs}"
5ccac21d
MJ
1747echo ""
1748echo " prefix: ${prefix}"
1749echo " exec_prefix: ${exec_prefix}"
1750echo " bindir: ${bindir}"
fd1b0279 1751echo " sysconfdir: ${sysconfdir}"
5ccac21d 1752echo " libdir: ${libdir}"
fd1b0279
TC
1753echo ""
1754echo " certsdir: ${certsdir}"
1755echo " dbdir: ${dbdir}"
1756echo " grammardir: ${grammardir}"
1757echo " htdocsdir: ${htdocsdir}"
1758echo " logfiledir: ${logfiledir}"
5ccac21d 1759echo " modulesdir: ${modulesdir}"
fd1b0279
TC
1760echo " pkgconfigdir: ${pkgconfigdir}"
1761echo " recordingsdir: ${recordingsdir}"
5ccac21d 1762echo " runtimedir: ${runtimedir}"
fd1b0279
TC
1763echo " scriptdir: ${scriptdir}"
1764echo " soundsdir: ${soundsdir}"
1765echo " storagedir: ${storagedir}"
ce96d95c 1766echo " cachedir: ${cachedir}"
5ccac21d 1767echo ""
8912b80e 1768echo "------------------------------------------------------------------------------"