configure.ac 4.75 KB
Newer Older
jpbl's avatar
jpbl committed
1 2 3 4 5
AC_INIT(acinclude.m4)

AM_CONFIG_HEADER(config.h)

dnl figure out the sflphone version
jpbl's avatar
jpbl committed
6
VERSION=`sed -ne 's/^#define VERSION "\(.*\)"/\1/p' ${srcdir}/src/global.h`
jpbl's avatar
jpbl committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
AC_SUBST(VERSION)

dnl get rid of release number
RPM_VERSION=`echo $VERSION | sed -ne 's/-//p' `
AC_SUBST(RPM_VERSION)

LIBS="$LIBS -lstdc++"

dnl
dnl Solaris pkgadd support definitions
PKGADD_PKG="SFLPhone"
PKGADD_NAME="SFLPhone - a SIP client"
PKGADD_VENDOR="http://www.sflphone.org"
AC_SUBST(PKGADD_PKG)
AC_SUBST(PKGADD_NAME)
AC_SUBST(PKGADD_VENDOR)

AC_LANG_CPLUSPLUS

AC_PROG_CXX
AC_PROG_CC

yanmorin's avatar
 
yanmorin committed
29
dnl AC_PATH_QT
jpbl's avatar
jpbl committed
30 31 32 33 34 35
dnl KDE_USE_QT(3.3)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AM_INIT_AUTOMAKE(sflphone, $VERSION)
AM_DISABLE_LIBRARIES
AC_PROG_LIBTOOL
llea's avatar
llea committed
36
AC_CHECK_COMPILERS
jpbl's avatar
jpbl committed
37

jpbl's avatar
jpbl committed
38
CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS"
jpbl's avatar
jpbl committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

SFLPHONE_CXXFLAGS=""

case $host in
  *-*-cygwin | *-*-mingw* | *-*-pw32*)
    need_no_undefined=yes
    ;;
  *)
    need_no_undefined=no
    ;;
esac

AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS( \
ostream \
llea's avatar
llea committed
57
eXosip2/eXosip.h \
jpbl's avatar
jpbl committed
58 59 60
portaudio.h \
)

jpbl's avatar
jpbl committed
61 62 63 64
LIBCCGNU2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(libccgnu2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION})
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccgnu2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccgnu2_LIBS"
jpbl's avatar
jpbl committed
65 66 67 68 69 70 71 72 73 74 75

LIBCCEXT2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(libccext2, libccext2 >= ${LIBCCEXT2_MIN_VERSION})
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccext2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccext2_LIBS"

LIBCCRT_MIN_VERSION=1.3.0
PKG_CHECK_MODULES(libccrtp1, libccrtp1 >= ${LIBCCRT_MIN_VERSION})
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccrtp1_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccrtp1_LIBS"

yanmorin's avatar
 
yanmorin committed
76 77
dnl 2.2.0 is buggy, header corruption
LIBOSIP2_MIN_VERSION=2.2.1
jpbl's avatar
jpbl committed
78 79 80 81
PKG_CHECK_MODULES(libosip2, libosip2 >= ${LIBOSIP2_MIN_VERSION})
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libosip2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libosip2_LIBS"

llea's avatar
llea committed
82 83
if test $ac_cv_header_eXosip2_eXosip_h = no; then
   AC_MSG_ERROR([*** missing eXosip2/eXosip.h. You need a working eXosip2 installation. See http://www.antisip.com/download/])
jpbl's avatar
jpbl committed
84
fi
jpbl's avatar
jpbl committed
85 86 87 88

AC_CHECK_LIB([eXosip2], [eXosip_init],[libexosip2_LIBS="-leXosip2 "],[
   AC_MSG_ERROR([*** missing eXosip2 library. You need a working eXosip2 installation. See http://www.antisip.com/download/])])

llea's avatar
llea committed
89
SFLPHONE_LIBS="$SFLPHONE_LIBS $libexosip2_LIBS"
jpbl's avatar
jpbl committed
90

yanmorin's avatar
 
yanmorin committed
91
dnl AC_SUBST(LIBQT)
jpbl's avatar
jpbl committed
92

jpbl's avatar
jpbl committed
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
AC_MSG_CHECKING([whether to enable the new gui])
AC_ARG_ENABLE(newgui,
[  --enable-newgui      Enable new gui code [default=no]],
[
AC_MSG_RESULT(yes)
newgui="yes"
],
[
AC_MSG_RESULT(no)
newgui="no"
]
)

AM_CONDITIONAL(NEWGUI_CODE, test x$newgui = xyes)


jpbl's avatar
jpbl committed
109 110 111 112

if test $ac_cv_header_portaudio_h = no; then
   AC_MSG_ERROR([*** missing portaudio.h. You need a working PortAudio installation. See http://www.portaudio.com])
fi
jpbl's avatar
jpbl committed
113 114 115 116 117
AC_CHECK_LIB([portaudio], [Pa_GetDeviceCount], [
   portaudio_LIBS="-lportaudio "
   portaudio_CFLAGS="-DAUDIO_PORTAUDIO "],
   [AC_MSG_ERROR([*** missing portaudio V19 library. You need a working PortAudio installation. See http://www.portaudio.com])])

jpbl's avatar
jpbl committed
118 119 120 121
SFLPHONE_LIBS="$SFLPHONE_LIBS $portaudio_LIBS"
SFLPHONE_CXXFLAGS=="$SFLPHONE_CXXFLAGS $portaudio_CFLAGS"
AC_SUBST(portaudio_CFLAGS)
AC_SUBST(portaudio_LIB)
jpbl's avatar
jpbl committed
122 123 124

AC_SUBST(SFLPHONE_CXXFLAGS)
AC_SUBST(SFLPHONE_LIBS)
yanmorin's avatar
 
yanmorin committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161

AC_ARG_ENABLE(zeroconf, [  --disable-zeroconf	don't require libdns_sd (browsing and publishing DNS-SD services will not be possible) ],  with_zeroconf=$enableval, with_zeroconf=yes)
if test "$with_zeroconf" = "yes"; then
AC_MSG_CHECKING(for DNS-SD support)
save_dnssdtest_LIBS="$LIBS"
save_dnssdtest_LDFLAGS="$LDFLAGS"
save_dnssdtest_CPPFLAGS="$CPPFLAGS"
LDFLAGS="$all_libraries $LDFLAGS"
CPPFLAGS="$CPPFLAGS $all_includes"
case $host_os in
  darwin*) LIBS="" ;;
  *) LIBS="-ldns_sd" ;;
esac
have_libdns_sd="no"
AC_TRY_LINK(	[
			#include <dns_sd.h>
		],[
			DNSServiceRefDeallocate( (DNSServiceRef) 0);
			TXTRecordDeallocate( (TXTRecordRef*) 0);
		],[
			AC_DEFINE(HAVE_DNSSD,1,[Define if dns-sd is available])
			case $host_os in
				darwin*) LIB_DNSSD="" ;;
				*) LIB_DNSSD="-ldns_sd" ;;
			esac
			have_libdns_sd="yes"
			AC_MSG_RESULT(yes)
		],[
			AC_MSG_RESULT(no)
                        LIB_DNSSD=""
])
CPPFLAGS=$save_dnssdtest_CPPFLAGS
LDFLAGS=$save_dnssdtest_LDFLAGS
LIBS=$save_dnssdtest_LIBS
fi
AC_SUBST(LIB_DNSSD)
AM_CONDITIONAL(USE_ZEROCONF, test "$have_libdns_sd" = "yes")	
jpbl's avatar
jpbl committed
162 163 164

dnl AC_CONFIG_FILES(
AC_OUTPUT(
jpbl's avatar
jpbl committed
165
sflphone.spec \
jpbl's avatar
jpbl committed
166 167 168 169
Makefile \
src/Makefile \
src/audio/Makefile \
src/audio/gsm/Makefile \
jpbl's avatar
jpbl committed
170 171 172 173 174
src/audio/pacpp/Makefile \
src/audio/pacpp/include/Makefile \
src/audio/pacpp/include/portaudiocpp/Makefile \
src/audio/pacpp/source/Makefile \
src/audio/pacpp/source/portaudiocpp/Makefile \
yanmorin's avatar
 
yanmorin committed
175
src/config/Makefile \
jpbl's avatar
jpbl committed
176
src/gui/Makefile \
yanmorin's avatar
 
yanmorin committed
177 178
src/gui/server/Makefile \
src/zeroconf/Makefile \
jpbl's avatar
jpbl committed
179
utilspp/Makefile \
180
utilspp/functor/Makefile \
jpbl's avatar
jpbl committed
181
utilspp/singleton/Makefile \
jpbl's avatar
jpbl committed
182
stund/Makefile \
yanmorin's avatar
 
yanmorin committed
183
ringtones/Makefile \
jpbl's avatar
jpbl committed
184
)