exosip.m4 2.52 KB
Newer Older
aymeric's avatar
aymeric committed
1 2 3 4 5
dnl -*- autoconf -*-
AC_DEFUN([LP_SETUP_EXOSIP],[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([LP_CHECK_OSIP2])

jehan's avatar
jehan committed
6

jehan's avatar
jehan committed
7
case $host_alias in
jehan's avatar
jehan committed
8
	i386-apple*|armv6-apple*|armv7-apple*|armv7s-apple*)
9
		OSIP_LIBS="$OSIP_LIBS  -framework CoreFoundation -framework CFNetwork -lresolv"
jehan's avatar
jehan committed
10 11 12
	;;
	x86_64-apple*)
		OSIP_LIBS="$OSIP_LIBS  -framework CoreFoundation"
jehan's avatar
jehan committed
13 14 15
	;;
esac

aymeric's avatar
aymeric committed
16 17 18 19 20
dnl eXosip embeded stuff
EXOSIP_CFLAGS="$OSIP_CFLAGS -DOSIP_MT "
EXOSIP_LIBS="$OSIP_LIBS -leXosip2  "

CPPFLAGS_save=$CPPFLAGS
smorlat's avatar
smorlat committed
21
CPPFLAGS="$OSIP_CFLAGS $CPPFLAGS"
aymeric's avatar
aymeric committed
22
AC_CHECK_HEADER([eXosip2/eXosip.h], ,AC_MSG_ERROR([Could not find eXosip2 headers !]))
23 24 25 26 27 28 29 30 31 32 33 34 35

dnl check exosip support of DSCP in exosip
AC_MSG_CHECKING([for DSCP support in exosip])
AC_TRY_COMPILE([#include <eXosip2/eXosip.h>],
	[int dscp=0;eXosip_set_option(EXOSIP_OPT_SET_DSCP,&dscp);],
	has_exosip_dscp=yes,
	has_exosip_dscp=no
)
AC_MSG_RESULT($has_exosip_dscp)
if test "$has_exosip_dscp" = "yes" ; then
	AC_DEFINE( HAVE_EXOSIP_DSCP, 1, [Define if exosip dscp available] )
fi

aymeric's avatar
aymeric committed
36 37
CPPFLAGS=$CPPFLAGS_save

jehan's avatar
jehan committed
38 39


aymeric's avatar
aymeric committed
40 41
dnl check for eXosip2 libs
LDFLAGS_save=$LDFLAGS
jehan's avatar
jehan committed
42
LDFLAGS="$OSIP_LIBS $LDFLAGS $OPENSSL_LIBS"
aymeric's avatar
aymeric committed
43
LIBS_save=$LIBS
44
AC_CHECK_LIB([eXosip2],[eXosip_set_tls_ctx],
aymeric's avatar
aymeric committed
45
	[],
46
	[AC_MSG_ERROR([Could not find eXosip2 library with version >= 3.5.0 !])],
47
	[-losipparser2 -losip2 ])
aymeric's avatar
aymeric committed
48 49 50
AC_CHECK_LIB([eXosip2],[eXosip_get_version],
	[AC_DEFINE([HAVE_EXOSIP_GET_VERSION],[1],[Defined when eXosip_get_version is available])],
	[],
51
	[-losipparser2 -losip2 ])
52 53 54 55
AC_CHECK_LIB([eXosip2],[eXosip_tls_verify_certificate],
	[AC_DEFINE([HAVE_EXOSIP_TLS_VERIFY_CERTIFICATE],[1],[Defined when eXosip_tls_verify_certificate is available])],
	[AC_MSG_WARN([Could not find eXosip_tls_verify_certificate in eXosip2 !])],
	[-losipparser2 -losip2 ])
56 57 58 59
AC_CHECK_LIB([eXosip2],[eXosip_tls_verify_cn],
	[AC_DEFINE([HAVE_EXOSIP_TLS_VERIFY_CN],[1],[Defined when eXosip_tls_verify_certificate is available])],
	[AC_MSG_WARN([Could not find eXosip_tls_verify_cn in eXosip2 !])],
	[-losipparser2 -losip2 ])
60 61 62
AC_CHECK_LIB([eXosip2],[eXosip_trylock],
	[AC_DEFINE([HAVE_EXOSIP_TRYLOCK],[1],[Defined when eXosip_get_socket is available])],
	[],
63
	[-losipparser2 -losip2 ])
64 65 66 67
AC_CHECK_LIB([eXosip2],[eXosip_reset_transports],
	[AC_DEFINE([HAVE_EXOSIP_RESET_TRANSPORTS],[1],[Defined when eXosip_reset_transports is available])],
	[],
	[-losipparser2 -losip2 ])
smorlat's avatar
smorlat committed
68 69 70
dnl AC_CHECK_LIB([eXosip2],[eXosip_get_naptr],
dnl	[AC_DEFINE([HAVE_EXOSIP_NAPTR_SUPPORT],[1],[Defined when eXosip_get_naptr is available])],
dnl	[],
71
dnl	[-losipparser2 -losip2 ])
aymeric's avatar
aymeric committed
72 73 74 75 76 77
LIBS=$LIBS_save
LDFLAGS=$LDFLAGS_save

AC_SUBST(EXOSIP_CFLAGS)
AC_SUBST(EXOSIP_LIBS)
])