<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8221">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, 113 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/21/8221/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/configure b/configure<br>index 0f97728..ad540a5 100755<br>--- a/configure<br>+++ b/configure<br>@@ -14930,7 +14930,7 @@<br>     We can't simply define LARGE_OFF_T to be 9223372036854775807,<br>     since some C++ compilers masquerading as C compilers<br>     incorrectly reject 9223372036854775807.  */<br>-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))<br>+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))<br>   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721<br>                       && LARGE_OFF_T % 2147483647 == 1)<br>                    ? 1 : -1];<br>@@ -14976,7 +14976,7 @@<br>     We can't simply define LARGE_OFF_T to be 9223372036854775807,<br>     since some C++ compilers masquerading as C compilers<br>     incorrectly reject 9223372036854775807.  */<br>-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))<br>+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))<br>   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721<br>                       && LARGE_OFF_T % 2147483647 == 1)<br>                    ? 1 : -1];<br>@@ -15000,7 +15000,7 @@<br>     We can't simply define LARGE_OFF_T to be 9223372036854775807,<br>     since some C++ compilers masquerading as C compilers<br>     incorrectly reject 9223372036854775807.  */<br>-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))<br>+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))<br>   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721<br>                       && LARGE_OFF_T % 2147483647 == 1)<br>                    ? 1 : -1];<br>@@ -15045,7 +15045,7 @@<br>     We can't simply define LARGE_OFF_T to be 9223372036854775807,<br>     since some C++ compilers masquerading as C compilers<br>     incorrectly reject 9223372036854775807.  */<br>-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))<br>+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))<br>   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721<br>                       && LARGE_OFF_T % 2147483647 == 1)<br>                    ? 1 : -1];<br>@@ -15069,7 +15069,7 @@<br>     We can't simply define LARGE_OFF_T to be 9223372036854775807,<br>     since some C++ compilers masquerading as C compilers<br>     incorrectly reject 9223372036854775807.  */<br>-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))<br>+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))<br>   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721<br>                       && LARGE_OFF_T % 2147483647 == 1)<br>                    ? 1 : -1];<br>@@ -20976,6 +20976,109 @@<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>+     as_fn_error $? "*** Please install the 'libedit' development package." "$LINENO" 5<br>+       exit 1<br>+fi<br> <br>     if test "x${PBX_LIBEDIT_IS_UNICODE}" != "x1" -a "${USE_LIBEDIT_IS_UNICODE}" != "no"; then<br>        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Testing for libedit unicode support" >&5<br>@@ -21016,11 +21119,6 @@<br>     CPPFLAGS="${saved_cppflags}"<br>     fi<br> <br>-<br>-if test "${PBX_LIBEDIT}" != 1; then<br>-        as_fn_error $? "*** Please install the 'libedit' development package." "$LINENO" 5<br>-       exit 1<br>-fi<br> <br> <br> if test "x${PBX_ICONV}" != "x1" -a "${USE_ICONV}" != "no"; then<br>diff --git a/configure.ac b/configure.ac<br>index cef28f5..c218912 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -1577,12 +1577,15 @@<br> fi<br> <br> AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)<br>-AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support])<br>-<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>  AC_MSG_ERROR(*** Please install the 'libedit' development package.)<br>   exit 1<br> fi<br>+AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support])<br> <br> AST_EXT_LIB_CHECK([ICONV], [iconv], [iconv_open], [iconv.h])<br> # GNU libiconv #define's iconv_open to libiconv_open, so we need to search for that symbol<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8221">change 8221</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/8221"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I0854e3616d1361ae9b6907d3d3444a02784ac62b </div>
<div style="display:none"> Gerrit-Change-Number: 8221 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>