[Asterisk-code-review] codec opus: Check only for presence of libcurl (asterisk[13])
Sean Bright
asteriskteam at digium.com
Sat Jan 6 17:53:48 CST 2018
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/7862
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/62/7862/1
diff --git a/build_tools/menuselect-deps.in b/build_tools/menuselect-deps.in
index 1d25145..e00b4f9 100644
--- a/build_tools/menuselect-deps.in
+++ b/build_tools/menuselect-deps.in
@@ -28,6 +28,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 2dd0277..3209384 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
@@ -1331,6 +1332,7 @@
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -1513,6 +1515,7 @@
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1765,6 +1768,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=* \
@@ -1902,7 +1914,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.
@@ -2055,6 +2067,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]
@@ -14647,7 +14660,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];
@@ -14693,7 +14706,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];
@@ -14717,7 +14730,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];
@@ -14762,7 +14775,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];
@@ -14786,7 +14799,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];
@@ -32152,6 +32165,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 c617cf0..37b9a12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2526,6 +2526,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/7862
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34357d6fe58679bfdfe5b841391b6a12db770e18
Gerrit-Change-Number: 7862
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/6d1cb303/attachment-0001.html>
More information about the asterisk-code-review
mailing list