<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8222">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BuildSystem: Enable system provided libedit on OpenBSD.<br><br>ASTERISK-27677<br><br>Change-Id: I0854e3616d1361ae9b6907d3d3444a02784ac62b<br>---<br>M configure<br>M configure.ac<br>2 files changed, 103 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/22/8222/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/configure b/configure<br>index e03ae11..0d439a0 100755<br>--- a/configure<br>+++ b/configure<br>@@ -20669,6 +20669,105 @@<br> fi<br> fi<br> <br>+ if test "$PBX_LIBEDIT" != "1"; then<br>+ # some platforms do not list libedit via pkg-config, for example OpenBSD 6.2<br>+<br>+if test "x${PBX_LIBEDIT}" != "x1" -a "${USE_LIBEDIT}" != "no"; then<br>+ pbxlibdir=""<br>+ # if --with-LIBEDIT=DIR has been specified, use it.<br>+ if test "x${LIBEDIT_DIR}" != "x"; then<br>+ if test -d ${LIBEDIT_DIR}/lib; then<br>+ pbxlibdir="-L${LIBEDIT_DIR}/lib"<br>+ else<br>+ pbxlibdir="-L${LIBEDIT_DIR}"<br>+ fi<br>+ fi<br>+<br>+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"<br>+ CFLAGS="${CFLAGS} "<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for history_init in -ledit" >&5<br>+$as_echo_n "checking for history_init in -ledit... " >&6; }<br>+if ${ac_cv_lib_edit_history_init+:} false; then :<br>+ $as_echo_n "(cached) " >&6<br>+else<br>+ ac_check_lib_save_LIBS=$LIBS<br>+LIBS="-ledit ${pbxlibdir} -ltermcap $LIBS"<br>+cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>+/* end confdefs.h. */<br>+<br>+/* Override any GCC internal prototype to avoid an error.<br>+ Use char because int might match the return type of a GCC<br>+ builtin and then its argument prototype would still apply. */<br>+#ifdef __cplusplus<br>+extern "C"<br>+#endif<br>+char history_init ();<br>+int<br>+main ()<br>+{<br>+return history_init ();<br>+ ;<br>+ return 0;<br>+}<br>+_ACEOF<br>+if ac_fn_c_try_link "$LINENO"; then :<br>+ ac_cv_lib_edit_history_init=yes<br>+else<br>+ ac_cv_lib_edit_history_init=no<br>+fi<br>+rm -f core conftest.err conftest.$ac_objext \<br>+ conftest$ac_exeext conftest.$ac_ext<br>+LIBS=$ac_check_lib_save_LIBS<br>+fi<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_edit_history_init" >&5<br>+$as_echo "$ac_cv_lib_edit_history_init" >&6; }<br>+if test "x$ac_cv_lib_edit_history_init" = xyes; then :<br>+ AST_LIBEDIT_FOUND=yes<br>+else<br>+ AST_LIBEDIT_FOUND=no<br>+fi<br>+<br>+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"<br>+<br>+<br>+ # now check for the header.<br>+ if test "${AST_LIBEDIT_FOUND}" = "yes"; then<br>+ LIBEDIT_LIB="${pbxlibdir} -ledit -ltermcap"<br>+ # if --with-LIBEDIT=DIR has been specified, use it.<br>+ if test "x${LIBEDIT_DIR}" != "x"; then<br>+ LIBEDIT_INCLUDE="-I${LIBEDIT_DIR}/include"<br>+ fi<br>+ LIBEDIT_INCLUDE="${LIBEDIT_INCLUDE} "<br>+<br>+ # check for the header<br>+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"<br>+ CPPFLAGS="${CPPFLAGS} ${LIBEDIT_INCLUDE}"<br>+ ac_fn_c_check_header_mongrel "$LINENO" "histedit.h" "ac_cv_header_histedit_h" "$ac_includes_default"<br>+if test "x$ac_cv_header_histedit_h" = xyes; then :<br>+ LIBEDIT_HEADER_FOUND=1<br>+else<br>+ LIBEDIT_HEADER_FOUND=0<br>+fi<br>+<br>+<br>+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"<br>+<br>+ if test "x${LIBEDIT_HEADER_FOUND}" = "x0" ; then<br>+ LIBEDIT_LIB=""<br>+ LIBEDIT_INCLUDE=""<br>+ else<br>+<br>+ PBX_LIBEDIT=1<br>+ cat >>confdefs.h <<_ACEOF<br>+#define HAVE_LIBEDIT 1<br>+_ACEOF<br>+<br>+ fi<br>+ fi<br>+fi<br>+<br>+<br>+ fi<br> if test "$PBX_LIBEDIT" = "1"; then<br> LIBEDIT_INTERNAL="no"<br> fi<br>diff --git a/configure.ac b/configure.ac<br>index bb432a8..d0d3c39 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -1541,6 +1541,10 @@<br> fi<br> if test "${LIBEDIT_SYSTEM}" = "yes"; then<br> AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)<br>+ if test "$PBX_LIBEDIT" != "1"; then<br>+ # some platforms do not list libedit via pkg-config, for example OpenBSD 6.2<br>+ AST_EXT_LIB_CHECK([LIBEDIT], [edit], [history_init], [histedit.h], [-ltermcap])<br>+ fi<br> if test "$PBX_LIBEDIT" = "1"; then<br> LIBEDIT_INTERNAL="no"<br> fi<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8222">change 8222</a>. To unsubscribe, 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/8222"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I0854e3616d1361ae9b6907d3d3444a02784ac62b </div>
<div style="display:none"> Gerrit-Change-Number: 8222 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>