configure.ac 6.73 KB
Newer Older
yanmorin's avatar
 
yanmorin committed
1 2
dnl AC_INIT(aclocal.m4)
AC_INIT(sflphone,0.7,sflphoneteam@savoirfairelinux.com,SFLphone)
yanmorin's avatar
 
yanmorin committed
3 4

# Initializing config.h header...
jpbl's avatar
jpbl committed
5 6
AM_CONFIG_HEADER(config.h)

yanmorin's avatar
 
yanmorin committed
7
# Getting project version
jpbl's avatar
jpbl committed
8 9 10 11
VERSION=`sed -ne 's/^#define SFLPHONED_VERSION "\(.*\)"/\1/p' ${srcdir}/src/global.h`

dnl get rid of release number
RPM_VERSION=`echo $VERSION | cut -d- -f1`
yanmorin's avatar
 
yanmorin committed
12
 AC_SUBST(RPM_VERSION)
jpbl's avatar
jpbl committed
13
RPM_RELEASE=`echo $VERSION | sed -ne 's/.*-\(.*\)/\1/p' `
yanmorin's avatar
 
yanmorin committed
14
 AC_SUBST(RPM_RELEASE)
jpbl's avatar
jpbl committed
15
VERSION=`echo $VERSION | cut -d- -f1`
yanmorin's avatar
 
yanmorin committed
16
 AC_SUBST(VERSION)
jpbl's avatar
jpbl committed
17

yanmorin's avatar
 
yanmorin committed
18
# Setting needs Standard C++ Library
jpbl's avatar
jpbl committed
19 20 21 22 23 24 25 26 27 28 29
LIBS="$LIBS -lstdc++"

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

yanmorin's avatar
 
yanmorin committed
30
# Defining C++ as default language
jpbl's avatar
jpbl committed
31 32
AC_LANG_CPLUSPLUS

yanmorin's avatar
 
yanmorin committed
33 34 35
dnl These functions are call inside AC_CHECK_COMPILERS
dnl AC_PROG_CXX
dnl AC_PROG_CC
jpbl's avatar
jpbl committed
36

yanmorin's avatar
 
yanmorin committed
37
# Checking compilers capacities
jpbl's avatar
jpbl committed
38
AC_CHECK_COMPILERS
yanmorin's avatar
 
yanmorin committed
39 40 41 42 43 44

# Declaring a debug constant
if test "x$kde_use_debug_code" != "xno"; then
 CXXFLAGS="$CXXFLAGS -DDEBUG"
fi

jpbl's avatar
jpbl committed
45

jpbl's avatar
jpbl committed
46 47 48

AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
jpbl's avatar
jpbl committed
49
AM_INIT_AUTOMAKE(sflphone, $VERSION)
jpbl's avatar
jpbl committed
50 51 52
AC_PROG_LIBTOOL

dnl check for portaudio
yanmorin's avatar
 
yanmorin committed
53
AC_MSG_NOTICE([********** Checking for portaudio **********])
54
PORTAUDIO_SETUP
jpbl's avatar
jpbl committed
55 56

dnl check for osip2
yanmorin's avatar
 
yanmorin committed
57
AC_MSG_NOTICE([********** Checking for libosip2 **********])
jpbl's avatar
jpbl committed
58 59
LP_CHECK_OSIP2

yanmorin's avatar
 
yanmorin committed
60
dnl check for exosip2
yanmorin's avatar
 
yanmorin committed
61
AC_MSG_NOTICE([********** Checking for libeXosip2 **********])
yanmorin's avatar
 
yanmorin committed
62 63
LP_CHECK_EXOSIP2

jpbl's avatar
jpbl committed
64
dnl setup flags for embedded exosip library
yanmorin's avatar
 
yanmorin committed
65
dnl LP_SETUP_EXOSIP
jpbl's avatar
jpbl committed
66

yanmorin's avatar
 
