]> git.ipfire.org Git - thirdparty/freeswitch.git/blame - configure.in
svn has been long retired
[thirdparty/freeswitch.git] / configure.in
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
2cd5841c 6AC_INIT([freeswitch], [1.5.8b], bugs@freeswitch.org)
8ef2aa54 7AC_SUBST(SWITCH_VERSION_MAJOR, [1])
308a8396 8AC_SUBST(SWITCH_VERSION_MINOR, [5])
2cd5841c 9AC_SUBST(SWITCH_VERSION_MICRO, [8b])
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)
4da77ea5
AM
16AM_INIT_AUTOMAKE(libfreeswitch,0.1)
17AC_CONFIG_SRCDIR([src/switch.c])
42e78242 18AC_CONFIG_HEADER([src/include/switch_private.h])
4062b636 19AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h])
42e78242 20
a642381f 21AC_PREFIX_DEFAULT(/usr/local/freeswitch)
94206d80
MJ
22# AC_PREFIX_DEFAULT does not get expanded until too late so we need to do this to use prefix in this script
23if test "x$prefix" = "xNONE" ; then
24 prefix='/usr/local/freeswitch'
25fi
55b3e6cb 26
31d1e20f
BW
27AC_CANONICAL_HOST
28
55b3e6cb
MJ
29# Absolute source/build directory
30switch_srcdir=`(cd $srcdir && pwd)`
31switch_builddir=`pwd`
32AC_SUBST(switch_srcdir)
33AC_SUBST(switch_builddir)
34
b552cb3a 35# Where to install the modules
2bcd991b 36AC_ARG_WITH([modinstdir],
5ccac21d
MJ
37 [AS_HELP_STRING([--with-modinstdir=DIR], [Install modules into this location (default: $prefix/mod)])], [modulesdir="$withval"], [modulesdir="${prefix}/mod"])
38AC_SUBST(modulesdir)
39AC_DEFINE_UNQUOTED([SWITCH_MOD_DIR],"${modulesdir}",[where to install the modules to])
1481d37f 40
88aa159b
MJ
41if test "$localstatedir" = "\${prefix}/var" ; then
42 rundir="$prefix/run"
7ae3f5b7 43 logdir="${prefix}/log"
88aa159b
MJ
44else
45 rundir="$localstatedir/run/freeswitch"
7ae3f5b7 46 logdir="$localstatedir/log/freeswitch"
88aa159b 47fi
107f9135
MJ
48# Where to put pidfile
49AC_ARG_WITH([rundir],
88aa159b 50 [AS_HELP_STRING([--with-rundir=DIR], [Put pidfile into this location (default: $prefix/run)])], [runtimedir="$withval"], [runtimedir="$rundir"])
5ccac21d
MJ
51AC_SUBST(runtimedir)
52AC_DEFINE_UNQUOTED([SWITCH_RUN_DIR],"${runtimedir}",[where to put pidfile to])
53
7ae3f5b7
MOC
54AC_ARG_WITH([logfiledir],
55 [AS_HELP_STRING([--with-logfiledir=DIR], [Put logfiles into this location (default: $localstatedir/log)])], [logfiledir="$withval"], [logfiledir="$logdir"])
5ccac21d
MJ
56AC_SUBST(logfiledir)
57AC_DEFINE_UNQUOTED([SWITCH_LOG_DIR],"${logfiledir}",[where to put log files])
107f9135 58
7ae3f5b7
MOC
59AC_ARG_WITH([dbdir],
60 [AS_HELP_STRING([--with-dbdir=DIR], [Put database files into this location (default: $prefix/db)])], [dbdir="$withval"], [dbdir="$prefix/db"])
5ccac21d
MJ
61AC_SUBST(dbdir)
62AC_DEFINE_UNQUOTED([SWITCH_DB_DIR],"${dbdir}",[where to put db files])
63
7ae3f5b7
MOC
64AC_ARG_WITH([htdocsdir],
65 [AS_HELP_STRING([--with-htdocsdir=DIR], [Put html files into this location (default: $prefix/htdocs)])], [htdocsdir="$withval"], [htdocsdir="$prefix/htdocs"])
89ae5f47
MJ
66AC_SUBST(htdocsdir)
67AC_DEFINE_UNQUOTED([SWITCH_HTDOCS_DIR],"${htdocsdir}",[where to put htdocs files])
68
7ae3f5b7
MOC
69AC_ARG_WITH([soundsdir],
70 [AS_HELP_STRING([--with-soundsdir=DIR], [Put sound files into this location (default: $prefix/sounds)])], [soundsdir="$withval"], [soundsdir="$prefix/sounds"])
d1c60899
MJ
71AC_SUBST(soundsdir)
72AC_DEFINE_UNQUOTED([SWITCH_SOUNDS_DIR],"${soundsdir}",[where to put sounds files])
73
7ae3f5b7
MOC
74AC_ARG_WITH([grammardir],
75 [AS_HELP_STRING([--with-grammardir=DIR], [Put grammar files into this location (default: $prefix/grammar)])], [grammardir="$withval"], [grammardir="$prefix/grammar"])
89ae5f47
MJ
76AC_SUBST(grammardir)
77AC_DEFINE_UNQUOTED([SWITCH_GRAMMAR_DIR],"${grammardir}",[where to put grammar files])
78
dabb85c3
AM
79AC_ARG_WITH([certsdir],
80 [AS_HELP_STRING([--with-certsdir=DIR], [Put certs files into this location (default: $prefix/certs)])], [certsdir="$withval"], [certsdir="$prefix/certs"])
81AC_SUBST(certsdir)
82AC_DEFINE_UNQUOTED([SWITCH_CERTS_DIR],"${certsdir}",[where to put certs files])
83
7ae3f5b7 84AC_ARG_WITH([scriptdir],
023818bc 85 [AS_HELP_STRING([--with-scriptdir=DIR], [Put script files into this location (default: $prefix/scripts)])], [scriptdir="$withval"], [scriptdir="$prefix/scripts"])
5ccac21d
MJ
86AC_SUBST(scriptdir)
87AC_DEFINE_UNQUOTED([SWITCH_SCRIPT_DIR],"${scriptdir}",[where to put script files])
107f9135 88
7ae3f5b7
MOC
89AC_ARG_WITH([recordingsdir],
90 [AS_HELP_STRING([--with-recordingsdir=DIR], [Put recordings files into this location (default: $prefix/recordings)])], [recordingsdir="$withval"], [recordingsdir="$prefix/recordings"])
c064a2a5
MJ
91AC_SUBST(recordingsdir)
92AC_DEFINE_UNQUOTED([SWITCH_RECORDINGS_DIR],"${recordingsdir}",[where to put recording files])
93
f3d851d1
TC
94AC_ARG_WITH([storagedir],
95 [AS_HELP_STRING([--with-storagedir=DIR], [Put storage files into this location (default: $prefix/storage)])], [storagedir="$withval"], [storagedir="$prefix/storage"])
96AC_SUBST(storagedir)
97AC_DEFINE_UNQUOTED([SWITCH_STORAGE_DIR],"${storagedir}",[where to put storage files])
98
911e4a09
MJ
99if test "$sysconfdir" = "\${prefix}/etc" ; then
100 confdir="$prefix/conf"
101else
102 confdir="$sysconfdir"
103fi
104
5ccac21d
MJ
105sysconfdir="$confdir"
106
911e4a09 107AC_SUBST(confdir)
7da7790b 108AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[directory for configuration files])
911e4a09 109
8b3f71cc
MJ
110AC_SUBST(libdir)
111AC_SUBST(bindir)
112AC_SUBST(includedir)
113
f20ba4d1 114AC_ARG_WITH([pkgconfigdir],
78472897 115 [AS_HELP_STRING([--with-pkgconfigdir=DIR], [Installation directory for pkgconfig file (default: ${libdir}/pkgconfig)])],
f20ba4d1
SK
116 [case "${withval}" in
117 yes|no) AC_MSG_ERROR([Invalid value ${withval} for option --with-pkgconfigdir]) ;;
118 *) pkgconfigdir="${withval}" ;;
119 esac
120 ],
121 [pkgconfigdir="${libdir}/pkgconfig"]
122)
123AC_SUBST([pkgconfigdir])
124
6bc48b70
MJ
125#Set default language
126AC_LANG_C
4da77ea5
AM
127# Checks for programs.
128AC_PROG_CC
80eec6e5 129AC_PROG_CXX
40f18d30
MJ
130
131#check if the g++ compiler works
132AC_CACHE_CHECK([whether the C++ compiler works], [ac_cv_sys_cxx_works], [
133 AC_LANG_PUSH([C++])
134 AC_COMPILE_IFELSE([int main() { }], [ac_cv_sys_cxx_works=yes],
135 [ac_cv_sys_cxx_works=no])
136 AC_LANG_POP([C++])
137 ])
138[ if [ "x$ac_cv_sys_cxx_works" = "xno" ]; then ]
139 AC_MSG_FAILURE([The C++ compiler does not work. Please (re)install the C++ compiler])
140[ fi ]
141
bac1e3fd 142AC_PROG_AWK
4da77ea5 143AC_PROG_MAKE_SET
4da77ea5 144AC_PROG_INSTALL
3de6a7e9
MJ
145
146#override some default libtool behavior and invoke AC_PROG_LIBTOOL (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html)
147m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
148m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:])
149m4_defun([_LT_AC_LANG_RC_CONFIG], [:])
5b3f19fb 150AM_PROG_CC_C_O
bac1e3fd 151AC_PROG_LIBTOOL
4da77ea5 152
6bc48b70
MJ
153#Check for compiler vendor
154AX_COMPILER_VENDOR
155
156# Optimize
157AC_ARG_ENABLE(optimization,
158[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])
159
160if test "${enable_optimizer}" = "yes" ; then
161 AC_DEFINE([OPTIMZER],[],[Enable Optimization.])
162 AX_CC_MAXOPT
163fi
164
294b0779
MJ
165AX_PATH_LIBGNUTLS()
166
55b3e6cb 167# set defaults for use on all platforms
69393945
AM
168SWITCH_AM_CFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu"
169SWITCH_AM_CXXFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu"
1953ac5c 170SWITCH_AM_LDFLAGS="-lm"
55b3e6cb
MJ
171
172#set SOLINK variable based on compiler and host
173if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
174 SOLINK="-Bdynamic -dy -G"
44d5d43b 175elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
55b3e6cb 176 case "$host" in
44d5d43b 177 *darwin*)
5e7986bf
MJ
178 SOLINK="-dynamic -force-flat-namespace"
179 ;;
44d5d43b 180 *)
7549be4b 181 SOLINK="-shared -Xlinker -x"
44d5d43b
MJ
182 ;;
183
184 esac
185elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
186 case "$host" in
187# older Xcode test for darwin, Xcode 4/5 use clang above
6ae16d15 188 *darwin*)
55b3e6cb
MJ
189 SOLINK="-dynamic -bundle -force-flat-namespace"
190 ;;
872c349f
MB
191 *-solaris2*)
192 SOLINK="-shared -Xlinker"
193 ;;
55b3e6cb
MJ
194 *)
195 SOLINK="-shared -Xlinker -x"
196 ;;
197 esac
198else
199 AC_ERROR([Please update configure.in with SOLINK values for your compiler])
200fi
55b3e6cb
MJ
201# set DYNAMIC_LIB_EXTEN
202# we should really be using libtool so we don't need to do this
6bc48b70 203case "$host" in
55b3e6cb
MJ
204 *cygwin* | *mingw*)
205 DYNAMIC_LIB_EXTEN="dll"
206 ;;
207 *)
208 DYNAMIC_LIB_EXTEN="so"
209 ;;
6bc48b70 210esac
55b3e6cb 211
4a77854b
SK
212##
213# detect libtool major version,
214# set libtool library extension based on this
215# to work around some brokeness when using 'la' with libtool-1.5
216#
217AC_MSG_CHECKING([libtool major version])
218libtool="${switch_builddir}/libtool"
df33a43a 219LIBTOOL_MAJOR_VERSION="`$libtool --version 2>/dev/null| sed -e 's/([[^)]]*)//g;s/^[[^0-9]]*//;s/[[- ]].*//g;q'| awk 'BEGIN { FS = "." } { print $1 }' `"
0c0a4a53 220if test -z "$LIBTOOL_MAJOR_VERSION" ; then
751c2894 221 LIBTOOL_MAJOR_VERSION="`sed -n -e '/^VERSION/{s/^.*=\"\{0,1\}\([[0-9]]\{1,\}\)\..*/\1/;p;}' ${switch_srcdir}/build/config/ltmain.sh`"
0c0a4a53
SK
222fi
223if test -z "$LIBTOOL_MAJOR_VERSION" ; then
224 AC_MSG_ERROR([Failed to detect your libtool version, please open a bug report on http://jira.freeswitch.org/])
225fi
4a77854b 226AC_MSG_RESULT([${LIBTOOL_MAJOR_VERSION}])
02141e30
MJ
227
228LIBTOOL_LIB_EXTEN="$DYNAMIC_LIB_EXTEN"
229
4a77854b 230if test "${LIBTOOL_MAJOR_VERSION}" = "2" ; then
02141e30
MJ
231 LIBTOOL_LIB_EXTEN="la"
232fi
4a77854b
SK
233AC_MSG_RESULT([using libtool library extension... ${LIBTOOL_LIB_EXTEN}])
234
02141e30 235
0f6a6c31 236# Enable 64 bit build
6d45f5f5 237AC_ARG_ENABLE(64,
0f6a6c31 238[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
6d45f5f5 239
55b3e6cb
MJ
240# tweak compiler specific flags
241if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
242 APR_ADDTO(SWITCH_AM_CFLAGS, -KPIC)
243 APR_ADDTO(SWITCH_AM_CFLAGS, -DPIC)
99913ce3
MJ
244 APR_ADDTO(SWITCH_AM_CFLAGS, -erroff=E_END_OF_LOOP_CODE_NOT_REACHED)
245 APR_ADDTO(SWITCH_AM_CFLAGS, -errtags=yes)
2343708a 246 APR_ADDTO(SWITCH_AM_CFLAGS, -D__FUNCTION__=__func__ )
247 APR_ADDTO(SWITCH_AM_CFLAGS, -mt)
99913ce3 248 APR_ADDTO(SWITCH_AM_CXXFLAGS, -errtags=yes)
514bde18
MJ
249 APR_ADDTO(SWITCH_AM_CXXFLAGS, -KPIC)
250 APR_ADDTO(SWITCH_AM_CXXFLAGS, -DPIC)
f32f6f24 251 APR_ADDTO(SWITCH_AM_CXXFLAGS, "-features=extensions")
2343708a 252 APR_ADDTO(SWITCH_AM_CXXFLAGS, -D__FUNCTION__=__func__)
253 APR_ADDTO(SWITCH_AM_CXXFLAGS, -mt)
f32f6f24 254
55b3e6cb 255 APR_ADDTO(SWITCH_AM_LDFLAGS, -R${prefix}/lib)
6d45f5f5
MJ
256 if test "${enable_64}" = "yes"; then
257 APR_ADDTO(SWITCH_AM_CFLAGS, -m64)
5b2d20bf
MJ
258 APR_ADDTO(SWITCH_AM_CXXFLAGS, -m64)
259 APR_ADDTO(SWITCH_AM_LDFLAGS, -m64)
1953ac5c 260 LIBS="$LIBS -m64"
6d45f5f5 261 fi
55b3e6cb
MJ
262elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
263 APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
514bde18 264 APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
44ef8650 265 APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)
1953ac5c 266 if test "${enable_64}" = "yes"; then
5e7986bf 267 case "$host" in
851db97a 268 *darwin12.*|*darwin11.*|*darwin10.*|*darwin9.*|*darwin8.*)
5e7986bf
MJ
269 APR_ADDTO(CFLAGS, -arch x86_64)
270 APR_ADDTO(LDFLAGS, -arch x86_64)
271 APR_ADDTO(CXXFLAGS, -arch x86_64)
272 ;;
7803a752
MJ
273 *)
274 LIBS="$LIBS -m64"
275 ;;
5e7986bf 276 esac
1953ac5c 277 fi
55b3e6cb
MJ
278fi
279
ffe2ad4b
MJ
280#
281# gcc visibility cflag checks
282#
283AC_ARG_ENABLE([visibility],
284 [AS_HELP_STRING([--disable-visibility], [Disable or enable API visibility support (default: use if available)])],
285 [enable_visibility="${enableval}"],
286 [enable_visibility="detect"]
287)
288HAVE_VISIBILITY="no"
289
290if test "x${enable_visibility}" != "xno" ; then
291
292 case "${ax_cv_c_compiler_vendor}" in
293 gnu)
294 save_CFLAGS="${CFLAGS}"
295 CFLAGS="${CFLAGS} -fvisibility=hidden"
296 AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden])
297 AC_COMPILE_IFELSE(
298 [AC_LANG_PROGRAM(
299 [int foo __attribute__ ((visibility("default")));],
300 [;]
301 )],
302
303 [AC_MSG_RESULT([yes])
304 APR_ADDTO([SWITCH_AM_CFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
305 APR_ADDTO([SWITCH_AM_CXXFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
306 HAVE_VISIBILITY="yes"],
307
308 [AC_MSG_RESULT([no])]
309 )
310 CFLAGS="${save_CFLAGS}"
311 ;;
312
900907a2 313 sun)
96114867
SK
314 # save_CFLAGS="${CFLAGS}"
315 # CFLAGS="${CFLAGS} -xldscope=hidden"
316 # AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden])
317 # AC_COMPILE_IFELSE(
318 # [AC_LANG_PROGRAM(
319 # [int foo __attribute__ ((visibility("default")));],
320 # [;]
321 # )],
322 #
323 # [AC_MSG_RESULT([yes])
324 # APR_ADDTO([SWITCH_AM_CFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
325 # APR_ADDTO([SWITCH_AM_CXXFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
326 # HAVE_VISIBILITY="yes"],
327 #
328 # [AC_MSG_RESULT([no])]
329 # )
330 # CFLAGS="${save_CFLAGS}"
900907a2
MJ
331 ;;
332
ffe2ad4b
MJ
333 *)
334 if test "x${enable_visibility}" = "xyes" ; then
900907a2 335 AC_MSG_ERROR([Non-GNU / SUN compilers are currently unsupported])
ffe2ad4b 336 else
900907a2 337 AC_MSG_WARN([Non-GNU / SUN compilers are currently unsupported])
ffe2ad4b
MJ
338 fi
339 ;;
340 esac
341
342 #
343 # visibility explicitly requested but not supported by this compiler => error
344 #
345 if test "x${enable_visibility}" = "xyes" -a "x${HAVE_VISIBILITY}" = "xno" ; then
346 AC_MSG_ERROR([API visibility not supported by this compiler])
347 fi
348fi
349
fcd2a7b0
SK
350# Enable debugging (default: on)
351# (rename option if the default is changed)
2faabff7 352AC_ARG_ENABLE(debug,
fcd2a7b0 353[AC_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"])
2faabff7
AM
354
355if test "${enable_debug}" = "yes"; then
356 AC_DEFINE([DEBUG],[],[Enable extra debugging.])
554f476c 357 saved_CFLAGS="$CFLAGS"
44ea66c2 358 CFLAGS=
2faabff7 359 AX_CFLAGS_WARN_ALL_ANSI
02c7a3ac 360 SWITCH_ANSI_CFLAGS=$CFLAGS
554f476c 361 CFLAGS="$saved_CFLAGS"
2faabff7
AM
362
363 if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
364 APR_ADDTO(SWITCH_AM_CFLAGS, -g -ggdb)
37845b42 365 export DEBUG_CFLAGS="-g -ggdb"
2faabff7
AM
366 fi
367
368fi
369
59ba5a15
MJ
370AC_ARG_ENABLE(cpp,
371[AC_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"])
372
373AM_CONDITIONAL([ENABLE_CPP],[test "${enable_cpp}" = "yes"])
374
a8b87ffe
AM
375AC_ARG_ENABLE(srtp,
376[AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"])
377
378AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"])
379
861bd209
BW
380AC_ARG_ENABLE(zrtp,
381 [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"])
382if test "x$enable_zrtp" = "xyes" ; then
393b63b7 383 LIBS="-lpthread $LIBS"
861bd209
BW
384 APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
385fi
ae67ecce 386
c4d13331
MJ
387PA_LIBS=
388
389PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
390if test "x$have_jack" = "xyes" ; then
391PA_LIBS+=$JACK_LIBS
392fi
393
ae67ecce 394AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
1911a262 395if test "x$have_alsa" = "xyes" ; then
c4d13331 396PA_LIBS+=-lasound
ae67ecce 397fi
c4d13331
MJ
398
399AC_SUBST(PA_LIBS)
ae67ecce 400
861bd209
BW
401AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"])
402
a4a52620
SK
403AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
404
ab2bc7c6
TC
405AC_ARG_ENABLE(core-odbc-support,
406 [AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support (default is optional)])],,[enable_core_odbc_support="optional"])
407if ! test "$enable_core_odbc_support" = "no"; then
408 AX_LIB_ODBC
409 if test "$ac_cv_found_odbc" = "yes" ; then
410 enable_core_odbc_support="yes"
411 elif test "$enable_core_odbc_support" = "yes"; then
412 AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent])
413 else
414 enable_core_odbc_support="no"
415 fi
ffc8e81b
TC
416fi
417
6e9fa3ba
AM
418CHECK_LIBUUID
419SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS"
420SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS"
421
5cb354dd
EG
422AC_ARG_ENABLE(core-pgsql-support,
423 [AS_HELP_STRING([--enable-core-pgsql-support], [Compile with PGSQL Support])],,[enable_core_pgsql_support="no"])
ba052c22 424AC_ARG_ENABLE(core-pgsql-pkgconfig,
299081ed 425 [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
426
427if test x"$enable_core_pgsql_support" = x"yes" ; then
ba052c22
TC
428 AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
429 AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
430 if test "$PG_CONFIG" = "no"; then
431 AC_MSG_RESULT([no])
432 AC_MSG_FAILURE([Unabled to find pg_config in PATH. Is PostgreSQL installed?])
433 else
434 if test "$PKG_CONFIG" = "no" \
435 || test x"$enable_core_pgsql_pkgconfig" = x"no" \
436 || ! pkg-config libpq; then
437 AC_MSG_CHECKING([for PostgreSQL libraries])
438 POSTGRESQL_CXXFLAGS="`$PG_CONFIG --cppflags` -I`$PG_CONFIG --includedir`"
439 POSTGRESQL_LDFLAGS="`$PG_CONFIG --ldflags|sed 's/ -Wl,--as-needed//g'` -L`$PG_CONFIG --libdir` -lpq"
440 POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
441 POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL ([0-9]+).[0-9]+.?[0-9]+?#\1#'`
442 POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL [0-9]+.([0-9]+).?[0-9]+?#\1#'`
443 POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL [0-9]+.[0-9]+.?([0-9]+)?#\1#'`
444 else
445 AC_MSG_CHECKING([for PostgreSQL libraries])
446 POSTGRESQL_CXXFLAGS="`$PKG_CONFIG --cflags libpq`"
447 POSTGRESQL_LDFLAGS="`$PKG_CONFIG --libs libpq`"
448 POSTGRESQL_VERSION="`$PKG_CONFIG --modversion libpq`"
449 POSTGRESQL_MAJOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f1`"
450 POSTGRESQL_MINOR_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f2`"
451 POSTGRESQL_PATCH_VERSION="`echo $POSTGRESQL_VERSION | cut -d. -f3`"
452 fi
453 AC_DEFINE([SWITCH_HAVE_PGSQL], [1], [Define to 1 if PostgreSQL libraries are available])
454 AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
455 AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
456 AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
457 AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
458 AC_CHECK_LIB([pq], [PQgetvalue],, AC_MSG_ERROR([no usable libpq; please install PostgreSQL devel package or equivalent]))
459 AC_MSG_RESULT([yes])
460 SWITCH_AM_CXXFLAGS="$POSTGRESQL_CXXFLAGS $SWITCH_AM_CXXFLAGS"
461 SWITCH_AM_LDFLAGS="$POSTGRESQL_LDFLAGS $SWITCH_AM_LDFLAGS"
462 fi
5cb354dd 463fi
25c725c2 464
603f3eff
MJ
465AC_ARG_ENABLE(deprecated-core-db-events,
466 [AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"])
467
468if test x"$enable_deprecated_core_db_events" = x"yes" ; then
469 AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events])
470fi
471
25c725c2
AM
472AC_ARG_ENABLE(timerfd-wrapper,
473[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
474AM_CONDITIONAL([ENABLE_TIMERFD_WRAPPER],[test "x$enable_timer_fd_wrapper" != "xno"])
475
f2067001
BW
476ESL_LDFLAGS=
477PLATFORM_CORE_LDFLAGS=
478PLATFORM_CORE_LIBS=
d28b2391 479
b544f60b 480AC_CHECK_LIB(z, inflateReset, have_libz=yes, AC_MSG_ERROR([no usable zlib; please install zlib devel package or equivalent]))
da195caa 481if test "x$have_libz" = "xyes" ; then
ee60781d 482APR_ADDTO([PLATFORM_CORE_LIBS], [-lz])
da195caa
MJ
483fi
484
b544f60b
KR
485AC_CHECK_LIB(jpeg, jpeg_std_error,, AC_MSG_ERROR([no usable libjpeg; please install libjpeg devel package or equivalent]))
486
7952f7c5
KR
487AC_CHECK_LIB(jbig, jbg_enc_out, have_libjbig=yes, have_libjbig=no)
488if test "x$have_libjbig" = "xyes" ; then
489SPANDSP_LA_JBIG="-ljbig"
490AC_SUBST(SPANDSP_LA_JBIG)
491fi
492
58e7db0c
MJ
493AC_CHECK_LIB(lzma, lzma_code, have_liblzma=yes, have_liblzma=no)
494if test "x$have_liblzma" = "xyes" ; then
495SPANDSP_LA_LZMA="-llzma"
496AC_SUBST(SPANDSP_LA_LZMA)
497fi
498
b017931c
MJ
499AC_CHECK_LIB(resolv, res_init, have_libresolv=yes, have_libresolv=no)
500if test "x$have_libresolv" = "xyes" ; then
501APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv)
502fi
503
55b3e6cb
MJ
504# tweak platform specific flags
505case "$host" in
851db97a 506 *darwin12.*|*darwin11.*)
0952a99a 507 APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
85d6b9af
MJ
508 APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp -Wno-deprecated-declarations -I/usr/local/opt/openssl/include)
509 APR_ADDTO(LDFLAGS, -pipe -bind_at_load -L/usr/local/opt/openssl/lib)
0952a99a
MJ
510 APR_ADDTO(CXXFLAGS, -pipe)
511 APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
512 if test "x$enable_core_odbc_support" != "xno"; then
513 APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
514 fi
515 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
516 ;;
5e7986bf
MJ
517 *darwin10.*)
518 APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
85d6b9af
MJ
519 APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp -I/usr/local/opt/openssl/include)
520 APR_ADDTO(LDFLAGS, -pipe -bind_at_load -L/usr/local/opt/openssl/lib)
5e7986bf
MJ
521 APR_ADDTO(CXXFLAGS, -pipe)
522 APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
523 if test "x$enable_core_odbc_support" != "xno"; then
a48da3b4 524 APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
5e7986bf 525 fi
cdabd564 526 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
5e7986bf 527 ;;
6ae16d15 528 *darwin*)
85d6b9af
MJ
529 APR_ADDTO(CFLAGS, -I/usr/local/opt/openssl/include)
530 APR_ADDTO(LDFLAGS, -L/usr/local/opt/openssl/lib)
55b3e6cb
MJ
531 APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
532 APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
9a9ba4c3 533 if test "x$enable_core_odbc_support" != "xno"; then
a48da3b4 534 APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
9a9ba4c3 535 fi
cdabd564 536 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
55b3e6cb
MJ
537 ;;
538 *-solaris2*)
cb1cb69e 539 APR_ADDTO(SWITCH_AM_CFLAGS, -DPATH_MAX=2048 -D__EXTENSIONS__)
54a9eba4 540 APR_ADDTO(SWITCH_AM_LDFLAGS, -lsendfile -lresolv -lsocket -lnsl -luuid)
bb33c4e7 541 APR_ADDTO(ESL_LDFLAGS, -lnsl -lsocket)
a48da3b4 542 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt -lsendfile -lresolv -lsocket -lnsl -luuid])
55b3e6cb 543 ;;
f0b58efb
MJ
544 *bsd*)
545 APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
041e3bf0 546 APR_ADDTO([PLATFORM_CORE_LIBS], [-lcrypt -lrt])
a48da3b4
SK
547 ;;
548 *linux*)
549 APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt])
f0b58efb 550 ;;
55b3e6cb
MJ
551esac
552
514bde18
MJ
553APR_REMOVEFROM(SWITCH_AM_CXXFLAGS, -std=c99)
554
55b3e6cb 555AC_SUBST(SWITCH_AM_CFLAGS)
02c7a3ac 556AC_SUBST(SWITCH_ANSI_CFLAGS)
514bde18 557AC_SUBST(SWITCH_AM_CXXFLAGS)
55b3e6cb 558AC_SUBST(SWITCH_AM_LDFLAGS)
3ec59cdb 559AC_SUBST(ESL_LDFLAGS)
a48da3b4
SK
560AC_SUBST(PLATFORM_CORE_LDFLAGS)
561AC_SUBST(PLATFORM_CORE_LIBS)
6bc48b70
MJ
562AC_SUBST(SOLINK)
563AC_SUBST(DYNAMIC_LIB_EXTEN)
02141e30 564AC_SUBST(LIBTOOL_LIB_EXTEN)
6bc48b70 565
4da77ea5
AM
566# Checks for header files.
567AC_HEADER_DIRENT
568AC_HEADER_STDC
6b6c83a7 569AC_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 570
56008e2b
AM
571if test x"$ac_cv_header_wchar_h" = xyes; then
572 HAVE_WCHAR_H_DEFINE=1
573else
574 HAVE_WCHAR_H_DEFINE=0
575fi
576AC_SUBST(HAVE_WCHAR_H_DEFINE)
4da77ea5 577
6b6c83a7
JL
578# Needed by Abyss on Solaris:
579
580if test x"$ac_cv_header_sys_filio_h" = xyes; then
581 HAVE_SYS_FILIO_H_DEFINE=1
582else
583 HAVE_SYS_FILIO_H_DEFINE=0
584fi
585AC_SUBST(HAVE_SYS_FILIO_H_DEFINE)
586
587# Needed by Abyss on Solaris:
588
589if test x"$ac_cv_header_sys_ioctl_h" = xyes; then
590 HAVE_SYS_IOCTL_H_DEFINE=1
591else
592 HAVE_SYS_IOCTL_H_DEFINE=0
593fi
594AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
595
596if test x"$ac_cv_header_sys_select_h" = xyes; then
597 HAVE_SYS_SELECT_H_DEFINE=1
598else
599 HAVE_SYS_SELECT_H_DEFINE=0
600fi
601AC_SUBST(HAVE_SYS_SELECT_H_DEFINE)
602
4da77ea5
AM
603# Checks for typedefs, structures, and compiler characteristics.
604AC_C_CONST
605AC_C_INLINE
606AC_TYPE_SIZE_T
607AC_HEADER_TIME
608AC_STRUCT_TM
609
610# Checks for library functions.
611AC_PROG_GCC_TRADITIONAL
612AC_FUNC_MALLOC
613AC_TYPE_SIGNAL
614AC_FUNC_STRFTIME
d91f67d0 615AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt])
ea5c0c21 616AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups])
4062b636 617AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp])
b382c0a4 618
8bcf3b4f
SK
619# Check availability and return type of strerror_r
620# (NOTE: apr-1-config sets -D_GNU_SOURCE at build-time, need to run the check with it too)
621save_CPPFLAGS="$CPPFLAGS"
622CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
623AC_FUNC_STRERROR_R
624CPPFLAGS="$save_CPPFLAGS"
625
ea5c0c21
MJ
626AX_HAVE_CPU_SET
627
eb9f9fb2 628AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
d314f254 629AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])])
eb9f9fb2 630AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
6627dc86 631AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
5f469ad2 632
4062b636 633AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
eb9f9fb2 634
d91f67d0
AM
635AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
636AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
637
bf988471 638AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
21159328
MJ
639#include <sys/types.h>
640#include <time.h>])
641
bf988471 642AC_CHECK_MEMBERS([struct tm.tm_zone],,,[
21159328
MJ
643#include <sys/types.h>
644#include <time.h>])
645
b382c0a4
MJ
646AC_CHECK_DECL([RLIMIT_MEMLOCK],
647 [AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],,
648 [#ifdef HAVE_SYS_RESOURCE_H
649 #include <sys/resource.h>
650 #endif])
651
652AC_CHECK_DECL([SCHED_RR],
653 [AC_DEFINE([HAVE_SCHED_RR],[1],[SCHED_RR constant for sched_setscheduler])],,
654 [#ifdef HAVE_SCHED_H
655 #include <sched.h>
656 #endif])
657
817439d7
AM
658AC_CHECK_DECL([SCHED_FIFO],
659 [AC_DEFINE([HAVE_SCHED_FIFO],[1],[SCHED_FIFO constant for sched_setscheduler])],,
660 [#ifdef HAVE_SCHED_H
661 #include <sched.h>
662 #endif])
663
b382c0a4
MJ
664#
665# use mlockall only on linux (for now; if available)
666#
667if test "x${ac_cv_func_mlockall}" = "xyes"; then
668 AC_MSG_CHECKING([whether to use mlockall])
669 case "$host" in
670 *-linux-*)
671 AC_DEFINE([USE_MLOCKALL],[1],[Enable mlockall support])
672 AC_MSG_RESULT([yes])
673 USE_MLOCKALL=yes
674 ;;
675 *-freebsd*)
883de14f
JL
676 APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
677 APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
b382c0a4
MJ
678 AC_MSG_RESULT([no, broken for non-root users])
679 ;;
680 *)
681 AC_MSG_RESULT([no])
682 ;;
683 esac
684
685 #
686 # setrlimit prerequisites
687 #
688 if test "x${USE_MLOCKALL}" = "xyes" -a \
689 "x${ac_cv_func_setrlimit}" = "xyes" -a \
690 "x${ac_cv_have_decl_RLIMIT_MEMLOCK}" = "xyes"
691 then
692 AC_DEFINE([USE_SETRLIMIT],[1],[Use setrlimit to disable mlock limit for non-root users])
693 fi
694fi
695
696#
697# sched_setcheduler + round-robin scheduler prerequisites
698#
699if test "x${ac_cv_func_sched_setscheduler}" = "xyes" -a \
700 "x${ac_cv_have_decl_SCHED_RR}" = "xyes"
701then
702 AC_DEFINE([USE_SCHED_SETSCHEDULER],[1],[Enable round-robin scheduler using sched_setscheduler])
703fi
4062b636
AM
704#
705# xmlrpc-c checks
706#
707
6b6c83a7 708AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull)
4062b636
AM
709
710HAVE_LIBWWW_SSL_DEFINE=0
711AC_SUBST(HAVE_LIBWWW_SSL_DEFINE)
712
713DIRECTORY_SEPARATOR="/"
714AC_SUBST(DIRECTORY_SEPARATOR)
715
716va_list_is_array=no
717AC_MSG_CHECKING(whether va_list is an array)
718AC_TRY_COMPILE([
719#include <stdarg.h>
720], [va_list list1, list2; list1 = list2;], ,
721va_list_is_array=yes)
722AC_MSG_RESULT($va_list_is_array)
723if test x"$va_list_is_array" = xyes; then
724 VA_LIST_IS_ARRAY_DEFINE=1
725else
726 VA_LIST_IS_ARRAY_DEFINE=0
727fi
728AC_SUBST(VA_LIST_IS_ARRAY_DEFINE)
729
554f476c 730
4062b636
AM
731AC_MSG_CHECKING(whether compiler has __attribute__)
732AC_TRY_COMPILE(, [int x __attribute__((__unused__));],
733compiler_has_attribute=yes,
734compiler_has_attribute=no)
735AC_MSG_RESULT($compiler_has_attribute)
736if test x"$compiler_has_attribute" = xyes; then
737 ATTR_UNUSED="__attribute__((__unused__))"
738else
739 ATTR_UNUSED=
740fi
741AC_SUBST(ATTR_UNUSED)
742
743
554f476c
MJ
744saved_CFLAGS="$CFLAGS"
745AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [
746CFLAGS="$CFLAGS -Wdeclaration-after-statement"
747AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no])
748])
749AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement)
750if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then
751 APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wdeclaration-after-statement)
752fi
753CFLAGS="$saved_CFLAGS"
4da77ea5 754
c7ccf84a
MJ
755if test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
756 # Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off
757 AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [
758 AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no])
759 ])
760 AC_MSG_RESULT($ac_cv_clang_extended_offsetof)
761 if test x"$ac_cv_clang_extended_offsetof" = xyes; then
762 APR_ADDTO(CFLAGS, -Wno-extended-offsetof)
763 fi
44d5d43b
MJ
764fi
765
eb8ff5a0
MOC
766# Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready
767# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_skypopen mod_h323 mod_khomp
768# mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed
769#
770#saved_CFLAGS="$CFLAGS"
771#AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [
772#CFLAGS="$CFLAGS -Wunused-but-set-variable"
773#AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no])
774#])
775#AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable)
776#if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then
777# APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wunused-but-set-variable)
778#fi
779#CFLAGS="$saved_CFLAGS"
f952719e 780
44cc7d5c 781AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
49a0eb29 782
42e78242
MJ
783# Checks for integer size
784AC_CHECK_SIZEOF(char, 1)
785AC_CHECK_SIZEOF(int, 4)
786AC_CHECK_SIZEOF(long, 4)
787AC_CHECK_SIZEOF(short, 2)
788AC_CHECK_SIZEOF(long long, 8)
789AC_TYPE_SIZE_T
790AC_CHECK_TYPE(ssize_t, int)
791
792# Checks for pointer size
793AC_CHECK_SIZEOF(void*, 4)
794
795if test "x$ac_cv_sizeof_voidp" != "x"; then
796 voidp_size=$ac_cv_sizeof_voidp
797else
798 AC_ERROR([Cannot determine size of void*])
799fi
800
801if test "$ac_cv_sizeof_short" = "2"; then
802 short_value=short
803fi
804if test "$ac_cv_sizeof_int" = "4"; then
805 int_value=int
806fi
807
808if test "$ac_cv_sizeof_int" = "8"; then
809 int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
810 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
811 int64_value="int"
812 long_value=int
813elif test "$ac_cv_sizeof_long" = "8"; then
814 int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
815 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
816 int64_value="long"
817 long_value=long
764b7958 818 case "$host" in
f6fe2667 819 *-solaris2*|*apple-darwin*|*-openbsd*)
764b7958
MJ
820 if test "$ac_cv_sizeof_long_long" = "8"; then
821 int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
822 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
823 int64_value="long long"
824 long_value="long long"
825 fi
826 ;;
827 esac
42e78242
MJ
828elif test "$ac_cv_sizeof_long_long" = "8"; then
829 int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
830 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
831 int64_value="long long"
832 long_value="long long"
833elif test "$ac_cv_sizeof_longlong" = "8"; then
834 int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
835 uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
836 int64_value="__int64"
837 long_value="__int64"
838else
839 AC_ERROR([could not detect a 64-bit integer type])
840fi
841
842if test "$ac_cv_type_size_t" = "yes"; then
843 size_t_value="size_t"
844else
845 size_t_value="switch_int32_t"
846fi
847
848if test "$ac_cv_type_ssize_t" = "yes"; then
849 ssize_t_value="ssize_t"
850else
851 ssize_t_value="switch_int32_t"
852fi
853
854APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
855
856if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
857 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
858elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
859 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
860else
861 ssize_t_fmt='#error Can not determine the proper size for ssize_t'
862fi
863
864APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
865
866if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
867 size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
868elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
869 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
870else
d90bac38 871 size_t_fmt='#define SWITCH_SIZE_T_FMT "zu"'
42e78242
MJ
872fi
873
874# Basically, we have tried to figure out the correct format strings
875# for SWITCH types which vary between platforms, but we don't always get
876# it right. If you find that we don't get it right for your platform,
877# you can override our decision below.
878# NOTE: borrowed much of this logic from apr.
879case $host in
880 s390*linux*)
881 # uniquely, the 31-bit Linux/s390 uses "unsigned long int"
882 # for size_t rather than "unsigned int":
883 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
884 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
885 ;;
886 *-os2*)
887 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
888 ;;
6d66ecfd
MJ
889 *-openbsd*)
890 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
891 ;;
42e78242
MJ
892 *aix4*|*aix5*)
893 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
894 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
895 ;;
896 *beos*)
897 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
898 size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
899 ;;
900 *apple-darwin*)
901 osver=`uname -r`
902 case $osver in
903 [0-7].*)
904 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
905 ;;
906 *)
907 ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
908 ;;
909 esac
910 size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
911 ;;
912esac
913
914AC_SUBST(voidp_size)
915AC_SUBST(short_value)
916AC_SUBST(int_value)
917AC_SUBST(long_value)
918AC_SUBST(int64_value)
919AC_SUBST(size_t_value)
920AC_SUBST(ssize_t_value)
921AC_SUBST(int64_t_fmt)
922AC_SUBST(uint64_t_fmt)
923AC_SUBST(ssize_t_fmt)
924AC_SUBST(size_t_fmt)
42e78242 925
f6fe2667
MJ
926case $host in
927 *-openbsd*)
928 # OpenBSD's gunzip and friends don't like -d because its redundant, only gzip does
929 AC_PATH_PROGS(ZCAT, gzip)
930 ;;
931 *)
932 AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat)
933 ;;
934esac
935
50328a66
TC
936AC_PATH_PROGS(BZIP, bzip2)
937AC_PATH_PROGS(XZ, xz)
bc34fb76
MJ
938AC_PATH_PROGS(TAR, gtar tar)
939AC_PATH_PROGS(WGET, wget)
940AC_PATH_PROGS(CURL, curl)
d2cf7f86 941GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getlib.sh"
c99d8c9b 942AC_SUBST(GETLIB)
17d52112
MJ
943GETG729="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getg729.sh"
944AC_SUBST(GETG729)
d2cf7f86 945GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh"
3d5fcabe 946AC_SUBST(GETSOUNDS)
c99d8c9b 947
bc34fb76 948
493fc648
MJ
949LIBCURL_DEPS=
950
951AC_ARG_WITH(libcurl,
952 AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
953 [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
954
e704f021
MP
955AC_CACHE_CHECK([whether to use system libcurl library], [ac_cv_use_system_curl], [
956 LIBCURL_CHECK_CONFIG([yes], [7.13.0], [ac_cv_use_system_curl='yes'], [ac_cv_use_system_curl='no'])
957])
958
493fc648
MJ
959if test "$_libcurl_with" = "no" ; then
960 ac_cv_use_system_curl=no;
961fi
962if test "$_libcurl_with" = "yes" ; then
963 ac_cv_use_system_curl=yes;
964fi
965
36f0a5b8
MJ
966if test "$ac_cv_use_system_curl" = "yes" ; then
967AC_CACHE_CHECK([whether to use system libcurl library], [ac_cv_curl_usable], [
968 AC_CHECK_LIB(curl, Curl_setopt, [ac_cv_curl_usable="yes"], [ac_cv_curl_usable="no"])
969])
970fi
971
972if test "$ac_cv_curl_usable" != "yes" ; then
973 ac_cv_use_system_curl=no;
974fi
975
493fc648
MJ
976if test "$ac_cv_use_system_curl" != "yes" ; then
977 LIBCURL_DEPS='${switch_builddir}/libs/curl/lib/libcurl.la'
978 LIBCURL='${switch_builddir}/libs/curl/lib/libcurl.la'
979 LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include'
a7238d0b
AM
980else
981 SWITCH_AM_LDFLAGS="$LIBCURL $SWITCH_AM_LDFLAGS"
493fc648
MJ
982fi
983
a7238d0b
AM
984SWITCH_AM_CFLAGS="$LIBCURL_CPPFLAGS $SWITCH_AM_CFLAGS"
985SWITCH_AM_CXXFLAGS="$LIBCURL_CPPFLAGS $SWITCH_AM_CXXFLAGS"
986
74ed2cef
MJ
987AM_CONDITIONAL([CURL_BUILTIN],[test "${ac_cv_use_system_curl}" != "yes"])
988
f85be6ff
MJ
989AC_SUBST(LIBCURL_DEPS)
990
4d62a1ad 991
c5c13c26 992AC_ARG_ENABLE(core-libedit-support,
2bcd991b 993 [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])], [enable_core_libedit_support="$enableval"], [enable_core_libedit_support="yes"])
c5c13c26 994
28213aad 995if test "$enable_core_libedit_support" = "yes" ; then
58e7db0c
MJ
996 AC_CHECK_LIB(tinfo, tgetent, [have_libtinfo="yes"], [have_libtinfo="no"])
997 if test "$have_libtinfo" == "yes" ; then
998 TINFO_LIBS="-ltinfo"
999 else
1000 TINFO_LIBS=""
1001 AC_CHECK_LIB(ncurses, tgetent,,
1002 [AC_CHECK_LIB(curses, tgetent,,
1003 [AC_MSG_ERROR([libtermcap, libcurses or libncurses are required!])] )] )
1004 fi
1005 AC_SUBST(TINFO_LIBS)
28213aad
AM
1006fi
1007
219a2ecc
AT
1008SAC_OPENSSL
1009
9d6d8a1c
AT
1010if test x$HAVE_OPENSSL = x1; then
1011 openssl_CFLAGS="$openssl_CFLAGS -DHAVE_OPENSSL";
1d18b58b 1012 APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL)
85d6b9af
MJ
1013 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 associaed developement headers required]))
1014 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 1015else
85d6b9af 1016 AC_MSG_ERROR([OpenSSL >= 1.0.1e and associaed developement headers required])
9d6d8a1c
AT
1017fi
1018
e69fe7e3 1019AX_CHECK_JAVA
7df787b7 1020
2e32d105
PO
1021# Option to enable static linking of Google's V8 inside mod_v8
1022AC_ARG_ENABLE(static-v8,
1023[AS_HELP_STRING([--enable-static-v8], [Statically link V8 into mod_v8])], [enable_static_v8="$enableval"], [enable_static_v8="no"])
1024AM_CONDITIONAL([ENABLE_STATIC_V8],[test "x$enable_static_v8" != "xno"])
753fa8fb 1025
31b743d6
MJ
1026AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
1027AM_CONDITIONAL([HAVE_LIBEDIT],[test "x$enable_core_libedit_support" != "xno"])
778a82cc 1028AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
49a0eb29 1029
e8c88aa1
SK
1030#
1031# Python checks for mod_python
1032#
1033AC_ARG_WITH(
1034 [python],
1035 [AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])],
1036 [with_python="$withval"],
1037 [with_python="try"]
1038)
1039
e8c88aa1
SK
1040if test "$with_python" != "no"
1041then
2d14539e
SK
1042 save_CFLAGS="$CFLAGS"
1043 save_LIBS="$LIBS"
1044
e8c88aa1
SK
1045 if test "$with_python" != "yes" -a "$with_python" != "try" ; then
1046 AC_MSG_CHECKING([for python])
1047 if test ! -x "$with_python" ; then
1048 AC_MSG_ERROR([Specified python does not exist or is not executable: $with_python])
1049 fi
1050 AC_MSG_RESULT([$with_python])
1051 AC_SUBST([PYTHON], ["$with_python"])
1052 else
1053 AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
1054 fi
1055
1056 if test "$PYTHON" != "no" ; then
1057 AC_MSG_CHECKING([python version])
1058 PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`"
1059
1060 if test -z "$PYTHON_VER" ; then
1061 AC_MSG_ERROR([Unable to detect python version])
1062 fi
1063 AC_MSG_RESULT([$PYTHON_VER])
1064
2d14539e 1065 AC_MSG_CHECKING([for python distutils])
baf944eb
SK
1066 python_result="`$PYTHON -c 'import distutils;' 2>&1`"
1067 if test -z "$python_result" ; then
2d14539e 1068 python_has_distutils="yes"
baf944eb
SK
1069 else
1070 python_has_distutils="no"
2d14539e
SK
1071 fi
1072 AC_MSG_RESULT([$python_has_distutils])
1073
baf944eb 1074 if test "$python_has_distutils" != "no" ; then
f08ac862
SK
1075 AC_MSG_CHECKING([location of site-packages])
1076
83680470 1077 PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
f08ac862
SK
1078
1079 if test -z "$PYTHON_SITE_DIR" ; then
1080 AC_MSG_ERROR([Unable to detect python site-packages path])
1081 elif test ! -d "$PYTHON_SITE_DIR" ; then
1082 AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!])
1083 fi
1084 AC_MSG_RESULT([$PYTHON_SITE_DIR])
1085 AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR])
1086
2d14539e
SK
1087 #
1088 # python distutils found, get settings from python directly
1089 #
93129e32 1090 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
1091 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));'`"
1092 PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`"
1093 PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
ba892c27
SK
1094
1095 # handle python being installed into /usr/local
1096 AC_MSG_CHECKING([python libdir])
1097 if test -z "`echo $PYTHON_LIBDIR | grep "/usr/lib"`" ; then
1098 PYTHON_LDFLAGS="-L$PYTHON_LIBDIR $PYTHON_LDFLAGS"
1099 LIBS="-L$PYTHON_LIBDIR $LIBS"
1100 fi
1101 AC_MSG_RESULT([$PYTHON_LIBDIR])
e8c88aa1 1102
2d14539e
SK
1103 # check libpython
1104 AC_CHECK_LIB([$PYTHON_LIB], [main], [has_libpython="yes"], [has_libpython="no"])
1105
1106 if test "$has_libpython" = "no" ; then
1107 AS_IF([test "$with_python" = "try"],
1108 [AC_MSG_WARN([$PYTHON_LIB is unusable])],
1109 [AC_MSG_ERROR([$PYTHON_LIB is unusable])]
1110 )
1111 fi
e8c88aa1
SK
1112
1113 # check whether system libpython is usable and has threads support
2d14539e 1114 CFLAGS="$PYTHON_CFLAGS"
e8c88aa1
SK
1115 LIBS="$PYTHON_LDFLAGS"
1116 AC_CHECK_FUNC([PyThread_init_thread], [python_has_threads="yes"], [python_has_threads="no"])
e8c88aa1 1117
2d14539e
SK
1118 if test "$python_has_threads" = "no"; then
1119 AS_IF([test "$with_python" = "try"],
1120 [AC_MSG_WARN([Your python lacks threads support, can not build mod_python])],
1121 [AC_MSG_ERROR([Your python lacks threads support, can not build mod_python])]
1122 )
e8c88aa1
SK
1123 else
1124 AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf])
2d14539e 1125 AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS])
e8c88aa1
SK
1126 AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS])
1127 fi
1128 else
2d14539e 1129 AS_IF([test "$with_python" = "try"],
baf944eb
SK
1130 [AC_MSG_WARN([Could not find or use python distutils module: $python_result])],
1131 [AC_MSG_ERROR([Could not find or use python distutils module: $python_result])]
2d14539e 1132 )
e8c88aa1
SK
1133 fi
1134
2d14539e
SK
1135 LIBS="$save_LIBS"
1136 CFLAGS="$save_CFLAGS"
1137
1138 unset python_has_threads
1139 unset python_has_distutils
baf944eb 1140 unset python_result
2d14539e
SK
1141 else
1142 AS_IF([test "$with_python" = "try"],
1143 [AC_MSG_WARN([Could not find python, mod_python will not build, use --with-python to specify the location])],
1144 [AC_MSG_ERROR([Could not find python, use --with-python to specify the location])]
1145 )
e8c88aa1
SK
1146 fi
1147else
1148 AC_MSG_WARN([python support disabled, building mod_python will fail!])
1149fi
1150
ea0316b8
AT
1151CHECK_ERLANG
1152
42e78242 1153AC_CONFIG_FILES([Makefile
7b3d3f7e
AM
1154 build/Makefile
1155 src/Makefile
1156 src/mod/Makefile
aad61cad 1157 src/mod/applications/mod_expr/Makefile
fa9a59a8 1158 src/mod/applications/mod_spandsp/Makefile
dc06a039 1159 src/mod/applications/mod_osp/Makefile
ea181ca4 1160 src/mod/applications/mod_stress/Makefile
a31222ac 1161 src/mod/applications/mod_hash/Makefile
17d52112 1162 src/mod/codecs/mod_com_g729/Makefile
59472c23 1163 src/mod/endpoints/mod_portaudio/Makefile
ad4eb5e0 1164 src/mod/endpoints/mod_skinny/Makefile
99e55ae0 1165 src/mod/endpoints/mod_skypopen/Makefile
7b3d3f7e 1166 src/mod/endpoints/mod_sofia/Makefile
59472c23 1167 src/mod/formats/mod_portaudio_stream/Makefile
7b3d3f7e
AM
1168 src/mod/asr_tts/mod_unimrcp/Makefile
1169 src/mod/languages/mod_java/Makefile
9b8392bc 1170 src/mod/languages/mod_lua/Makefile
2643ac2b 1171 src/mod/legacy/languages/mod_lua/Makefile
7b3d3f7e 1172 src/mod/languages/mod_python/Makefile
0c1ae13d 1173 src/mod/languages/mod_spidermonkey/Makefile
b7623326 1174 src/mod/languages/mod_v8/Makefile
7b3d3f7e
AM
1175 src/mod/event_handlers/mod_erlang_event/Makefile
1176 src/include/switch_am_config.h
1177 build/getsounds.sh
1178 build/getlib.sh
17d52112 1179 build/getg729.sh
68b58406 1180 build/freeswitch.pc
7b3d3f7e 1181 build/modmake.rules
58e7db0c 1182 libs/esl/eslmake.rules
7b3d3f7e 1183 libs/xmlrpc-c/xmlrpc_config.h
6b6c83a7
JL
1184 libs/xmlrpc-c/config.mk
1185 libs/xmlrpc-c/srcdir.mk
1186 libs/xmlrpc-c/stamp-h
7b3d3f7e 1187 scripts/gentls_cert])
4da77ea5 1188
a6e9f279 1189AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
db399276 1190AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
a092a55a 1191AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
a6e9f279 1192
c7753b06
MJ
1193#some vars to sub into the Makefile.am's
1194#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
1195LIBTOOL='`if test -z "$(VERBOSE)" ; then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(switch_builddir)/libtool; fi;`'
1196TOUCH_TARGET='if test -f "$@";then touch "$@";fi;'
afe7d97f 1197CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed -e "s|^.*/||" | sort | uniq )'
b9f2bdfb 1198CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed -e "s|^.*/||" | sort | uniq )'
afe7d97f
MJ
1199OUR_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 )'
1200OUR_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 )'
1201OUR_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 )'
1202OUR_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 )'
1203OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
1204OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
1205OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
1206OUR_DISABLED_UNINSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
ed960392
AM
1207
1208AM_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 1209#AM_MAKEFLAGS='`test -n "$(VERBOSE)" || echo -s`'
c7753b06
MJ
1210AC_SUBST(LIBTOOL)
1211AC_SUBST(TOUCH_TARGET)
ed960392 1212AC_SUBST(CONF_DISABLED_MODULES)
5f053e18 1213AC_SUBST(CONF_MODULES)
ed960392 1214
5f053e18
MJ
1215AC_SUBST(OUR_MODS)
1216AC_SUBST(OUR_CLEAN_MODS)
1217AC_SUBST(OUR_INSTALL_MODS)
1218AC_SUBST(OUR_UNINSTALL_MODS)
ed960392
AM
1219AC_SUBST(OUR_DISABLED_MODS)
1220AC_SUBST(OUR_DISABLED_CLEAN_MODS)
1221AC_SUBST(OUR_DISABLED_INSTALL_MODS)
1222AC_SUBST(OUR_DISABLED_UNINSTALL_MODS)
c7753b06
MJ
1223AC_SUBST(AM_MAKEFLAGS)
1224
74fd6fb6 1225ac_configure_args="$ac_configure_args CONFIGURE_CFLAGS='$CFLAGS' CONFIGURE_CXXFLAGS='$CXXFLAGS' CONFIGURE_LDFLAGS='$LDFLAGS' "
452b0bde 1226
40ff9a41
MJ
1227# --prefix='$prefix' --exec_prefix='$exec_prefix' --libdir='$libdir' --libexecdir='$libexecdir' --bindir='$bindir' --sbindir='$sbindir' \
1228# --localstatedir='$localstatedir' --datadir='$datadir'"
8f9ab613 1229
46f6981d 1230# Run configure in all the subdirs
236bfeea
MJ
1231AC_CONFIG_SUBDIRS([libs/srtp])
1232AC_CONFIG_SUBDIRS([libs/sqlite])
1233if test "$enable_core_libedit_support" = "yes" ; then
1234 AC_CONFIG_SUBDIRS([libs/libedit])
1235fi
1236
1237AC_CONFIG_SUBDIRS([libs/pcre])
1238AC_CONFIG_SUBDIRS([libs/apr])
1239AC_CONFIG_SUBDIRS([libs/apr-util])
1240AC_CONFIG_SUBDIRS([libs/ilbc])
1241AC_CONFIG_SUBDIRS([libs/curl])
1242AC_CONFIG_SUBDIRS([libs/iksemel])
1243AC_CONFIG_SUBDIRS([libs/js/nsprpub])
1244AC_CONFIG_SUBDIRS([libs/js])
1245AC_CONFIG_SUBDIRS([libs/libdingaling])
1246AC_CONFIG_SUBDIRS([libs/libsndfile])
1247AC_CONFIG_SUBDIRS([libs/sofia-sip])
1248AC_CONFIG_SUBDIRS([libs/speex])
1249AC_CONFIG_SUBDIRS([libs/portaudio])
1250AC_CONFIG_SUBDIRS([libs/openzap])
1251AC_CONFIG_SUBDIRS([libs/freetdm])
1252AC_CONFIG_SUBDIRS([libs/unimrcp])
1253AC_CONFIG_SUBDIRS([libs/tiff-4.0.2])
1254AC_CONFIG_SUBDIRS([libs/spandsp])
1255AC_CONFIG_SUBDIRS([libs/broadvoice])
1256AC_CONFIG_SUBDIRS([libs/libg722_1])
1257AC_CONFIG_SUBDIRS([libs/silk])
1258AC_CONFIG_SUBDIRS([libs/libcodec2])
1259if test "x${enable_zrtp}" = "xyes"; then
e5a1b54e 1260 AC_CONFIG_SUBDIRS([libs/libzrtp])
393b63b7 1261fi
236bfeea 1262AC_CONFIG_SUBDIRS([libs/libwebsockets])
ee3fc89f 1263
f6fe2667
MJ
1264case $host in
1265 *-openbsd*)
1266 # libtool won't link static libs against shared ones on OpenBSD unless we tell it not to be stupid
1267 AC_CONFIG_COMMANDS([hacklibtool], [cp libtool libtool.orig && sed -e "s/deplibs_check_method=.*/deplibs_check_method=pass_all/g" libtool.orig > libtool])
1268 ;;
1269esac
1270
1271
6e81dda1 1272AC_OUTPUT
5ccac21d 1273
1ed00b4d
BW
1274##
1275## Registering for ClueCon
1276##
4ff9b2f1 1277if ! test -f noreg ; then
1ed00b4d
BW
1278echo ""
1279echo ""
1280echo $ECHO_N "Registering you for ClueCon http://www.cluecon.com $ECHO_C" 1>&6
82f77413 1281sleep 1
1ed00b4d 1282echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1283sleep 1
1ed00b4d 1284echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1285sleep 1
1ed00b4d 1286echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1287sleep 1
1ed00b4d 1288echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1289sleep 1
61172345 1290echo $ECHO_N ".$ECHO_C" 1>&6
82f77413 1291sleep 1
1ed00b4d 1292AC_MSG_RESULT([ See you in August. ;-)])
82f77413 1293sleep 2
1ed00b4d 1294echo ""
17d52112 1295fi
1ed00b4d 1296
5ccac21d
MJ
1297##
1298## Configuration summary
1299##
1300
1301echo
8912b80e 1302echo "-------------------------- FreeSWITCH configuration --------------------------"
5ccac21d
MJ
1303echo ""
1304echo " Locations:"
1305echo " Selected layout: ${layout_name}"
1306echo ""
1307echo " prefix: ${prefix}"
1308echo " exec_prefix: ${exec_prefix}"
1309echo " bindir: ${bindir}"
1310echo " libdir: ${libdir}"
1311echo " modulesdir: ${modulesdir}"
1312echo " sysconfdir: ${sysconfdir}"
1313echo " runtimedir: ${runtimedir}"
1314echo " logfiledir: ${logfiledir}"
1315echo ""
8912b80e 1316echo "------------------------------------------------------------------------------"