<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8630">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BuildSystem: With external editline, do not require libs for internal editline.<br><br>ASTERISK-27761<br><br>Change-Id: Ib17a7415297a210cfcdbf149e4df9b6edadbfab6<br>---<br>M configure<br>M configure.ac<br>2 files changed, 448 insertions(+), 310 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/30/8630/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/configure b/configure<br>index 5be181d..7524958 100755<br>--- a/configure<br>+++ b/configure<br>@@ -672,17 +672,11 @@<br> CONFIG_MYSQLCLIENT<br> PBX_MISDN_FAC_ERROR<br> PBX_MISDN_FAC_RESULT<br>-LIBEDIT_LIBS<br>-LIBEDIT_CFLAGS<br>-LIBEDIT_INTERNAL<br> ILBC_LIBS<br> ILBC_CFLAGS<br> ILBC_INTERNAL<br> GSM_INTERNAL<br> PBX_DAHDI_HALF_FULL<br>-PKG_CONFIG_LIBDIR<br>-PKG_CONFIG_PATH<br>-PKG_CONFIG<br> PBX_DLADDR<br> PBX_IP_MTU_DISCOVER<br> PBX_RTLD_NOLOAD<br>@@ -714,6 +708,12 @@<br> UUID_LIB<br> UUID_INCLUDE<br> EDITLINE_LIB<br>+LIBEDIT_LIBS<br>+LIBEDIT_CFLAGS<br>+PKG_CONFIG_LIBDIR<br>+PKG_CONFIG_PATH<br>+PKG_CONFIG<br>+LIBEDIT_INTERNAL<br> ALLOCA<br> PBX_ZLIB<br> ZLIB_DIR<br>@@ -1470,10 +1470,10 @@<br> PKG_CONFIG<br> PKG_CONFIG_PATH<br> PKG_CONFIG_LIBDIR<br>-ILBC_CFLAGS<br>-ILBC_LIBS<br> LIBEDIT_CFLAGS<br> LIBEDIT_LIBS<br>+ILBC_CFLAGS<br>+ILBC_LIBS<br> PJPROJECT_CFLAGS<br> PJPROJECT_LIBS<br> PYTHONDEV_CFLAGS<br>@@ -2224,12 +2224,12 @@<br>               directories to add to pkg-config's search path<br>   PKG_CONFIG_LIBDIR<br>               path overriding pkg-config's built-in search path<br>-  ILBC_CFLAGS C compiler flags for ILBC, overriding pkg-config<br>-  ILBC_LIBS   linker flags for ILBC, overriding pkg-config<br>   LIBEDIT_CFLAGS<br>               C compiler flags for LIBEDIT, overriding pkg-config<br>   LIBEDIT_LIBS<br>               linker flags for LIBEDIT, overriding pkg-config<br>+  ILBC_CFLAGS C compiler flags for ILBC, overriding pkg-config<br>+  ILBC_LIBS   linker flags for ILBC, overriding pkg-config<br>   PJPROJECT_CFLAGS<br>               C compiler flags for PJPROJECT, overriding pkg-config<br>   PJPROJECT_LIBS<br>@@ -13345,7 +13345,377 @@<br> done<br> <br> <br>-# Any one of these packages support a mandatory requirement, so we want to check on them as early as possible.<br>+# Find required NetBSD Editline library (libedit).<br>+EDITLINE_LIB=""<br>+LIBEDIT_INTERNAL="yes"<br>+<br>+LIBEDIT_SYSTEM="yes"<br>+if test "${USE_LIBEDIT}" != "no"; then<br>+   if test "${LIBEDIT_DIR}" = "internal"; then<br>+      LIBEDIT_SYSTEM="no"<br>+   elif test "${LIBEDIT_DIR}" != ""; then<br>+      LIBEDIT_INTERNAL="no"<br>+   fi<br>+   if test "${LIBEDIT_SYSTEM}" = "yes"; then<br>+<br>+<br>+<br>+<br>+<br>+<br>+<br>+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then<br>+        if test -n "$ac_tool_prefix"; then<br>+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.<br>+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5<br>+$as_echo_n "checking for $ac_word... " >&6; }<br>+if ${ac_cv_path_PKG_CONFIG+:} false; then :<br>+  $as_echo_n "(cached) " >&6<br>+else<br>+  case $PKG_CONFIG in<br>+  [\\/]* | ?:[\\/]*)<br>+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.<br>+  ;;<br>+  *)<br>+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR<br>+for as_dir in $PATH<br>+do<br>+  IFS=$as_save_IFS<br>+  test -z "$as_dir" && as_dir=.<br>+    for ac_exec_ext in '' $ac_executable_extensions; do<br>+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then<br>+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"<br>+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5<br>+    break 2<br>+  fi<br>+done<br>+  done<br>+IFS=$as_save_IFS<br>+<br>+  ;;<br>+esac<br>+fi<br>+PKG_CONFIG=$ac_cv_path_PKG_CONFIG<br>+if test -n "$PKG_CONFIG"; then<br>+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5<br>+$as_echo "$PKG_CONFIG" >&6; }<br>+else<br>+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>+$as_echo "no" >&6; }<br>+fi<br>+<br>+<br>+fi<br>+if test -z "$ac_cv_path_PKG_CONFIG"; then<br>+  ac_pt_PKG_CONFIG=$PKG_CONFIG<br>+  # Extract the first word of "pkg-config", so it can be a program name with args.<br>+set dummy pkg-config; ac_word=$2<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5<br>+$as_echo_n "checking for $ac_word... " >&6; }<br>+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :<br>+  $as_echo_n "(cached) " >&6<br>+else<br>+  case $ac_pt_PKG_CONFIG in<br>+  [\\/]* | ?:[\\/]*)<br>+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.<br>+  ;;<br>+  *)<br>+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR<br>+for as_dir in $PATH<br>+do<br>+  IFS=$as_save_IFS<br>+  test -z "$as_dir" && as_dir=.<br>+    for ac_exec_ext in '' $ac_executable_extensions; do<br>+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then<br>+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"<br>+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5<br>+    break 2<br>+  fi<br>+done<br>+  done<br>+IFS=$as_save_IFS<br>+<br>+  ;;<br>+esac<br>+fi<br>+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG<br>+if test -n "$ac_pt_PKG_CONFIG"; then<br>+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5<br>+$as_echo "$ac_pt_PKG_CONFIG" >&6; }<br>+else<br>+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>+$as_echo "no" >&6; }<br>+fi<br>+<br>+  if test "x$ac_pt_PKG_CONFIG" = x; then<br>+    PKG_CONFIG=""<br>+  else<br>+    case $cross_compiling:$ac_tool_warned in<br>+yes:)<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5<br>+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}<br>+ac_tool_warned=yes ;;<br>+esac<br>+    PKG_CONFIG=$ac_pt_PKG_CONFIG<br>+  fi<br>+else<br>+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"<br>+fi<br>+<br>+fi<br>+if test -n "$PKG_CONFIG"; then<br>+  _pkg_min_version=0.9.0<br>+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5<br>+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }<br>+        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then<br>+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>+$as_echo "yes" >&6; }<br>+  else<br>+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>+$as_echo "no" >&6; }<br>+            PKG_CONFIG=""<br>+      fi<br>+fi<br>+<br>+   if test "x${PBX_LIBEDIT}" != "x1" -a "${USE_LIBEDIT}" != "no"; then<br>+<br>+pkg_failed=no<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBEDIT" >&5<br>+$as_echo_n "checking for LIBEDIT... " >&6; }<br>+<br>+if test -n "$LIBEDIT_CFLAGS"; then<br>+    pkg_cv_LIBEDIT_CFLAGS="$LIBEDIT_CFLAGS"<br>+ elif test -n "$PKG_CONFIG"; then<br>+    if test -n "$PKG_CONFIG" && \<br>+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5<br>+  ($PKG_CONFIG --exists --print-errors "libedit") 2>&5<br>+  ac_status=$?<br>+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5<br>+  test $ac_status = 0; }; then<br>+  pkg_cv_LIBEDIT_CFLAGS=`$PKG_CONFIG --cflags "libedit" 2>/dev/null`<br>+                  test "x$?" != "x0" && pkg_failed=yes<br>+else<br>+  pkg_failed=yes<br>+fi<br>+ else<br>+    pkg_failed=untried<br>+fi<br>+if test -n "$LIBEDIT_LIBS"; then<br>+    pkg_cv_LIBEDIT_LIBS="$LIBEDIT_LIBS"<br>+ elif test -n "$PKG_CONFIG"; then<br>+    if test -n "$PKG_CONFIG" && \<br>+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5<br>+  ($PKG_CONFIG --exists --print-errors "libedit") 2>&5<br>+  ac_status=$?<br>+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5<br>+  test $ac_status = 0; }; then<br>+  pkg_cv_LIBEDIT_LIBS=`$PKG_CONFIG --libs "libedit" 2>/dev/null`<br>+                test "x$?" != "x0" && pkg_failed=yes<br>+else<br>+  pkg_failed=yes<br>+fi<br>+ else<br>+    pkg_failed=untried<br>+fi<br>+<br>+<br>+<br>+if test $pkg_failed = yes; then<br>+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>+$as_echo "no" >&6; }<br>+<br>+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then<br>+        _pkg_short_errors_supported=yes<br>+else<br>+        _pkg_short_errors_supported=no<br>+fi<br>+        if test $_pkg_short_errors_supported = yes; then<br>+               LIBEDIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libedit" 2>&1`<br>+        else<br>+                LIBEDIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libedit" 2>&1`<br>+        fi<br>+ # Put the nasty error message in config.log where it belongs<br>+ echo "$LIBEDIT_PKG_ERRORS" >&5<br>+<br>+<br>+            PBX_LIBEDIT=0<br>+<br>+<br>+elif test $pkg_failed = untried; then<br>+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>+$as_echo "no" >&6; }<br>+<br>+            PBX_LIBEDIT=0<br>+<br>+<br>+else<br>+        LIBEDIT_CFLAGS=$pkg_cv_LIBEDIT_CFLAGS<br>+        LIBEDIT_LIBS=$pkg_cv_LIBEDIT_LIBS<br>+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>+$as_echo "yes" >&6; }<br>+<br>+            PBX_LIBEDIT=1<br>+            LIBEDIT_INCLUDE="$LIBEDIT_CFLAGS"<br>+            LIBEDIT_LIB="$LIBEDIT_LIBS"<br>+<br>+$as_echo "#define HAVE_LIBEDIT 1" >>confdefs.h<br>+<br>+<br>+fi<br>+   fi<br>+<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>+      if test "$PBX_LIBEDIT" = "1"; then<br>+         LIBEDIT_INTERNAL="no"<br>+      fi<br>+   fi<br>+   if test "${LIBEDIT_INTERNAL}" = "yes"; then<br>+      PBX_LIBEDIT=1<br>+      LIBEDIT_IS_UNICODE=no<br>+   else<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>+$as_echo_n "checking for Testing for libedit unicode support... " >&6; }<br>+  saved_cppflags="${CPPFLAGS}"<br>+       if test "x${LIBEDIT_IS_UNICODE_DIR}" != "x"; then<br>+            LIBEDIT_IS_UNICODE_INCLUDE="-I${LIBEDIT_IS_UNICODE_DIR}/include"<br>+       fi<br>+   CPPFLAGS="${CPPFLAGS} ${LIBEDIT_IS_UNICODE_INCLUDE}"<br>+<br>+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>+/* end confdefs.h.  */<br>+ #include <histedit.h><br>+int<br>+main ()<br>+{<br>+ el_rfunc_t *callback;;<br>+<br>+  ;<br>+  return 0;<br>+}<br>+_ACEOF<br>+if ac_fn_c_try_compile "$LINENO"; then :<br>+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>+$as_echo "yes" >&6; }<br>+               PBX_LIBEDIT_IS_UNICODE=1<br>+<br>+$as_echo "#define HAVE_LIBEDIT_IS_UNICODE 1" >>confdefs.h<br>+<br>+<br>+<br>+else<br>+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>+$as_echo "no" >&6; }<br>+<br>+fi<br>+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>+  CPPFLAGS="${saved_cppflags}"<br>+    fi<br>+<br>+   fi<br>+fi<br>+# If the Asterisk internal copy should be build (user said so) or<br>+# must be build (system does not have it), either -ltermcap,<br>+# -ltinfo, or -l{n}curses must be available.<br>+if test "${LIBEDIT_INTERNAL}" = "yes"; then<br> <br> if test "x${PBX_TERMCAP}" != "x1" -a "${USE_TERMCAP}" != "no"; then<br>    pbxlibdir=""<br>@@ -13432,6 +13802,9 @@<br> fi<br> <br> <br>+   if test "x$TERMCAP_LIB" != "x" ; then<br>+      EDITLINE_LIB="$TERMCAP_LIB"<br>+   else<br> <br> if test "x${PBX_TINFO}" != "x1" -a "${USE_TINFO}" != "no"; then<br>    pbxlibdir=""<br>@@ -13518,6 +13891,9 @@<br> fi<br> <br> <br>+      if test "x$TINFO_LIB" != "x" ; then<br>+         EDITLINE_LIB="$TINFO_LIB"<br>+      else<br> <br> if test "x${PBX_CURSES}" != "x1" -a "${USE_CURSES}" != "no"; then<br>    pbxlibdir=""<br>@@ -13614,6 +13990,9 @@<br> fi<br> <br> <br>+         if test "x$CURSES_LIB" != "x" ; then<br>+            EDITLINE_LIB="$CURSES_LIB"<br>+         else<br> <br> if test "x${PBX_NCURSES}" != "x1" -a "${USE_NCURSES}" != "no"; then<br>    pbxlibdir=""<br>@@ -13710,18 +14089,14 @@<br> fi<br> <br> <br>-<br>-EDITLINE_LIB=""<br>-if test "x$TERMCAP_LIB" != "x" ; then<br>-  EDITLINE_LIB="$TERMCAP_LIB"<br>-elif test "x$TINFO_LIB" != "x" ; then<br>-  EDITLINE_LIB="$TINFO_LIB"<br>-elif test "x$CURSES_LIB" != "x" ; then<br>-  EDITLINE_LIB="$CURSES_LIB"<br>-elif test "x$NCURSES_LIB" != "x" ; then<br>-  EDITLINE_LIB="$NCURSES_LIB"<br>-else<br>-  as_fn_error $? "*** termcap support not found (on modern systems, this typically means the ncurses development package is missing)" "$LINENO" 5<br>+            if test "x$NCURSES_LIB" != "x" ; then<br>+               EDITLINE_LIB="$NCURSES_LIB"<br>+            else<br>+               as_fn_error $? "*** termcap support not found (on modern systems, this typically means the ncurses development package is missing)" "$LINENO" 5<br>+            fi<br>+         fi<br>+      fi<br>+   fi<br> fi<br> <br> <br>@@ -20633,252 +21008,6 @@<br>    fi<br>    if test "${ILBC_INTERNAL}" = "yes"; then<br>       PBX_ILBC=1<br>-   fi<br>-fi<br>-<br>-LIBEDIT_INTERNAL="yes"<br>-<br>-LIBEDIT_SYSTEM="yes"<br>-if test "${USE_LIBEDIT}" != "no"; then<br>-   if test "${LIBEDIT_DIR}" = "internal"; then<br>-      LIBEDIT_SYSTEM="no"<br>-   elif test "${LIBEDIT_DIR}" != ""; then<br>-      LIBEDIT_INTERNAL="no"<br>-   fi<br>-   if test "${LIBEDIT_SYSTEM}" = "yes"; then<br>-<br>-   if test "x${PBX_LIBEDIT}" != "x1" -a "${USE_LIBEDIT}" != "no"; then<br>-<br>-pkg_failed=no<br>-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBEDIT" >&5<br>-$as_echo_n "checking for LIBEDIT... " >&6; }<br>-<br>-if test -n "$LIBEDIT_CFLAGS"; then<br>-    pkg_cv_LIBEDIT_CFLAGS="$LIBEDIT_CFLAGS"<br>- elif test -n "$PKG_CONFIG"; then<br>-    if test -n "$PKG_CONFIG" && \<br>-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5<br>-  ($PKG_CONFIG --exists --print-errors "libedit") 2>&5<br>-  ac_status=$?<br>-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5<br>-  test $ac_status = 0; }; then<br>-  pkg_cv_LIBEDIT_CFLAGS=`$PKG_CONFIG --cflags "libedit" 2>/dev/null`<br>-                test "x$?" != "x0" && pkg_failed=yes<br>-else<br>-  pkg_failed=yes<br>-fi<br>- else<br>-    pkg_failed=untried<br>-fi<br>-if test -n "$LIBEDIT_LIBS"; then<br>-    pkg_cv_LIBEDIT_LIBS="$LIBEDIT_LIBS"<br>- elif test -n "$PKG_CONFIG"; then<br>-    if test -n "$PKG_CONFIG" && \<br>-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5<br>-  ($PKG_CONFIG --exists --print-errors "libedit") 2>&5<br>-  ac_status=$?<br>-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5<br>-  test $ac_status = 0; }; then<br>-  pkg_cv_LIBEDIT_LIBS=`$PKG_CONFIG --libs "libedit" 2>/dev/null`<br>-                test "x$?" != "x0" && pkg_failed=yes<br>-else<br>-  pkg_failed=yes<br>-fi<br>- else<br>-    pkg_failed=untried<br>-fi<br>-<br>-<br>-<br>-if test $pkg_failed = yes; then<br>-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then<br>-        _pkg_short_errors_supported=yes<br>-else<br>-        _pkg_short_errors_supported=no<br>-fi<br>-        if test $_pkg_short_errors_supported = yes; then<br>-               LIBEDIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libedit" 2>&1`<br>-        else<br>-                LIBEDIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libedit" 2>&1`<br>-        fi<br>- # Put the nasty error message in config.log where it belongs<br>- echo "$LIBEDIT_PKG_ERRORS" >&5<br>-<br>-<br>-            PBX_LIBEDIT=0<br>-<br>-<br>-elif test $pkg_failed = untried; then<br>-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-            PBX_LIBEDIT=0<br>-<br>-<br>-else<br>-        LIBEDIT_CFLAGS=$pkg_cv_LIBEDIT_CFLAGS<br>-        LIBEDIT_LIBS=$pkg_cv_LIBEDIT_LIBS<br>-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-<br>-            PBX_LIBEDIT=1<br>-            LIBEDIT_INCLUDE="$LIBEDIT_CFLAGS"<br>-            LIBEDIT_LIB="$LIBEDIT_LIBS"<br>-<br>-$as_echo "#define HAVE_LIBEDIT 1" >>confdefs.h<br>-<br>-<br>-fi<br>-   fi<br>-<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>-      if test "$PBX_LIBEDIT" = "1"; then<br>-         LIBEDIT_INTERNAL="no"<br>-      fi<br>-   fi<br>-   if test "${LIBEDIT_INTERNAL}" = "yes"; then<br>-      PBX_LIBEDIT=1<br>-      LIBEDIT_IS_UNICODE=no<br>-   else<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>-$as_echo_n "checking for Testing for libedit unicode support... " >&6; }<br>-  saved_cppflags="${CPPFLAGS}"<br>-       if test "x${LIBEDIT_IS_UNICODE_DIR}" != "x"; then<br>-            LIBEDIT_IS_UNICODE_INCLUDE="-I${LIBEDIT_IS_UNICODE_DIR}/include"<br>-       fi<br>-   CPPFLAGS="${CPPFLAGS} ${LIBEDIT_IS_UNICODE_INCLUDE}"<br>-<br>-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>-/* end confdefs.h.  */<br>- #include <histedit.h><br>-int<br>-main ()<br>-{<br>- el_rfunc_t *callback;;<br>-<br>-  ;<br>-  return 0;<br>-}<br>-_ACEOF<br>-if ac_fn_c_try_compile "$LINENO"; then :<br>-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5<br>-$as_echo "yes" >&6; }<br>-               PBX_LIBEDIT_IS_UNICODE=1<br>-<br>-$as_echo "#define HAVE_LIBEDIT_IS_UNICODE 1" >>confdefs.h<br>-<br>-<br>-<br>-else<br>-         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5<br>-$as_echo "no" >&6; }<br>-<br>-fi<br>-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext<br>-  CPPFLAGS="${saved_cppflags}"<br>-    fi<br>-<br>    fi<br> fi<br> <br>diff --git a/configure.ac b/configure.ac<br>index 0608938..81057ce 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -620,23 +620,57 @@<br> <br> AC_CHECK_HEADERS([arpa/inet.h libintl.h malloc.h netdb.h stddef.h strings.h sys/event.h utime.h])<br> <br>-# Any one of these packages support a mandatory requirement, so we want to check on them as early as possible.<br>-AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])<br>-AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])<br>-AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])<br>-AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])<br>-<br>+# Find required NetBSD Editline library (libedit).<br> EDITLINE_LIB=""<br>-if test "x$TERMCAP_LIB" != "x" ; then<br>-  EDITLINE_LIB="$TERMCAP_LIB"<br>-elif test "x$TINFO_LIB" != "x" ; then<br>-  EDITLINE_LIB="$TINFO_LIB"<br>-elif test "x$CURSES_LIB" != "x" ; then<br>-  EDITLINE_LIB="$CURSES_LIB"<br>-elif test "x$NCURSES_LIB" != "x" ; then<br>-  EDITLINE_LIB="$NCURSES_LIB"<br>-else<br>-  AC_MSG_ERROR([*** termcap support not found (on modern systems, this typically means the ncurses development package is missing)])<br>+LIBEDIT_INTERNAL="yes"<br>+AC_SUBST(LIBEDIT_INTERNAL)<br>+LIBEDIT_SYSTEM="yes"<br>+if test "${USE_LIBEDIT}" != "no"; then<br>+   if test "${LIBEDIT_DIR}" = "internal"; then<br>+      LIBEDIT_SYSTEM="no"<br>+   elif test "${LIBEDIT_DIR}" != ""; then<br>+      LIBEDIT_INTERNAL="no"<br>+   fi<br>+   if test "${LIBEDIT_SYSTEM}" = "yes"; then<br>+      AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)<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>+      if test "$PBX_LIBEDIT" = "1"; then<br>+         LIBEDIT_INTERNAL="no"<br>+      fi<br>+   fi<br>+   if test "${LIBEDIT_INTERNAL}" = "yes"; then<br>+      PBX_LIBEDIT=1<br>+      LIBEDIT_IS_UNICODE=no<br>+   else<br>+      AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support])<br>+   fi<br>+fi<br>+# If the Asterisk internal copy should be build (user said so) or<br>+# must be build (system does not have it), either -ltermcap,<br>+# -ltinfo, or -l{n}curses must be available.<br>+if test "${LIBEDIT_INTERNAL}" = "yes"; then<br>+   AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])<br>+   if test "x$TERMCAP_LIB" != "x" ; then<br>+      EDITLINE_LIB="$TERMCAP_LIB"<br>+   else<br>+      AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])<br>+      if test "x$TINFO_LIB" != "x" ; then<br>+         EDITLINE_LIB="$TINFO_LIB"<br>+      else<br>+         AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])<br>+         if test "x$CURSES_LIB" != "x" ; then<br>+            EDITLINE_LIB="$CURSES_LIB"<br>+         else<br>+            AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])<br>+            if test "x$NCURSES_LIB" != "x" ; then<br>+               EDITLINE_LIB="$NCURSES_LIB"<br>+            else<br>+               AC_MSG_ERROR([*** termcap support not found (on modern systems, this typically means the ncurses development package is missing)])<br>+            fi<br>+         fi<br>+      fi<br>+   fi<br> fi<br> AC_SUBST(EDITLINE_LIB)<br> <br>@@ -1584,31 +1618,6 @@<br>    fi<br>    if test "${ILBC_INTERNAL}" = "yes"; then<br>       PBX_ILBC=1<br>-   fi<br>-fi<br>-<br>-LIBEDIT_INTERNAL="yes"<br>-AC_SUBST(LIBEDIT_INTERNAL)<br>-LIBEDIT_SYSTEM="yes"<br>-if test "${USE_LIBEDIT}" != "no"; then<br>-   if test "${LIBEDIT_DIR}" = "internal"; then<br>-      LIBEDIT_SYSTEM="no"<br>-   elif test "${LIBEDIT_DIR}" != ""; then<br>-      LIBEDIT_INTERNAL="no"<br>-   fi<br>-   if test "${LIBEDIT_SYSTEM}" = "yes"; then<br>-      AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)<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>-      if test "$PBX_LIBEDIT" = "1"; then<br>-         LIBEDIT_INTERNAL="no"<br>-      fi<br>-   fi<br>-   if test "${LIBEDIT_INTERNAL}" = "yes"; then<br>-      PBX_LIBEDIT=1<br>-      LIBEDIT_IS_UNICODE=no<br>-   else<br>-      AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support])<br>    fi<br> fi<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8630">change 8630</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/8630"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib17a7415297a210cfcdbf149e4df9b6edadbfab6 </div>
<div style="display:none"> Gerrit-Change-Number: 8630 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>