yanmorin committed
67 68
dnl check for if no is undefined
dnl check also for samplerate for $host ~= *darwin* (mac) only
jpbl's avatar
jpbl committed
69 70 71 72 73
with_samplerate=no
case $host in
  *darwin*)
    need_no_undefined=no
    AC_CHECK_HEADER([libsamplerate.h], [
yanmorin's avatar
 
yanmorin committed
74
      AC_CHECK_LIB(samplerate, src_simple, [with_samplerate=yes], [with_samplerate=no]) 
jpbl's avatar
jpbl committed
75 76 77 78 79 80 81 82 83 84 85 86 87
     ], [ with_samplerate=no ]
    )
    ;;

  *-*-cygwin | *-*-mingw* | *-*-pw32*)
    need_no_undefined=yes
    ;;
  *)
    need_no_undefined=no
    ;;
esac

AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
yanmorin's avatar
 
yanmorin committed
88
AM_CONDITIONAL(USE_SAMPLERATE, test x$with_samplerate = xyes)
jpbl's avatar
jpbl committed
89 90 91 92 93 94 95

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS( \
ostream \
)

yanmorin's avatar
 
yanmorin committed
96 97
CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS"
SFLPHONE_LIBS=""
jpbl's avatar
jpbl committed
98

yanmorin's avatar
 
yanmorin committed
99
AC_MSG_NOTICE([********** Checking for commoncpp2 **********])
jpbl's avatar
jpbl committed
100 101 102 103 104 105 106 107
LIBCCGNU2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES(libccgnu2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION})
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccgnu2_LIBS"

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

yanmorin's avatar
 
yanmorin committed
108
AC_MSG_NOTICE([********** Checking for ccrtp **********])
jpbl's avatar
jpbl committed
109 110 111 112 113 114 115
LIBCCRT_MIN_VERSION=1.3.0
PKG_CHECK_MODULES(libccrtp1, libccrtp1 >= ${LIBCCRT_MIN_VERSION})
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccrtp1_LIBS"

SFLPHONE_LIBS="$SFLPHONE_LIBS $OSIP_LIBS $EXOSIP_LIBS "
AC_SUBST(SFLPHONE_LIBS)

yanmorin's avatar
 
yanmorin committed
116
AC_MSG_NOTICE([********** Checking for speex **********])
yanmorin's avatar
 
yanmorin committed
117 118 119 120 121 122 123 124 125
dnl check for speex...
AC_ARG_ENABLE(speex, 
  AC_HELP_STRING(
    [--enable-speex],
    [compile with speex codec @<:@default=no@:>@]
  ), 
  [with_speex=$enableval], 
  [with_speex=no]
)
jpbl's avatar
jpbl committed
126 127 128 129 130 131 132 133 134 135 136 137

if test "x$with_speex" = "xyes" ; then
  AC_CHECK_HEADER([speex/speex.h], [
    AC_CHECK_LIB(speex, speex_decode_int, 
     [
      with_speex=yes
     ], [ with_speex=no ]
    ) 
   ], [ with_speex=no ]
  )
fi
AM_CONDITIONAL(USE_SPEEX, test "x$with_speex" = "xyes" )
yanmorin's avatar
 
yanmorin committed
138

yanmorin's avatar
 
yanmorin committed
139
AC_MSG_NOTICE([********** Checking for iax2 **********])
yanmorin's avatar
 
yanmorin committed
140 141 142 143 144 145 146 147 148
AC_ARG_ENABLE(iax2,
 AC_HELP_STRING(
   [--enable-iax2],
   [compile with iax2 library support @<:@default=no@:>@]
 ),
 [with_iax2=$enableval],
 [with_iax2=no]
)
AM_CONDITIONAL(USE_IAX, test x$with_iax2 = xyes)
jpbl's avatar
jpbl committed
149

jpbl's avatar
jpbl committed
150
GNUPG_CHECK_READLINE
yanmorin's avatar
 
yanmorin committed
151

yanmorin's avatar
 
yanmorin committed
152
AC_MSG_NOTICE([********** Checking for zeroconf **********])
yanmorin's avatar
 
yanmorin committed
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
dnl check for zeroconf (from apple)
AC_ARG_ENABLE(zeroconf, 
  AC_HELP_STRING(
    [--disable-zeroconf],
    [disables libdns_sd (browsing and publishing DNS-SD services will not be possible) @<:@default=no@:>@]
  ),  
  [without_zeroconf=$enableval], 
  [without_zeroconf="no"]
)
if test "x$without_zeroconf" = "xno"; 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(	[
jpbl's avatar
jpbl committed
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
			#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=""
yanmorin's avatar
 
yanmorin committed
190 191 192 193
  ])
  CPPFLAGS=$save_dnssdtest_CPPFLAGS
  LDFLAGS=$save_dnssdtest_LDFLAGS
  LIBS=$save_dnssdtest_LIBS
