2006-06-28 23:37:53 +00:00
dnl SFLPhone - configure.ac for automake 1.9 and autoconf 2.59
2009-11-13 14:38:29 -05:00
2011-02-28 20:00:01 -05:00
dnl Process this file with autoconf to produce a configure script.
2011-03-01 16:01:45 -05:00
AC_PREREQ([2.65])
2014-09-25 17:55:37 -04:00
AC_INIT([sflphone],[1.4.2],[sflphoneteam@savoirfairelinux.com],[sflphone])
2013-06-10 17:31:31 -04:00
2014-04-15 16:37:06 -04:00
AC_COPYRIGHT([[Copyright (c) Savoir-Faire Linux 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014]])
2006-06-28 23:37:53 +00:00
AC_REVISION([$Revision$])
2014-10-06 15:54:26 -04:00
dnl Where to find configure files
AC_CONFIG_SRCDIR(src/sflphone_api.cpp)
2013-02-19 23:43:53 -05:00
AC_CONFIG_AUX_DIR([build-aux])
2014-10-06 15:54:26 -04:00
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
2013-02-19 23:43:53 -05:00
AM_INIT_AUTOMAKE([-Wno-portability])
2013-02-19 13:24:24 -05:00
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # required by automake 1.12
2011-02-28 20:00:01 -05:00
AC_CONFIG_HEADERS([config.h])
2009-04-02 16:34:46 -04:00
2009-10-09 14:56:25 -04:00
# Silent build by default. Use make V=1 to increase verbosity
2014-05-16 15:17:04 -04:00
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
2009-10-09 14:56:25 -04:00
2011-02-28 20:00:01 -05:00
dnl Check for programs
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
2014-10-06 15:54:26 -04:00
dnl
dnl Check the operating system
dnl
HAVE_WIN64="0"
2014-11-17 15:29:14 -05:00
HAVE_IOS="0"
2014-10-06 15:54:26 -04:00
HAVE_OSX="0"
case "${host_os}" in
"")
SYS=unknown
;;
linux*)
SYS=linux
# Necessary for linking .a to a .so
LDFLAGS+=" -Wl,-Bsymbolic"
;;
darwin*)
SYS=darwin
2014-11-17 15:29:14 -05:00
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
#if TARGET_OS_IPHONE
yes
#endif],
[HAVE_IOS="1"],
[HAVE_OSX="1"])
2014-10-06 15:54:26 -04:00
;;
mingw32*)
SYS=mingw32
AC_CHECK_TOOL(WINDRES, windres, :)
AC_CHECK_TOOL(OBJCOPY, objcopy, :)
AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
AH_TOP([# define _WIN32_WINNT 0x0502 /* Windows XP SP2 */])
AH_TOP([#endif])
AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])
AC_DEFINE([_POSIX_SOURCE], [1], [IEEE Std 1003.1.])
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [XPG things and X/Open Unix extensions.])
AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
AC_DEFINE([_SVID_SOURCE], [1], [ISO C, POSIX, and SVID things.])
LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
ac_default_prefix="`pwd`/_win32"
DESTDIR="`pwd`/_win32/"
AC_SUBST(WINDOWS_ARCH)
AC_SUBST(PROGRAMFILES)
;;
*)
SYS="${host_os}"
;;
esac
AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
dnl Android is linux, but a bit different
AS_IF([test "$SYS" = linux],[
AC_MSG_CHECKING([for an Android system])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#ifndef __ANDROID__
# error Not Android
#endif
]],[[;]])
],[
HAVE_ANDROID="1"
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
])
])
AM_CONDITIONAL(HAVE_ANDROID, test "${HAVE_ANDROID}" = "1")
2014-10-28 13:50:27 -04:00
dnl override platform specific check for dependent libraries
dnl otherwise libtool linking of shared libraries will
dnl fail on anything other than pass_all.
AC_CACHE_VAL(lt_cv_deplibs_check_method,
[lt_cv_deplibs_check_method=pass_all])
LT_INIT([dlopen win32-dll shared disable-static])
2009-07-03 16:40:46 -04:00
2011-08-08 16:22:25 -04:00
dnl Define C++ as default language
2014-10-28 13:50:27 -04:00
LT_LANG(C++)
configure: add DOLT
Shorten build time.
On x86_64 linux build:
LIBTOOL make -j2 60,82s user 13,98s system 112% cpu 1:06,59 total
make -j2 56,83s user 12,72s system 110% cpu 1:03,20 total
DOLT make -j2 44,32s user 11,02s system 108% cpu 51,215 total
make -j2 42,15s user 11,04s system 106% cpu 50,155 total
Signed-off-by: Rafaël Carré <funman@videolan.org>
(cherry picked from commit 8d969f7f52e1bcf0fca8ed683059284abe34ddca)
Conflicts:
configure.ac
Change-Id: I903156a029b70dae545b4c6a0d5aee9cbe484369
2012-09-04 15:54:00 +02:00
DOLT
2014-10-28 13:50:27 -04:00
lt_cv_deplibs_check_method=pass_all
2006-05-25 12:01:00 +00:00
2013-08-12 16:11:39 -04:00
dnl Check for C++11 support
2014-11-14 11:37:50 -05:00
AX_CXX_COMPILE_STDCXX_11([ext],[mandatory])
2013-08-12 16:11:39 -04:00
2011-08-08 16:22:25 -04:00
dnl Check for header files
AC_FUNC_ALLOCA
AC_HEADER_STDC
2014-11-06 19:05:25 -05:00
AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h \
netdb.h netinet/in.h stdlib.h string.h \
sys/ioctl.h sys/socket.h sys/time.h unistd.h])
2011-08-08 16:22:25 -04:00
dnl Check for typedefs, structures, and compiler characteristics
AC_HEADER_STAT
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_C_VOLATILE
2006-06-28 23:37:53 +00:00
AC_CHECK_TYPES([ptrdiff_t])
2014-09-30 16:24:20 -04:00
PKG_PROG_PKG_CONFIG()
2006-05-25 12:01:00 +00:00
2014-09-30 17:01:21 -04:00
dnl On some OS we need static linking
AS_IF([test -n "${PKG_CONFIG}" ],[
AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "darwin"],[
PKG_CONFIG="${PKG_CONFIG} --static"
])
])
2014-04-24 17:50:36 -04:00
dnl Check if we are using clang
AC_MSG_CHECKING([if compiling with clang])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
#ifndef __clang__
not clang
#endif
]])],
[CLANG=yes], [CLANG=no])
AC_MSG_RESULT([$CLANG])
2012-08-29 13:49:14 -04:00
2014-05-02 19:56:27 -04:00
dnl
dnl Check for the contrib directory
dnl
AC_ARG_WITH(contrib,
[AS_HELP_STRING([--with-contrib[=DIR]],
[search for 3rd party libraries in DIR/include and DIR/lib])
])
AC_MSG_CHECKING([for 3rd party libraries path])
AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
2014-08-25 13:57:02 -04:00
CONTRIB_DIR="${srcdir}/contrib/${host}"
2014-05-02 19:56:27 -04:00
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
2014-08-25 13:57:02 -04:00
CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
2014-05-02 19:56:27 -04:00
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
AC_MSG_RESULT([not found])
])
])
], [
AS_IF([test "${with_contrib}" != "no"], [
CONTRIB_DIR="${with_contrib}"
], [
CONTRIB_DIR=""
AC_MSG_RESULT([disabled])
])
])
AS_IF([test -n "${CONTRIB_DIR}"], [
AS_IF([test -d "${CONTRIB_DIR}/lib"],[
CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
], [
echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
AC_MSG_RESULT([not usable])
])
])
AS_IF([test -n "${CONTRIB_DIR}"], [
AC_MSG_RESULT([${CONTRIB_DIR}])
export PATH=${CONTRIB_DIR}/bin:$PATH
CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
2014-08-14 11:13:59 -04:00
export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:${CONTRIB_DIR}/lib64/pkgconfig:$PKG_CONFIG_PATH"
2014-05-02 19:56:27 -04:00
LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
AS_IF([test "${SYS}" = "darwin"], [
export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
])
], [
AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
AC_MSG_ERROR([Third party libraries not found!])
])
])
AC_SUBST(CONTRIB_DIR)
2014-10-17 12:57:36 -04:00
dnl Add extras/tools to the PATH
TOOLS_DIR="${srcdir}/extras/tools/build/bin"
AS_IF([test -d "${TOOLS_DIR}"], [
TOOLS_DIR=`cd "${TOOLS_DIR}" && pwd`
export PATH="${TOOLS_DIR}":$PATH
])
2014-06-06 12:59:02 -04:00
dnl Check for pjproject
PKG_CHECK_MODULES(PJPROJECT, libpjproject,, AC_MSG_ERROR([Missing pjproject files]))
2014-09-15 11:10:49 -04:00
PKG_CHECK_MODULES([YAMLCPP], [yaml-cpp >= 0.5.1],, AC_MSG_ERROR([yaml-cpp not found]))
2012-08-29 13:49:14 -04:00
2014-10-06 15:54:26 -04:00
if test "${HAVE_ANDROID}" = "1"; then
2014-06-17 18:28:24 -04:00
dnl Check for OpenSL
AC_ARG_WITH([opensl],
AS_HELP_STRING([--without-opensl],
[Ignore presence of opensl and disable it]))
AS_IF([test "x$with_opensl" != "xno"],
[AC_CHECK_HEADER(["SLES/OpenSLES.h"],
[have_opensl=yes], [have_opensl=no])],
[have_opensl=no])
AC_DEFINE_UNQUOTED([HAVE_OPENSL],
`if test "x$have_opensl" = "xyes"; then echo 1; else echo 0; fi`,
[Define if you have OpenSL])
fi
AM_CONDITIONAL([BUILD_OPENSL], test "x$have_opensl" = "xyes")
2011-08-08 16:22:25 -04:00
dnl Check for alsa development package - name: libasound2-dev
2011-03-01 10:49:03 -05:00
ALSA_MIN_VERSION=1.0
2012-08-06 16:20:32 -04:00
AC_ARG_WITH([alsa],
2014-04-23 15:14:13 -04:00
[AS_HELP_STRING([--without-alsa], [disable support for alsa])],
2012-08-06 16:20:32 -04:00
[],
[with_alsa=yes])
AS_IF([test "x$with_alsa" = "xyes"], [
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(ALSA, alsa >= ${ALSA_MIN_VERSION},, AC_MSG_ERROR([Missing alsa development files]))
2012-08-06 16:20:32 -04:00
]);
AC_DEFINE_UNQUOTED([HAVE_ALSA], `if test "x$with_alsa" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have alsa])
2013-07-15 11:11:22 -04:00
AM_CONDITIONAL(BUILD_ALSA, test "x$with_alsa" = "xyes")
2012-08-29 13:49:14 -04:00
2011-08-08 16:22:25 -04:00
dnl Check for pulseaudio development package - name: libpulse-dev
2011-03-01 10:49:03 -05:00
LIBPULSE_MIN_VERSION=0.9.15
2012-06-06 19:41:11 -04:00
AC_ARG_WITH([pulse],
2014-04-23 15:14:13 -04:00
[AS_HELP_STRING([--without-pulse], [disable support for pulseaudio])],
2012-08-29 13:49:14 -04:00
[],
[with_pulse=yes])
2012-06-06 19:41:11 -04:00
AS_IF([test "x$with_pulse" = "xyes"], [
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(PULSEAUDIO, libpulse >= ${LIBPULSE_MIN_VERSION},, AC_MSG_ERROR([Missing pulseaudio development files]))
2012-06-06 19:41:11 -04:00
]);
2008-10-08 16:32:30 -04:00
2012-06-07 11:21:47 -04:00
AC_DEFINE_UNQUOTED([HAVE_PULSE], `if test "x$with_pulse" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have pulseaudio])
2012-08-06 16:20:32 -04:00
AM_CONDITIONAL(BUILD_PULSE, test "x$with_pulse" = "xyes")
2012-06-07 11:21:47 -04:00
2014-02-13 19:00:28 -05:00
AC_ARG_WITH([jack],
AS_HELP_STRING([--without-jack], [Ignore presence of jack and disable it]))
AS_IF([test "x$with_jack" != "xno"],
[PKG_CHECK_MODULES(JACK, jack, [have_jack=yes], [have_jack=no])],
[have_jack=no])
AS_IF([test "x$have_jack" = "xyes"],,
[AS_IF([test "x$with_jack" = "xyes"],
[AC_MSG_ERROR([jack requested but not found])
])
])
AC_DEFINE_UNQUOTED([HAVE_JACK], `if test "x$have_jack" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have jack])
AM_CONDITIONAL(BUILD_JACK, test "x$have_jack" = "xyes")
2011-03-01 10:49:03 -05:00
dnl Check for the samplerate development package - name: libsamplerate0-dev
LIBSAMPLERATE_MIN_VERSION=0.1.2
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= ${LIBSAMPLERATE_MIN_VERSION},, AC_MSG_ERROR([Missing libsamplerate development files]))
2006-08-30 18:07:21 +00:00
2013-07-31 16:23:07 -04:00
dnl Check for the sndfile development package - name: libsndfile-dev
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(SNDFILE, sndfile,, AC_MSG_ERROR([Missing sndfile development files]))
2013-07-31 16:23:07 -04:00
2013-03-06 16:34:56 -05:00
dnl Coverage is default-disabled
AC_ARG_ENABLE([coverage], AS_HELP_STRING([--enable-coverage], [Enable coverage]))
AS_IF([test "x$enable_coverage" = "xyes"], [
2013-03-06 18:37:32 -05:00
CXXFLAGS="${CXXFLAGS} --coverage"
LDFLAGS="${LDFLAGS} --coverage"])
2012-08-29 13:49:14 -04:00
2014-05-23 14:53:49 -04:00
# DBUSCPP
dnl Check for dbuscpp, the C++ bindings for D-Bus
AC_ARG_WITH([dbus],
[AS_HELP_STRING([--without-dbus], [disable support for dbus])],
[],
[with_dbus=yes])
AS_IF([test "x$with_dbus" = "xyes"], [
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,, AC_MSG_WARN([Missing dbus development files]))
2014-11-18 14:40:10 -05:00
AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
AC_SUBST(LIBEXECDIR)
AC_CONFIG_FILES([bin/dbus/Makefile
bin/dbus/org.sflphone.SFLphone.service])
2014-05-23 14:53:49 -04:00
AC_CHECK_PROG(HAVE_DBUSXML2CPP, dbusxx-xml2cpp, true, false)
if test "x$HAVE_DBUSXML2CPP" = "xfalse"; then
AC_MSG_ERROR([dbusxx-xml2cpp not found])
fi
AS_IF([test "x$CLANG" = "xyes"], [
AC_MSG_ERROR([dbus does not compile when clang is used, rerun with --without-dbus])
]);
2014-08-01 17:11:04 -04:00
AM_CONDITIONAL(SFL_DBUS, true)],
AM_CONDITIONAL(SFL_DBUS, false));
2014-05-23 14:53:49 -04:00
2014-07-04 18:01:24 -04:00
dnl Video is default-enabled
AC_ARG_ENABLE([video], AS_HELP_STRING([--disable-video], [Disable video]))
2011-06-09 11:49:41 -04:00
2014-07-04 18:01:24 -04:00
AS_IF([test "x$enable_video" != "xno"],
2012-08-29 13:49:14 -04:00
[
2012-01-24 17:57:14 -05:00
AC_DEFINE(SFL_VIDEO, [], [Video support enabled])
2012-08-29 13:49:14 -04:00
AM_CONDITIONAL(SFL_VIDEO, true)
2011-06-09 11:49:41 -04:00
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(LIBAVCODEC, libavcodec >= 53.5.0,, AC_MSG_ERROR([Missing libavcodec development files]))
2012-01-24 17:57:14 -05:00
LIBAVCODEC_CFLAGS="${LIBAVCODEC_CFLAGS} -D__STDC_CONSTANT_MACROS"
2011-06-09 11:49:41 -04:00
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(LIBAVFORMAT, libavformat >= 53.2.0,, AC_MSG_ERROR([Missing libavformat development files]))
2011-06-09 11:49:41 -04:00
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(LIBSWSCALE, libswscale >= 1.1.0,, AC_MSG_ERROR([Missing libswscale development files]))
2012-01-24 17:57:14 -05:00
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(LIBAVDEVICE, libavdevice >= 53.0.0,, AC_MSG_ERROR([Missing libavdevice development files]))
2012-01-24 17:57:14 -05:00
2014-05-30 16:08:10 -04:00
PKG_CHECK_MODULES(LIBAVUTIL, libavutil >= 51.0.0,, AC_MSG_ERROR([Missing libavutil development files]))
2012-03-21 14:30:09 -04:00
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES(UDEV, libudev,, AC_MSG_ERROR([Missing libudev development files]))
2012-08-29 13:49:14 -04:00
],
2014-05-23 14:53:49 -04:00
[
AM_CONDITIONAL(SFL_VIDEO, false)
]);
2011-09-21 10:39:54 -04:00
2012-04-09 12:15:55 -04:00
LIBCCRTP_MIN_VERSION=1.3.0
PKG_CHECK_MODULES([CCRTP], [libccrtp] >= ${LIBCCRTP_MIN_VERSION},, [
2013-08-14 18:25:35 -04:00
PKG_CHECK_MODULES([CCRTP], [libccrtp1] >= ${LIBCCRTP_MIN_VERSION},, AC_MSG_ERROR([Missing ccrtp development files]))
2012-04-09 12:15:55 -04:00
])
2005-12-19 00:11:35 +00:00
2013-10-16 16:14:07 -04:00
dnl Presence is a default-enabled feature
AC_ARG_ENABLE([presence],
AS_HELP_STRING([--disable-presence], [Disable SIP presence support]))
AS_IF([test "x$enable_presence" != "xno"], [
AC_DEFINE(SFL_PRESENCE, [], [Presence support enabled])
AM_CONDITIONAL(SFL_PRESENCE, true)],
AM_CONDITIONAL(SFL_PRESENCE, false))
2012-07-26 13:55:49 -04:00
2014-10-21 16:59:33 -04:00
dnl TLS support is enabled if it's installed and up to date
2012-07-26 14:25:51 -04:00
AC_ARG_WITH([tls],
2014-10-21 16:59:33 -04:00
[AS_HELP_STRING([--with-tls],
[support tls @<:@default=check@:>@])],
[],
[with_tls=check])
AS_CASE(["$with_tls"],
[yes], [PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.1], [HAVE_GNUTLS=1])],
[no], [HAVE_GNUTLS=0],
[PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.1], [HAVE_GNUTLS=1], [HAVE_GNUTLS=0])])
2009-08-17 17:47:02 -04:00
2014-10-27 15:03:38 -04:00
AC_DEFINE_UNQUOTED([HAVE_TLS], `if test $HAVE_GNUTLS -eq 1; then echo 1; else echo 0; fi`, [Define if you have tls support])
AM_CONDITIONAL(BUILD_TLS, test "$HAVE_GNUTLS" -eq 1)
2012-07-26 13:55:49 -04:00
2012-07-26 17:07:39 -04:00
# ZRTP
# required dependency(ies): libzrtp
2011-03-01 10:49:03 -05:00
dnl Check for libzrtpcpp, a ccRTP extension providing zrtp key exchange
2012-07-26 17:07:39 -04:00
AC_ARG_WITH([zrtp],
2014-04-23 15:14:13 -04:00
[AS_HELP_STRING([--without-zrtp], [disable support for zrtp])],
2012-08-29 13:49:14 -04:00
[],
[with_zrtp=yes])
2012-07-27 10:50:12 -04:00
AS_IF([test "x$with_zrtp" = "xyes"], [
2014-02-05 13:47:57 -05:00
PKG_CHECK_MODULES([ZRTPCPP], libzrtpcpp >= 2.3.0, [with_zrtp_configure=yes],
2014-02-04 22:44:54 -05:00
dnl Fallback to older version
2014-02-05 13:47:57 -05:00
[PKG_CHECK_MODULES([ZRTPCPP], libzrtpcpp >= 1.3.0, [with_zrtp_configure=no],
2014-02-04 22:56:59 -05:00
AC_MSG_ERROR([Missing zrtp development files]))])
2012-08-29 13:49:14 -04:00
]);
2012-07-26 17:07:39 -04:00
2014-02-04 22:44:54 -05:00
dnl This is a workaround until libzrtpcpp gets a version macro
2012-07-26 17:07:39 -04:00
AC_DEFINE_UNQUOTED([HAVE_ZRTP], `if test "x$with_zrtp" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have zrtp support])
2014-02-05 13:47:57 -05:00
AC_DEFINE_UNQUOTED([HAVE_ZRTP_CONFIGURE], `if test "x$with_zrtp_configure" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have zrtp >= 2.3.0])
2012-07-26 17:07:39 -04:00
AM_CONDITIONAL(BUILD_ZRTP, test "x$with_zrtp" = "xyes" )
2009-10-09 14:56:25 -04:00
2012-07-26 17:07:39 -04:00
# Instant Messaging
# required dependency(ies): libxpat
2012-07-20 12:38:44 -04:00
AC_ARG_WITH([instant_messaging],
2014-04-23 15:14:13 -04:00
[AS_HELP_STRING([--without-instant_messaging], [disable support for instant-messaging])],
2012-08-29 13:49:14 -04:00
[],
[with_instant_messaging=yes])
2014-07-02 13:59:50 -04:00
AS_IF([test "x$with_instant_messaging" = "xyes"], [
PKG_CHECK_MODULES([EXPAT], expat >= 2.0.0, [with_instant_messaging=yes],
dnl Fallback to older version
[with_instant_messaging=no])
2012-08-29 13:49:14 -04:00
]);
2012-07-20 12:38:44 -04:00
AC_DEFINE_UNQUOTED([HAVE_INSTANT_MESSAGING], `if test "x$with_instant_messaging" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have instant messaging support])
AM_CONDITIONAL(BUILD_INSTANT_MESSAGING, test "x$with_instant_messaging" = "xyes" )
2010-06-30 12:54:49 -04:00
2012-07-26 17:07:39 -04:00
# PTHREAD
# required dependency(ies): libxpat
2012-03-20 14:30:18 -04:00
AX_PTHREAD
2010-06-30 12:54:49 -04:00
2012-07-26 13:55:49 -04:00
2012-07-26 17:07:39 -04:00
# SDES Key Exchange
# required dependency(ies): libpcre
2012-07-20 14:03:09 -04:00
AC_ARG_WITH([sdes],
2014-04-23 15:14:13 -04:00
[AS_HELP_STRING([--without-sdes], [disable support for sdes key exchange])],
2012-08-29 13:49:14 -04:00
[],
[with_sdes=yes])
2012-07-20 14:03:09 -04:00
AS_IF([test "x$with_sdes" = "xyes"], [
2014-08-27 14:12:18 -04:00
PKG_CHECK_MODULES(PCRE, [libpcre],,AC_MSG_ERROR([libpcre not found]))]);
2012-08-29 13:49:14 -04:00
2012-07-20 14:03:09 -04:00
AC_DEFINE_UNQUOTED([HAVE_SDES], `if test "x$with_sdes" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have sdes support])
AM_CONDITIONAL(BUILD_SDES, test "x$with_sdes" = "xyes" )
2010-01-12 10:29:08 -05:00
2012-08-29 13:49:14 -04:00
2011-06-09 11:48:17 -04:00
dnl Check for libcppunit-dev
CPPUNIT_MIN_VERSION=1.12
PKG_CHECK_MODULES(CPPUNIT, cppunit >= ${CPPUNIT_MIN_VERSION}, AM_CONDITIONAL(BUILD_TEST, test 1 = 1 ), AM_CONDITIONAL(BUILD_TEST, test 0 = 1 ))
2007-08-28 12:02:49 -04:00
2012-07-26 13:55:49 -04:00
2012-07-26 17:07:39 -04:00
# GSM CODEC
# required dependency(ies): libgsm
2012-03-20 14:30:18 -04:00
dnl check for libgsm1 (doesn't use pkg-config)
dnl Check for libgsm
2012-01-24 14:41:55 -05:00
AC_ARG_WITH([gsm], [AS_HELP_STRING([--without-gsm],
2012-03-20 14:30:18 -04:00
[disable support for gsm codec])], [], [with_gsm=yes])
2008-02-20 09:39:25 -05:00
LIBGSM=
AS_IF([test "x$with_gsm" != xno],
2012-03-20 14:30:18 -04:00
[AC_CHECK_HEADER([gsm/gsm.h], , AC_MSG_FAILURE([Unable to find the libgsm1 headers (you may need to install the dev package). You may use --without-gsm to compile without gsm codec support.]))]
[AC_CHECK_LIB([gsm], [gsm_decode], [], [
AC_MSG_FAILURE([libgsm link test failed. You may use --without-gsm to compile without gsm codec support.])
])
])
2009-07-03 16:40:46 -04:00
2011-08-05 18:47:29 -04:00
AC_DEFINE_UNQUOTED([HAVE_GSM], `if test "x$with_gsm" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have libgsm])
2008-02-20 09:39:25 -05:00
AM_CONDITIONAL(BUILD_GSM, test "x$with_gsm" = "xyes" )
2012-07-26 13:55:49 -04:00
2012-07-26 17:07:39 -04:00
# SPEEX CODEC
# required dependency(ies): libspeex
2010-11-04 15:44:21 -04:00
dnl Check for libspeex
2008-02-20 09:39:25 -05:00
AC_ARG_WITH([speex],
2012-07-27 10:50:12 -04:00
[AS_HELP_STRING([--without-speex], [disable support for speex codec])],
2012-03-20 14:30:18 -04:00
[],
[with_speex=yes])
2008-02-20 09:39:25 -05:00
2014-10-10 16:06:10 -04:00
AS_IF([test "x$with_speex" != xno], [PKG_CHECK_MODULES([SPEEX], [speex])])
2012-03-20 14:30:18 -04:00
2011-08-08 16:22:25 -04:00
AC_DEFINE_UNQUOTED([HAVE_SPEEX], `if test "x$with_speex" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have libspeex])
2010-11-04 15:44:21 -04:00
AM_CONDITIONAL(BUILD_SPEEX, test "x$with_speex" = "xyes" )
2009-02-17 16:23:05 -05:00
2012-07-26 13:55:49 -04:00
2012-07-26 17:07:39 -04:00
# SPEEX DSP
# required dependency(ies): libspeexdsp
2010-06-16 17:39:45 -04:00
dnl check in case the libspeexdsp is not installed
2012-07-26 13:55:49 -04:00
AC_ARG_WITH([speexdsp],
2012-08-29 13:49:14 -04:00
[AS_HELP_STRING([--without-speexdsp],
[disable support for speexdp Noise Suppression and Automatic Gain Control])],
[],
[with_speexdsp=yes])
2012-07-26 13:55:49 -04:00
2014-10-10 16:06:10 -04:00
AS_IF([test "x$with_speexdsp" != xno], [PKG_CHECK_MODULES([SPEEXDSP], [speexdsp])])
2012-07-26 13:55:49 -04:00
AC_DEFINE_UNQUOTED([HAVE_SPEEXDSP], `if test "x$with_speexdsp" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have libspeexdsp])
AM_CONDITIONAL(BUILD_SPEEXDSP, test "x$with_speexdsp" = "xyes" )
2013-01-14 14:46:58 -05:00
dnl iLBC is enabled if it's installed
2014-10-22 00:10:05 -04:00
AC_ARG_WITH([libilbc],
2013-01-14 14:46:58 -05:00
[AS_HELP_STRING([--with-libilbc],
[support ilbc audio @<:@default=check@:>@])],
[],
[with_libilbc=check])
AS_CASE(["$with_libilbc"],
[yes], [PKG_CHECK_MODULES([libilbc], [libilbc], [HAVE_LIBILBC=1])],
2014-10-22 00:10:05 -04:00
[no], [HAVE_LIBILBC=0],
2013-01-14 14:46:58 -05:00
[PKG_CHECK_MODULES([libilbc], [libilbc], [HAVE_LIBILBC=1], [HAVE_LIBILBC=0])])
2014-10-27 15:51:07 -04:00
AM_CONDITIONAL([BUILD_ILBC], [test "$HAVE_LIBILBC" -eq 1])
2005-12-19 00:11:35 +00:00
2013-02-20 17:33:02 -05:00
dnl opus is enabled if it's installed
2014-10-22 00:10:05 -04:00
AC_ARG_WITH([opus],
2013-02-20 17:33:02 -05:00
[AS_HELP_STRING([--with-opus], [support opus audio @<:@default=check@:>@])], [], [with_opus=check])
AS_CASE(["$with_opus"],
[yes], [PKG_CHECK_MODULES([opus], [opus], [HAVE_OPUS=1])],
2014-10-22 00:10:05 -04:00
[no], [HAVE_OPUS=0],
2013-02-20 17:33:02 -05:00
[PKG_CHECK_MODULES([opus], [opus], [HAVE_OPUS=1], [HAVE_OPUS=0])])
2014-10-27 15:51:07 -04:00
AM_CONDITIONAL([BUILD_OPUS], [test "$HAVE_OPUS" -eq 1])
2005-12-19 00:11:35 +00:00
2014-09-09 17:49:42 -04:00
AC_ARG_WITH([iax],
AS_HELP_STRING([--without-iax], [Ignore presence of iax and disable it]))
AS_IF([test "x$with_iax" != "xno"],
[AC_CHECK_HEADER("iax/iax-client.h", [have_iax=yes], [have_iax=no])],
[have_iax=no])
# only fail if IAX was explicitly requested but not found
AS_IF([test "x$have_iax" = "xyes"],
[AC_DEFINE([HAVE_IAX], 1, [Define if you have libiax])
AM_CONDITIONAL(USE_IAX, `true`)],
[AS_IF([test "x$with_iax" = "xyes"],
[AC_MSG_ERROR([iax requested but not found])])
AC_DEFINE([HAVE_IAX], 0, [Define if you have libiax])
AM_CONDITIONAL(USE_IAX, `false`)])
2012-07-26 13:55:49 -04:00
2014-10-29 17:56:23 -04:00
# dht is default-enabled, but requires gnutls
AC_ARG_ENABLE([dht],
AS_HELP_STRING([--disable-dht], [disable support for dht]))
AS_IF([test "x$enable_dht" != "xno" -a "$HAVE_GNUTLS" -eq 1],
[AC_DEFINE([HAVE_DHT], 1, [Define to enable dht])
AM_CONDITIONAL(USE_DHT, true)],
[AC_DEFINE([HAVE_DHT], 0, [Define to enable dht])
AM_CONDITIONAL(USE_DHT, false)])
2014-09-04 17:33:05 -04:00
2012-07-26 17:07:39 -04:00
# NETWORK MANAGER
# required dependency(ies): libiax2 (static)
2012-07-26 13:55:49 -04:00
dnl Check for network-manager
2012-01-24 14:41:55 -05:00
AC_ARG_WITH([networkmanager], [AS_HELP_STRING([--without-networkmanager],
2012-03-20 14:30:18 -04:00
[disable support for network-manager events])], [],
2012-01-24 14:41:55 -05:00
[with_networkmanager=yes])
2009-11-19 12:40:10 -05:00
AM_CONDITIONAL(USE_NETWORKMANAGER, test "x$with_networkmanager" = "xyes" )
2014-04-15 16:37:06 -04:00
dnl IPv6 mode is default-disabled
AC_ARG_ENABLE([ipv6], AS_HELP_STRING([--enable-ipv6], [Enable IPv6 support]))
2014-04-25 15:54:14 -04:00
AC_DEFINE_UNQUOTED([HAVE_IPV6], `if test "x$enable_ipv6" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have IPv6])
AM_CONDITIONAL(BUILD_IPV6, test "x$enable_ipv6" = "xyes" )
2014-04-15 16:37:06 -04:00
2012-07-26 13:55:49 -04:00
2012-07-26 17:07:39 -04:00
# DOXYGEN
# required dependency(ies): doxygen
2008-03-03 09:02:41 -05:00
# check for doxygen, mostly stolen from http://log4cpp.sourceforge.net/
# ----------------------------------------------------------------------------
AC_DEFUN([BB_ENABLE_DOXYGEN],
2011-08-08 16:22:25 -04:00
[
2011-08-08 16:40:53 -04:00
AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (disabled by default)])
2011-08-08 16:22:25 -04:00
AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)])
2011-08-08 16:40:53 -04:00
if test "x$enable_doxygen" = xyes; then
2011-08-08 16:22:25 -04:00
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
2011-08-08 16:40:53 -04:00
test x$DOXYGEN = x && AC_MSG_ERROR([could not find doxygen])
2011-08-08 16:22:25 -04:00
AC_PATH_PROG(DOT, dot, , $PATH)
2011-06-21 14:36:55 -04:00
test x$DOT = x -a "x$enable_dot" = xyes && AC_MSG_ERROR([could not find dot])
2011-08-08 16:22:25 -04:00
fi
2012-03-20 14:30:18 -04:00
AM_CONDITIONAL(ENABLE_DOXYGEN, test x$DOXYGEN = xyes)
2011-08-08 16:22:25 -04:00
])
2012-07-26 13:55:49 -04:00
2012-08-29 13:49:14 -04:00
# Actually perform the doxygen check
BB_ENABLE_DOXYGEN
2012-03-20 16:46:44 -04:00
2012-08-29 13:49:14 -04:00
dnl debug mode is default-disabled
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Build in debug mode, adds stricter warnings, disables optimization]))
AS_IF([test "x$enable_debug" = "xyes"],
2014-09-11 22:36:35 -04:00
[CXXFLAGS="${CXXFLAGS} -g -Wno-return-type -Wall -Wextra -Wnon-virtual-dtor -O0"])
2012-08-29 13:49:14 -04:00
dnl What Makefiles to generate
2014-06-18 17:32:45 -04:00
#TODO: split this list across where the relevant check is performed
2012-08-29 13:49:14 -04:00
AC_CONFIG_FILES([Makefile \
2014-11-13 16:09:50 -05:00
bin/Makefile \
2012-08-29 13:49:14 -04:00
src/Makefile \
src/sip/Makefile \
src/im/Makefile \
src/iax/Makefile \
2014-09-04 17:33:05 -04:00
src/dht/Makefile \
src/dht/dhtcpp/Makefile \
2012-08-29 13:49:14 -04:00
src/audio/Makefile \
src/audio/audiortp/Makefile \
src/audio/pulseaudio/Makefile \
src/audio/alsa/Makefile \
2014-06-17 18:28:24 -04:00
src/audio/opensl/Makefile \
2014-02-13 19:00:28 -05:00
src/audio/jack/Makefile \
2014-10-24 13:39:56 -04:00
src/audio/coreaudio/Makefile \
2012-08-29 13:49:14 -04:00
src/audio/sound/Makefile \
src/audio/codecs/Makefile \
src/config/Makefile \
2013-07-04 15:45:44 -04:00
src/client/Makefile \
2012-08-29 13:49:14 -04:00
src/hooks/Makefile \
src/history/Makefile \
src/video/Makefile \
2014-05-02 14:54:38 -04:00
src/video/v4l2/Makefile \
2012-08-29 13:49:14 -04:00
src/video/test/Makefile \
test/Makefile \
2014-09-30 18:23:53 -04:00
tools/Makefile \
2012-08-29 13:49:14 -04:00
ringtones/Makefile \
man/Makefile \
doc/Makefile \
doc/doxygen/Makefile])
2012-03-20 16:46:44 -04:00
2006-06-28 23:37:53 +00:00
# Go!
2011-08-08 16:22:25 -04:00
AC_OUTPUT