<p>Philip Prindeville has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18524">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">test: Check for the presence of open_memstream() to configure<br><br>ASTERISK-30037<br><br>Change-Id: Ifeaaf292dec21aa8076eab7acf8f42d05bedfaf7<br>Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com><br>---<br>M configure<br>M configure.ac<br>M include/asterisk/autoconfig.h.in<br>M main/tcptls.c<br>4 files changed, 22 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/24/18524/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure b/configure</span><br><span>index ac26b46..305eb4c 100755</span><br><span>--- a/configure</span><br><span>+++ b/configure</span><br><span>@@ -18441,6 +18441,12 @@</span><br><span> printf "%s\n" "#define HAVE_NEWLOCALE 1" >>confdefs.h</span><br><span> </span><br><span> fi</span><br><span style="color: hsl(120, 100%, 40%);">+ac_fn_c_check_func "$LINENO" "open_memstream" "ac_cv_func_open_memstream"</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_func_open_memstream" = xyes</span><br><span style="color: hsl(120, 100%, 40%);">+then :</span><br><span style="color: hsl(120, 100%, 40%);">+ printf "%s\n" "#define HAVE_OPEN_MEMSTREAM 1" >>confdefs.h</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span> ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2"</span><br><span> if test "x$ac_cv_func_pipe2" = xyes</span><br><span> then :</span><br><span>@@ -18653,6 +18659,10 @@</span><br><span> fi</span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_func_open_memstream" != "xyes"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ as_fn_error $? "*** Require open_memstream() but it's not detected!" "$LINENO" 5</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for htonll" >&5</span><br><span> printf %s "checking for htonll... " >&6; }</span><br><span> cat confdefs.h - <<_ACEOF >conftest.$ac_ext</span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index b92db5d..b4be643 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -840,7 +840,11 @@</span><br><span> AC_FUNC_STRTOD</span><br><span> AC_FUNC_UTIME_NULL</span><br><span> AC_FUNC_VPRINTF</span><br><span style="color: hsl(0, 100%, 40%);">-AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale pipe2 ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl malloc_trim])</span><br><span style="color: hsl(120, 100%, 40%);">+AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale open_memstream pipe2 ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl malloc_trim])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_func_open_memstream" != "xyes"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ AC_MSG_ERROR([*** Require open_memstream() but it's not detected!])</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span> </span><br><span> AC_MSG_CHECKING(for htonll)</span><br><span> AC_LINK_IFELSE(</span><br><span>diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in</span><br><span>index 40b9285..563a499 100644</span><br><span>--- a/include/asterisk/autoconfig.h.in</span><br><span>+++ b/include/asterisk/autoconfig.h.in</span><br><span>@@ -580,6 +580,9 @@</span><br><span> /* Define to 1 if CRYPTO has the OpenSSL BIO Method Support feature. */</span><br><span> #undef HAVE_OPENSSL_BIO_METHOD</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Define to 1 if you have the `open_memstream' function. */</span><br><span style="color: hsl(120, 100%, 40%);">+#undef HAVE_OPEN_MEMSTREAM</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Define to 1 if you have the Opus library. */</span><br><span> #undef HAVE_OPUS</span><br><span> </span><br><span>diff --git a/main/tcptls.c b/main/tcptls.c</span><br><span>index b2756d1..729f787 100644</span><br><span>--- a/main/tcptls.c</span><br><span>+++ b/main/tcptls.c</span><br><span>@@ -108,6 +108,9 @@</span><br><span> return ret;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#ifndef HAVE_OPEN_MEMSTREAM</span><br><span style="color: hsl(120, 100%, 40%);">+#error Require open_memstream() but not detected!</span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span> static void write_openssl_error_to_log(void)</span><br><span> {</span><br><span> FILE *fp;</span><br><span>@@ -129,6 +132,7 @@</span><br><span> ast_free(buffer);</span><br><span> }</span><br><span> #endif</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> </span><br><span> /*! \brief</span><br><span> * creates a FILE * from the fd passed by the accept thread.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18524">change 18524</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/+/18524"/><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: Ifeaaf292dec21aa8076eab7acf8f42d05bedfaf7 </div>
<div style="display:none"> Gerrit-Change-Number: 18524 </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>