jpbl's avatar
jpbl committed
194
fi
yanmorin's avatar
 
yanmorin committed
195 196
AC_SUBST(LIB_DNSSD)
AM_CONDITIONAL(USE_ZEROCONF, test "$have_libdns_sd" = "yes")	
jpbl's avatar
jpbl committed
197

yanmorin's avatar
 
yanmorin committed
198
dnl datadir directory
jpbl's avatar
jpbl committed
199 200 201
sflphone_datadir=$datadir/sflphone
AC_SUBST(sflphone_datadir)

yanmorin's avatar
 
yanmorin committed
202
dnl maintener code
203
AC_MSG_CHECKING([whether to enable the maintener code])
yanmorin's avatar
 
yanmorin committed
204 205 206 207 208 209 210
AC_ARG_ENABLE(maintener, 
  AC_HELP_STRING(
    [--enable-maintener],
    [enables maintener code @<:@default=no@:>@]
  ),  
  [with_maintener=$enableval], 
  [with_maintener=no]
211
)
yanmorin's avatar
 
yanmorin committed
212
AM_CONDITIONAL(MAINTENER_CODE, test "x$with_maintener" = "xyes")
yanmorin's avatar
 
yanmorin committed
213 214 215 216 217 218
if test "x$maintener" = "xyes"; then
  AC_MSG_RESULT(yes)
  CXXFLAGS="$CXXFLAGS -DENABLE_MAINTENER"
else
  AC_MSG_RESULT(no)
fi
219

yanmorin's avatar
 
yanmorin committed
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
AC_MSG_CHECKING([whether to enable sflphoneqt])
AC_ARG_ENABLE(sflphoneqt,
   AC_HELP_STRING(
     [--disable-sflphoneqt],
     [disable sflphone-qt compilation @<:@default=no@:>@]
   ),
   [with_sflphoneqt=$enableval],
   [with_sflphoneqt=yes]
)

AM_CONDITIONAL(WITH_QT, test "x$with_sflphoneqt" = "xyes")
AM_CONDITIONAL(include_x11, test x$with_sflphoneqt = "xyes")
if test "x$with_sflphoneqt" = "xno"; then
  AC_MSG_RESULT(no)
else
  AC_MSG_RESULT(yes)
dnl Setting QT Path
  AC_PATH_QT
yanmorin's avatar
 
yanmorin committed
238
dnl QT substitution?
yanmorin's avatar
 
yanmorin committed
239 240
  AC_SUBST(LIB_QT)
fi
jpbl's avatar
jpbl committed
241 242 243 244 245 246 247

dnl AC_CONFIG_FILES(
AC_OUTPUT(
debian/changelog \
sflphone.spec \
Makefile \
m4/Makefile \
jpbl's avatar
jpbl committed
248
libs/taxidermy/Makefile \
jpbl's avatar
jpbl committed
249 250 251 252 253 254 255 256
libs/Makefile \
libs/portaudio/Makefile \
libs/stund/Makefile \
libs/utilspp/Makefile \
libs/utilspp/functor/Makefile \
libs/utilspp/singleton/Makefile \
include/Makefile \
include/eXosip2/Makefile \
jpbl's avatar
jpbl committed
257 258 259
skins/Makefile \
skins/metal/Makefile \
skins/gmetal/Makefile \
jpbl's avatar
jpbl committed
260 261 262 263 264 265 266 267 268 269 270
src/Makefile \
src/sflphone \
src/audio/Makefile \
src/audio/gsm/Makefile \
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 \
src/config/Makefile \
src/gui/Makefile \
jpbl's avatar
jpbl committed
271
src/gui/qt/Makefile \
jpbl's avatar
jpbl committed
272
src/gui/cli/Makefile \
jpbl's avatar
jpbl committed
273 274 275 276 277
src/gui/server/Makefile \
src/zeroconf/Makefile \
ringtones/Makefile \
platform/fedora/sflphoned.spec \
)