configure.ac 6.97 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 54 55
AC_MSG_NOTICE([

********** Checking for portaudio **********])
56
PORTAUDIO_SETUP
jpbl's avatar
jpbl committed
57 58

dnl check for osip2
yanmorin's avatar
 
yanmorin committed
59 60 61
AC_MSG_NOTICE([

********** Checking for libosip2 **********])
jpbl's avatar
jpbl committed
62 63
LP_CHECK_OSIP2

yanmorin's avatar
 
yanmorin committed
64
dnl check for exosip2
yanmorin's avatar
 
yanmorin committed
65 66 67
AC_MSG_NOTICE([

********** Checking for libeXosip2 **********])
yanmorin's avatar
 
yanmorin committed
68 69
LP_CHECK_EXOSIP2

jpbl's avatar
jpbl committed
70
dnl setup flags for embedded exosip library
yanmorin's avatar
 
yanmorin committed
71
dnl LP_SETUP_EXOSIP
jpbl's avatar
jpbl committed
72

yanmorin's avatar
 
yanmorin committed
73 74
dnl check for if no is undefined
dnl check also for samplerate for $host ~= *darwin* (mac) only
jpbl's avatar
jpbl committed
75 76 77 78 79
with_samplerate=no
case $host in
  *darwin*)
    need_no_undefined=no
    AC_CHECK_HEADER([libsamplerate.h], [
yanmorin's avatar
 
yanmorin committed
80
      AC_CHECK_LIB(samplerate, src_simple, [with_samplerate=yes], [with_samplerate=no]) 
jpbl's avatar
jpbl committed
81 82 83 84 85 86 87 88 89 90 91 92 93
     ], [ 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
94
AM_CONDITIONAL(USE_SAMPLERATE, test x$with_samplerate = xyes)
jpbl's avatar
jpbl committed
95

yanmorin's avatar
 
yanmorin committed
96 97 98
AC_MSG_NOTICE([

********** Checking for STD C AND ostream **********])
jpbl's avatar
jpbl committed
99 100 101 102 103 104
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS( \
ostream \
)

yanmorin's avatar
 
yanmorin committed
105 106
CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS"
SFLPHONE_LIBS=""
jpbl's avatar
jpbl committed
107

yanmorin's avatar
 
yanmorin committed
108 109 110
AC_MSG_NOTICE([

********** Checking for commoncpp2 **********])
jpbl's avatar
jpbl committed
111 112 113 114 115 116 117 118
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
119 120 121
AC_MSG_NOTICE([

********** Checking for ccrtp **********])
jpbl's avatar
jpbl committed
122 123 124 125 126 127 128
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
129 130 131
AC_MSG_NOTICE([

********** Checking for speex **********])
yanmorin's avatar
 
yanmorin committed
132 133 134 135 136 137 138 139 140
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
141 142 143 144 145 146 147 148 149 150 151 152

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
153

yanmorin's avatar
 
yanmorin committed
154 155 156
AC_MSG_NOTICE([

********** Checking for iax2 **********])
yanmorin's avatar
 
yanmorin committed
157 158 159 160 161 162 163 164 165
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
166

yanmorin's avatar
 
yanmorin committed
167 168 169
AC_MSG_NOTICE([

********** Checking for readline (sflphone-cli) **********])
jpbl's avatar
jpbl committed
170
GNUPG_CHECK_READLINE
yanmorin's avatar
 
yanmorin committed
171

yanmorin's avatar
 
yanmorin committed
172 173 174
AC_MSG_NOTICE([

********** Checking for zeroconf **********])
yanmorin's avatar
 
yanmorin committed
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
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
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
			#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
212 213 214 215
  ])
  CPPFLAGS=$save_dnssdtest_CPPFLAGS
  LDFLAGS=$save_dnssdtest_LDFLAGS
  LIBS=$save_dnssdtest_LIBS
jpbl's avatar
jpbl committed
216
fi
yanmorin's avatar
 
yanmorin committed
217 218
AC_SUBST(LIB_DNSSD)
AM_CONDITIONAL(USE_ZEROCONF, test "$have_libdns_sd" = "yes")	
jpbl's avatar
jpbl committed
219

yanmorin's avatar
 
yanmorin committed
220
dnl datadir directory
jpbl's avatar
jpbl committed
221 222 223
sflphone_datadir=$datadir/sflphone
AC_SUBST(sflphone_datadir)

yanmorin's avatar
 
yanmorin committed
224
dnl maintener code
225
AC_MSG_CHECKING([whether to enable the maintener code])
yanmorin's avatar
 
yanmorin committed
226 227 228 229 230 231 232
AC_ARG_ENABLE(maintener, 
  AC_HELP_STRING(
    [--enable-maintener],
    [enables maintener code @<:@default=no@:>@]
  ),  
  [with_maintener=$enableval], 
  [with_maintener=no]
233
)
yanmorin's avatar
 
yanmorin committed
234
AM_CONDITIONAL(MAINTENER_CODE, test "x$with_maintener" = "xyes")
yanmorin's avatar
 
yanmorin committed
235 236 237 238 239 240
if test "x$maintener" = "xyes"; then
  AC_MSG_RESULT(yes)
  CXXFLAGS="$CXXFLAGS -DENABLE_MAINTENER"
else
  AC_MSG_RESULT(no)
fi
241

yanmorin's avatar
 
yanmorin committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
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)
yanmorin's avatar
 
yanmorin committed
258 259 260
  AC_MSG_NOTICE([

********** Checking for QT **********])
yanmorin's avatar
 
yanmorin committed
261 262
dnl Setting QT Path
  AC_PATH_QT
yanmorin's avatar
 
yanmorin committed
263
dnl QT substitution?
yanmorin's avatar
 
yanmorin committed
264 265
  AC_SUBST(LIB_QT)
fi
jpbl's avatar
jpbl committed
266 267 268

dnl AC_CONFIG_FILES(
AC_OUTPUT(
yanmorin's avatar
yanmorin committed
269
Makefile
jpbl's avatar
jpbl committed
270
m4/Makefile \
jpbl's avatar
jpbl committed
271
libs/taxidermy/Makefile \
jpbl's avatar
jpbl committed
272 273 274 275 276 277 278 279
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
280 281 282
skins/Makefile \
skins/metal/Makefile \
skins/gmetal/Makefile \
jpbl's avatar
jpbl committed
283 284 285 286 287 288 289 290 291 292 293
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
294
src/gui/qt/Makefile \
jpbl's avatar
jpbl committed
295
src/gui/cli/Makefile \
jpbl's avatar
jpbl committed
296 297 298 299
src/gui/server/Makefile \
src/zeroconf/Makefile \
ringtones/Makefile \
platform/fedora/sflphoned.spec \
yanmorin's avatar
yanmorin committed
300 301
platform/debian/changelog \
platform/rpm/sflphone.spec \
jpbl's avatar
jpbl committed
302
)