package/libsrtp: fix static build with openssl
PATCH 1/1 package/libsrtp: fix static build with openssl
libsrp forget to link with zlib for static build when openssl support is requested.
The issue was reported upstream by Vicente Olivert Riera:
https://github.com/cisco/libsrtp/issues/97
Backport upstream patch for the upcoming libsrtp 1.5.2.
Fixes:
http://autobuild.buildroot.net/results/a71/a71d85a5bb9af2ee82a8e61054025bceb03dbdeb/
--- ...checks-for-libz-and-libdl-when-OpenSSL-is.patch | 140 +++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch new file +140 -0
@@ -0,0 +1,140 @@ +From cfbf3609d62201c6de9b1a075a2ce6f1edd580b6 Mon Sep 17 00:00:00 2001 +From: jfigus <[email protected]> +Date: Thu, 26 Feb 2015 12:25:08 -0500 +Subject: [PATCH] A autoconf checks for libz and libdl when OpenSSL is enabled + to allow for static linking of OpenSSL (via CFLAGS=-static). + +--- + configure | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + configure.in | 4 +++ + 2 files changed, 104 insertions(+) + +diff --git a/configure b/configure +index fdef142..0870dff 100755 +--- a/configure ++++ b/configure +@@ -4843,6 +4843,106 @@ if test "$enable_openssl" = "yes"; then + LDFLAGS="$LDFLAGS $(pkg-config --libs openssl)"; + CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"; + ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 ++$as_echo_n "checking for dlopen in -ldl... " >&6; } ++if ${ac_cv_lib_dl_dlopen+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-ldl $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 dlopen (); ++int ++main () ++{ ++return dlopen (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_dl_dlopen=yes ++else ++ ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 ++$as_echo "$ac_cv_lib_dl_dlopen" >&6; } ++if test "x$ac_cv_lib_dl_dlopen" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBDL 1 ++_ACEOF ++ ++ LIBS="-ldl $LIBS" ++ ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "can't find libdl ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 ++$as_echo_n "checking for inflate in -lz... " >&6; } ++if ${ac_cv_lib_z_inflate+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lz $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 inflate (); ++int ++main () ++{ ++return inflate (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_z_inflate=yes ++else ++ ac_cv_lib_z_inflate=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_z_inflate" >&5 ++$as_echo "$ac_cv_lib_z_inflate" >&6; } ++if test "x$ac_cv_lib_z_inflate" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBZ 1 ++_ACEOF ++ ++ LIBS="-lz $LIBS" ++ ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "can't find libz ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_EncryptInit in -lcrypto" >&5 + $as_echo_n "checking for EVP_EncryptInit in -lcrypto... " >&6; } + if ${ac_cv_lib_crypto_EVP_EncryptInit+:} false; then : +diff --git a/configure.in b/configure.in +index ee30daf..71df46b 100644 +--- a/configure.in ++++ b/configure.in +@@ -147,6 +147,10 @@ if test "$enable_openssl" = "yes"; then + LDFLAGS="$LDFLAGS $(pkg-config --libs openssl)"; + CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"; + ++ AC_CHECK_LIB([dl], [dlopen], [], ++ [AC_MSG_FAILURE([can't find libdl])]) ++ AC_CHECK_LIB([z], [inflate], [], ++ [AC_MSG_FAILURE([can't find libz])]) + AC_CHECK_LIB([crypto], [EVP_EncryptInit], [], + [AC_MSG_FAILURE([can't find openssl >1.0.1 crypto lib])]) + AC_CHECK_LIB([crypto], [EVP_aes_128_ctr], [], +-- +1.9.3 +
Signature · 1 line
1.9.3
PATCH 1/1 package/libsrtp: fix static build with openssl
Hi Romain,
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch line 6
Quoted 12 lines · Romain Naour
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch new file +6
-0@@ -0,0 +1,140 @@ +From cfbf3609d62201c6de9b1a075a2ce6f1edd580b6 Mon Sep 17 00:00:00 2001 +From: jfigus <[email protected]> +Date: Thu, 26 Feb 2015 12:25:08 -0500 +Subject: [PATCH] A autoconf checks for libz and libdl when OpenSSL is enabled + to allow for static linking of OpenSSL (via CFLAGS=-static). +
Please add your SoB here.
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch line 8
Quoted 2 lines
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch new file +2
-0+--- + configure | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Since we do AUTORECONF for this package anyway, please drop the configure part from this patch, and keep only the configure.in patch.
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch line 10
Quoted 2 lines
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch new file +2
-0+ configure.in | 4 +++ + 2 files changed, 104 insertions(+)
baruch
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -PATCH 1/1 package/libsrtp: fix static build with openssl
Hi Baruch,
Le 26/02/2015 22:19, Baruch Siach a ?crit :
Quoted 17 lines
Hi Romain,
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch line 6
Quoted 12 lines · Romain Naour
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch new file +6
-0@@ -0,0 +1,140 @@ +From cfbf3609d62201c6de9b1a075a2ce6f1edd580b6 Mon Sep 17 00:00:00 2001 +From: jfigus <[email protected]> +Date: Thu, 26 Feb 2015 12:25:08 -0500 +Subject: [PATCH] A autoconf checks for libz and libdl when OpenSSL is enabled + to allow for static linking of OpenSSL (via CFLAGS=-static). +Please add your SoB here.
Ok
Quoted 6 lines
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch line 8
Quoted 3 lines
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch new file +2
-0+--- + configure | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Since we do AUTORECONF for this package anyway, please drop the configure part from this patch, and keep only the configure.in patch.
I just cherry-picked and extracted the patch with git format-patch without further modifications...
Thanks for the review.
Best regards,
Romain
Quoted 6 lines
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch line 10
Quoted 3 lines
package/libsrtp/0002-A-autoconf-checks-for-libz-and-libdl-when-OpenSSL-is.patch new file +2
-0+ configure.in | 4 +++ + 2 files changed, 104 insertions(+)baruch