[asterisk-commits] twilson: branch 1.8 r282200 - in /branches/1.8: configure configure.ac

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 13 11:00:06 CDT 2010


Author: twilson
Date: Fri Aug 13 11:00:02 2010
New Revision: 282200

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=282200
Log:
Detect when libsrtp cannot be linked in a shared library

The libsrtp build system currently does not produce a shared library
or a static library compiled with -fPIC, so on 64-bit systems it is
possible that we will get a compile error if libsrtp is installed and
res_srtp is selected in menuselect.

This patch attempts to detect this situation and provide the user with
instructions to work around the problem.

Modified:
    branches/1.8/configure
    branches/1.8/configure.ac

Modified: branches/1.8/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/configure.ac?view=diff&rev=282200&r1=282199&r2=282200
==============================================================================
--- branches/1.8/configure.ac (original)
+++ branches/1.8/configure.ac Fri Aug 13 11:00:02 2010
@@ -1807,6 +1807,38 @@
 
 AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h])
 
+if test "$PBX_SRTP" = "1";
+then
+    saved_libs="${LIBS}"
+    saved_ldflags="${LDFLAGS}"
+    LIBS="${LIBS} -lsrtp"
+    LDFLAGS="${LDFLAGS} -shared -fPIC"
+    AC_MSG_CHECKING(for the ability of -lsrtp to be linked in a shared object)
+    AC_LINK_IFELSE(
+    [
+        AC_LANG_PROGRAM(
+            [#include <srtp/srtp.h>],
+            [srtp_init();]
+        )
+    ],
+    [ AC_MSG_RESULT(yes) ],
+    [
+        AC_MSG_RESULT(no)
+        AC_MSG_NOTICE(***)
+        AC_MSG_NOTICE(*** libsrtp could not be linked as a shared object)
+        AC_MSG_NOTICE(*** try compiling libsrtp manually and configuring with)
+        AC_MSG_NOTICE(*** ./configure CFLAGS=-fPIC --prefix=/usr)
+        AC_MSG_NOTICE(*** replacing /usr with the prefix of your choice)
+		AC_MSG_NOTICE(***)
+		AC_MSG_NOTICE(*** If you do not need SRTP support re-run configure)
+		AC_MSG_NOTICE(*** with the --without-srtp option.)
+        exit 1
+    ]
+    )
+    LIBS="${saved_libs}"
+    LDFLAGS="${saved_ldflags}"
+fi
+
 AST_EXT_TOOL_CHECK([GMIME], [gmime-config], [], [], [#include <gmime/gmime.h>], [gboolean q = g_mime_check_version(0,0,0);])
 
 AST_EXT_LIB_CHECK([HOARD], [hoard], [malloc], [])




More information about the asterisk-commits mailing list