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

AM_CONFIG_HEADER(config.h)

dnl figure out the sflphone version
yanmorin's avatar
yanmorin committed
6
VERSION=`sed -ne 's/^#define SFLPHONED_VERSION "\(.*\)"/\1/p' ${srcdir}/src/global.h`
jpbl's avatar
jpbl committed
7 8 9 10 11 12 13 14 15 16
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
yanmorin's avatar
yanmorin committed
17
PKGADD_PKG="SFLPhoned"
yanmorin's avatar
yanmorin committed
18
PKGADD_NAME="SFLPhone - a SIP client and daemon"
19
PKGADD_VENDOR="http://www.sflphone.org/"
jpbl's avatar
jpbl committed
20 21 22 23 24 25 26 27 28
AC_SUBST(PKGADD_PKG)
AC_SUBST(PKGADD_NAME)
AC_SUBST(PKGADD_VENDOR)

AC_LANG_CPLUSPLUS

AC_PROG_CXX
AC_PROG_CC

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

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

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( \
jpbl's avatar
jpbl committed
55 56
ostream \
portaudio.h \
jpbl's avatar
jpbl committed
57 58
)

jpbl's avatar
jpbl committed
59
LIBCCGNU2_MIN_VERSION=1.3.1
jpbl's avatar
jpbl committed
60
PKG_CHECK_MODULES(libccgnu2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION})
jpbl's avatar
jpbl committed
61 62
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccgnu2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccgnu2_LIBS"
jpbl's avatar
jpbl committed
63 64

LIBCCEXT2_MIN_VERSION=1.3.1
jpbl's avatar
jpbl committed
65 66 67
PKG_CHECK_MODULES(libccext2, libccext2 >= ${LIBCCEXT2_MIN_VERSION})
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccext2_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccext2_LIBS"
jpbl's avatar
jpbl committed
68 69

LIBCCRT_MIN_VERSION=1.3.0
jpbl's avatar
jpbl committed
70
PKG_CHECK_MODULES(libccrtp1, libccrtp1 >= ${LIBCCRT_MIN_VERSION})
jpbl's avatar
jpbl committed
71 72 73
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $libccrtp1_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libccrtp1_LIBS"

jpbl's avatar
jpbl committed
74 75
dnl check for osip2
LP_CHECK_OSIP2
jpbl's avatar
jpbl committed
76

jpbl's avatar
jpbl committed
77 78
dnl setup flags for embedded exosip library
LP_SETUP_EXOSIP
jpbl's avatar
jpbl committed
79

jpbl's avatar
jpbl committed
80 81 82 83
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $OSIP_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $OSIP_LIBS"
SFLPHONE_CXXFLAGS="$SFLPHONE_CXXFLAGS $EXOSIP_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $EXOSIP_LIBS"
jpbl's avatar
jpbl committed
84

jpbl's avatar
jpbl committed
85

jpbl's avatar
jpbl committed
86 87 88
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])
else 
jpbl's avatar
jpbl committed
89
   portaudio_LIBS="-lportaudio -lasound "
jpbl's avatar
jpbl committed
90 91 92
   portaudio_CFLAGS="-DAUDIO_PORTAUDIO "
fi

jpbl's avatar
jpbl committed
93 94 95 96
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
97 98 99

AC_SUBST(SFLPHONE_CXXFLAGS)
AC_SUBST(SFLPHONE_LIBS)
yanmorin's avatar
yanmorin committed
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136

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
137 138 139

dnl AC_CONFIG_FILES(
AC_OUTPUT(
jpbl's avatar
jpbl committed
140
sflphone.spec \
yanmorin's avatar
yanmorin committed
141
sflphoned-fedora.spec \
jpbl's avatar
jpbl committed
142
Makefile \
jpbl's avatar
jpbl committed
143 144
m4/Makefile \
exosip2/Makefile \
jpbl's avatar
jpbl committed
145
src/Makefile \
yanmorin's avatar
yanmorin committed
146
src/sflphone \
jpbl's avatar
jpbl committed
147 148
src/audio/Makefile \
src/audio/gsm/Makefile \
jpbl's avatar
jpbl committed
149 150 151 152 153
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 \
154
src/config/Makefile \
jpbl's avatar
jpbl committed
155
src/gui/Makefile \
156 157
src/gui/server/Makefile \
src/zeroconf/Makefile \
jpbl's avatar
jpbl committed
158
utilspp/Makefile \
159
utilspp/functor/Makefile \
jpbl's avatar
jpbl committed
160
utilspp/singleton/Makefile \
jpbl's avatar
jpbl committed
161
stund/Makefile \
yanmorin's avatar
yanmorin committed
162
ringtones/Makefile \
jpbl's avatar
jpbl committed
163
)