[Asterisk-code-review] codec opus: Check only for presence of libcurl (asterisk[master])

Sean Bright asteriskteam at digium.com
Sat Jan 6 17:54:41 CST 2018


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/7864


Change subject: codec_opus: Check only for presence of libcurl
......................................................................

codec_opus: Check only for presence of libcurl

We don't need the development headers of libcurl to be able to load the
library at runtime. Instead, add a simple library check for libcurl and
use that as codec_opus's dependency instead.

Change-Id: I34357d6fe58679bfdfe5b841391b6a12db770e18
---
M build_tools/menuselect-deps.in
M codecs/codecs.xml
M configure
M configure.ac
4 files changed, 72 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/64/7864/1

diff --git a/build_tools/menuselect-deps.in b/build_tools/menuselect-deps.in
index 259a835..c78990a 100644
--- a/build_tools/menuselect-deps.in
+++ b/build_tools/menuselect-deps.in
@@ -30,6 +30,7 @@
 URIPARSER=@PBX_URIPARSER@
 KQUEUE=@PBX_KQUEUE@
 LDAP=@PBX_LDAP@
+LIBCURL=@PBX_LIBCURL@
 LIBEDIT=@PBX_LIBEDIT@
 LIBXML2=@PBX_LIBXML2@
 XMLSTARLET=@PBX_XMLSTARLET@
diff --git a/codecs/codecs.xml b/codecs/codecs.xml
index c3ccf00..c1b434a 100644
--- a/codecs/codecs.xml
+++ b/codecs/codecs.xml
@@ -3,7 +3,7 @@
 	<depend>xmlstarlet</depend>
 	<depend>bash</depend>
 	<depend>res_format_attr_opus</depend>
-	<depend>curl</depend>
+	<depend>libcurl</depend>
 	<defaultenabled>no</defaultenabled>
 </member>
 <member name="codec_silk" displayname="Download the SILK codec from Digium.  See http://downloads.digium.com/pub/telephony/codec_silk/README.">
diff --git a/configure b/configure
index c672df9..3867227 100755
--- a/configure
+++ b/configure
@@ -653,6 +653,7 @@
 PBX_SO_NOSIGPIPE
 PBX_MSG_NOSIGNAL
 PBX_IXJUSER
+PBX_LIBCURL
 GMIME_LIBS
 GMIME_CFLAGS
 PBX_SSL_OP_NO_TLSV1_2
@@ -1363,6 +1364,7 @@
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -1550,6 +1552,7 @@
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1802,6 +1805,15 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1939,7 +1951,7 @@
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -2092,6 +2104,7 @@
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -14927,7 +14940,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -14973,7 +14986,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -14997,7 +15010,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -15042,7 +15055,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -15066,7 +15079,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -33575,6 +33588,52 @@
 	fi
 done
 
+# We are just looking for the curl library itself, we don't need development
+# headers. That check is done elsewhere.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_version in -lcurl" >&5
+$as_echo_n "checking for curl_version in -lcurl... " >&6; }
+if ${ac_cv_lib_curl_curl_version+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char curl_version ();
+int
+main ()
+{
+return curl_version ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_curl_curl_version=yes
+else
+  ac_cv_lib_curl_curl_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_version" >&5
+$as_echo "$ac_cv_lib_curl_curl_version" >&6; }
+if test "x$ac_cv_lib_curl_curl_version" = xyes; then :
+  PBX_LIBCURL=1
+else
+  PBX_LIBCURL=0
+fi
+
+
+
 
 if test "x${PBX_HOARD}" != "x1" -a "${USE_HOARD}" != "no"; then
    pbxlibdir=""
diff --git a/configure.ac b/configure.ac
index 0a4fb47..873f5c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2586,6 +2586,11 @@
 	fi
 done
 
+# We are just looking for the curl library itself, we don't need development
+# headers. That check is done elsewhere.
+AC_CHECK_LIB([curl], [curl_version], [PBX_LIBCURL=1], [PBX_LIBCURL=0])
+AC_SUBST([PBX_LIBCURL])
+
 AST_EXT_LIB_CHECK([HOARD], [hoard], [malloc], [])
 
 AST_EXT_LIB_CHECK([FREETDS], [sybdb], [dbinit], [sybdb.h])

-- 
To view, visit https://gerrit.asterisk.org/7864
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34357d6fe58679bfdfe5b841391b6a12db770e18
Gerrit-Change-Number: 7864
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180106/011ac824/attachment-0001.html>


More information about the asterisk-code-review mailing list