<p>Philip Prindeville has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18300">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BuildSystem: compile-time check for bio_method being exposed<br><br>Change-Id: Ie47ce13dfa64b21ae9a803ad559808ab2f387cbe<br>---<br>M configure<br>M configure.ac<br>M include/asterisk/autoconfig.h.in<br>3 files changed, 67 insertions(+), 19 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/00/18300/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure b/configure</span><br><span>index ac26b46..daa54b2 100755</span><br><span>--- a/configure</span><br><span>+++ b/configure</span><br><span>@@ -10201,6 +10201,44 @@</span><br><span> </span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if BIO_METHOD internals are exposed" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo_n "checking if BIO_METHOD internals are exposed... " >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+cat confdefs.h - <<_ACEOF >conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+/* end confdefs.h. */</span><br><span style="color: hsl(120, 100%, 40%);">+#include <openssl/bio.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+int</span><br><span style="color: hsl(120, 100%, 40%);">+main ()</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+static BIO_METHOD bio_methods = {</span><br><span style="color: hsl(120, 100%, 40%);">+ .type = BIO_TYPE_BIO,</span><br><span style="color: hsl(120, 100%, 40%);">+ .name = "bio test for conifgure",</span><br><span style="color: hsl(120, 100%, 40%);">+ .bwrite = NULL,</span><br><span style="color: hsl(120, 100%, 40%);">+ .ctrl = NULL,</span><br><span style="color: hsl(120, 100%, 40%);">+ .create = NULL,</span><br><span style="color: hsl(120, 100%, 40%);">+ .destroy = NULL,</span><br><span style="color: hsl(120, 100%, 40%);">+ };</span><br><span style="color: hsl(120, 100%, 40%);">+ ;</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+if ac_fn_c_try_compile "$LINENO"; then :</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "yes" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "no" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "#define HAVE_OPENSSL_BIO_METHOD 1" >>confdefs.h</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> # If neither --without-ssl (PBX_OPENSSL=-1) nor --without-crypto (PBX_CRYPTO=-1)</span><br><span> # and there were no directories atdded to --with-ssl and --with-crypto, and</span><br><span> # pkg-config is installed (which is should be by install_prereq).</span><br><span>@@ -10389,13 +10427,9 @@</span><br><span> fi</span><br><span> </span><br><span> fi</span><br><span style="color: hsl(0, 100%, 40%);">- if test $PBX_OPENSSL -eq 1 ; then</span><br><span style="color: hsl(0, 100%, 40%);">- printf "%s\n" "#define HAVE_OPENSSL_BIO_METHOD 1" >>confdefs.h</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- PBX_OPENSSL_BIO_METHOD=1</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking fallback system openssl" >&5</span><br><span style="color: hsl(0, 100%, 40%);">-printf "%s\n" "$as_me: checking fallback system openssl" >&6;}</span><br><span style="color: hsl(120, 100%, 40%);">+ if test $PBX_OPENSSL -ne 1 ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking fallback system openssl" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "$as_me: checking fallback system openssl" >&6;}</span><br><span> </span><br><span> if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then</span><br><span> </span><br><span>@@ -10484,10 +10518,8 @@</span><br><span> fi</span><br><span> fi</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if test $PBX_OPENSSL -eq 1; then</span><br><span style="color: hsl(0, 100%, 40%);">- printf "%s\n" "#define HAVE_CRYPTO 1" >>confdefs.h</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo "#define HAVE_CRYPTO 1" >>confdefs.h</span><br><span> </span><br><span> PBX_CRYPTO=1</span><br><span> fi</span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index b92db5d..3e436a2 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -472,6 +472,27 @@</span><br><span> AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer], [ssl])</span><br><span> AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_BIO_METHOD], [OpenSSL BIO Method Support], [CRYPTO], [crypto])</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+AC_MSG_CHECKING(if BIO_METHOD internals are exposed)</span><br><span style="color: hsl(120, 100%, 40%);">+AC_COMPILE_IFELSE(</span><br><span style="color: hsl(120, 100%, 40%);">+ [AC_LANG_PROGRAM(</span><br><span style="color: hsl(120, 100%, 40%);">+ [#include <openssl/bio.h></span><br><span style="color: hsl(120, 100%, 40%);">+ ],</span><br><span style="color: hsl(120, 100%, 40%);">+ [static BIO_METHOD bio_methods = {</span><br><span style="color: hsl(120, 100%, 40%);">+ .type = BIO_TYPE_BIO,</span><br><span style="color: hsl(120, 100%, 40%);">+ .name = "bio_methods test for configure",</span><br><span style="color: hsl(120, 100%, 40%);">+ .bwrite = NULL,</span><br><span style="color: hsl(120, 100%, 40%);">+ .ctrl = NULL,</span><br><span style="color: hsl(120, 100%, 40%);">+ .create = NULL,</span><br><span style="color: hsl(120, 100%, 40%);">+ .destroy = NULL,</span><br><span style="color: hsl(120, 100%, 40%);">+ };])],</span><br><span style="color: hsl(120, 100%, 40%);">+ [</span><br><span style="color: hsl(120, 100%, 40%);">+ AC_MSG_RESULT(yes)</span><br><span style="color: hsl(120, 100%, 40%);">+ ],[</span><br><span style="color: hsl(120, 100%, 40%);">+ AC_MSG_RESULT(no)</span><br><span style="color: hsl(120, 100%, 40%);">+ AC_DEFINE([HAVE_OPENSSL_BIO_METHOD], 1, [Define if your system doesn't expose BIO_METHOD structure internals])</span><br><span style="color: hsl(120, 100%, 40%);">+ ]</span><br><span style="color: hsl(120, 100%, 40%);">+)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> # If neither --without-ssl (PBX_OPENSSL=-1) nor --without-crypto (PBX_CRYPTO=-1)</span><br><span> # and there were no directories atdded to --with-ssl and --with-crypto, and</span><br><span> # pkg-config is installed (which is should be by install_prereq).</span><br><span>@@ -483,15 +504,10 @@</span><br><span> AC_MSG_NOTICE(checking whether alternate openssl11 is installed)</span><br><span> AST_PKG_CONFIG_CHECK([OPENSSL], [openssl11])</span><br><span> fi</span><br><span style="color: hsl(0, 100%, 40%);">- if test $PBX_OPENSSL -eq 1 ; then</span><br><span style="color: hsl(0, 100%, 40%);">- AC_DEFINE([HAVE_OPENSSL_BIO_METHOD], 1)</span><br><span style="color: hsl(0, 100%, 40%);">- PBX_OPENSSL_BIO_METHOD=1</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(120, 100%, 40%);">+ if test $PBX_OPENSSL -ne 1 ; then</span><br><span> AC_MSG_NOTICE(checking fallback system openssl)</span><br><span> AST_PKG_CONFIG_CHECK([OPENSSL], [openssl])</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if test $PBX_OPENSSL -eq 1; then</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span> AC_DEFINE([HAVE_CRYPTO], 1)</span><br><span> PBX_CRYPTO=1</span><br><span> fi</span><br><span>diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in</span><br><span>index 40b9285..14a2d7b 100644</span><br><span>--- a/include/asterisk/autoconfig.h.in</span><br><span>+++ b/include/asterisk/autoconfig.h.in</span><br><span>@@ -577,7 +577,7 @@</span><br><span> /* Define if your system has the OPENSSL libraries. */</span><br><span> #undef HAVE_OPENSSL</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/* Define to 1 if CRYPTO has the OpenSSL BIO Method Support feature. */</span><br><span style="color: hsl(120, 100%, 40%);">+/* Define if your system doesn't expose BIO_METHOD structure internals */</span><br><span> #undef HAVE_OPENSSL_BIO_METHOD</span><br><span> </span><br><span> /* Define to 1 if you have the Opus library. */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18300">change 18300</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/18300"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie47ce13dfa64b21ae9a803ad559808ab2f387cbe </div>
<div style="display:none"> Gerrit-Change-Number: 18300 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Philip Prindeville <philipp@redfish-solutions.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>