Commit 20e2ac16 authored by jehan's avatar jehan

bctoolbox integration with autotools

parent c81f8c51
......@@ -22,9 +22,9 @@ Commercial licensing can be purchased for that purpose from [Belledonne Communic
* pkg-config
* libantlr3c-3.2 or 3.4
* antlr3-3.4
* bctoolbox (see below)
* C++ compiler (for instance g++ or clang++)
* (optional) CUnit
* (optional) polarssl >= 1.2 (see below)
#### Under Debian/Ubuntu
......@@ -48,12 +48,10 @@ Commercial licensing can be purchased for that purpose from [Belledonne Communic
* open belle-sip/build/windows/belle-sip-tester/belle-sip-tester.sln or belle-sip/build/windows/belle-sip/belle-sip.sln
* Build the solution (antlr3 and cunit are built automatically)
#### Building polarssl
#### Building bctoolbox
Polarssl build system is Make (or Cmake).
To build the shared library version, use `make SHARED=1 DEBUG=1`, followed by `make install`.
We maintain a branch of polarssl with automake/autoconf/libtool support at
git://git.linphone.org/polarssl.git -b linphone
bctoolbox build system is Cmake only, but provides pkg-config file for integration with autotools.
git://git.linphone.org/bctoolbox.git
#### Known issues
......
......@@ -234,53 +234,10 @@ AC_ARG_ENABLE( tls,
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tls) ;;
esac],[use_tls=true])
AC_ARG_WITH( polarssl,
[ --with-polarssl Set prefix where polarssl can be found (ex:/usr, /usr/local)[default=PREFIX] ],
[ polarssl_prefix=${withval}],[ polarssl_prefix=${prefix} ])
if test "$polarssl_prefix" != "NONE" && test "$polarssl_prefix" != "/usr"; then
POLARSSL_CFLAGS="-I${polarssl_prefix}/include"
POLARSSL_LIBS="-L${polarssl_prefix}/lib"
fi
found_polarssl=no
if test "$use_tls" = "true" ; then
CPPFLAGS_save=$CPPFLAGS
LIBS_save=$LIBS
CPPFLAGS="$CPPFLAGS $POLARSSL_CFLAGS"
LIBS="$LIBS $POLARSSL_LIBS"
AC_CHECK_LIB(mbedtls, ssl_init , [POLARSSL_LIBS="$POLARSSL_LIBS -lmbedtls"],
[AC_CHECK_LIB(polarssl, ssl_init, [POLARSSL_LIBS="$POLARSSL_LIBS -lpolarssl"])])
LIBS="$LIBS $POLARSSL_LIBS" #to add right -l
AC_CHECK_HEADERS(polarssl/ssl.h,
[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <polarssl/version.h>
#include <polarssl/x509.h>
#if POLARSSL_VERSION_NUMBER >= 0x01030000
#include <polarssl/compat-1.2.h>
#endif
]],
[[x509parse_crtpath(0,0)]])]
,[found_polarssl=yes
AC_MSG_NOTICE([polarssl usable])]
,[AC_MSG_ERROR([polarssl not found or usable but TLS support required.])])
])
CPPFLAGS=$CPPFLAGS_save
LIBS=$LIBS_save
fi
AM_CONDITIONAL([BUILD_TLS], [test "x$found_polarssl" = "xyes"])
TLS_CFLAGS=""
TLS_LIBS=""
TLS_PC=""
if test "x$found_polarssl" = "xyes" ; then
AC_DEFINE(HAVE_POLARSSL,1,[Defined when polarssl api is available])
TLS_CFLAGS=$POLARSSL_CFLAGS
TLS_LIBS=$POLARSSL_LIBS
PKG_CHECK_MODULES(BCTOOLBOX, bctoolbox, [found_bctoolbox=yes],[found_bctoolbox=no])
if test "x$found_bctoolbox" = "xyes" ; then
TLS_CFLAGS=$BCTOOLBOX_CFLAGS
TLS_LIBS=$BCTOOLBOX_LIBS
fi
AC_SUBST(TLS_CFLAGS)
AC_SUBST(TLS_LIBS)
......
......@@ -35,8 +35,8 @@ libbellesip_la_SOURCES= \
transports/stream_channel.c \
transports/stream_channel.h \
transports/stream_listeningpoint.c \
transports/tls_listeningpoint_polarssl.c \
transports/tls_channel_polarssl.c \
transports/tls_listeningpoint.c \
transports/tls_channel.c \
refresher.c \
dns.c dns.h \
belle_sip_dict.c \
......
......@@ -43,7 +43,10 @@ AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tester/c
LDADD=$(top_builddir)/src/libbellesip.la
AM_LDFLAGS=-no-undefined -export-dynamic
AM_LDFLAGS=-no-undefined -export-dynamic -rpath $(prefix)/lib
if BUILD_APPLE
AM_LDFLAGS+=-Wl,-rpath $(prefix)/lib
endif
AM_CFLAGS=$(STRICT_OPTIONS) $(STRICT_OPTIONS_CC)
......
#!/usr/bin/env python
############################################################################
# prepare.py
# digest-response.py
# Copyright (C) 2015 Belledonne Communications, Grenoble France
#
############################################################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment