summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2016-11-14 11:16:03 -0700
committerGeorge Joseph <gjoseph@digium.com>2016-11-14 13:20:26 -0500
commit5e0c22404316ecdf8e1510553474274eddf55e20 (patch)
tree960df22d84ed39953736873d32d4dedcd20e9114 /configure
parentec17e96784b8a75f74d84621165c73d986d56f95 (diff)
cli: Fix ast_el_read_char to work with libedit >= 3.1
Libedit 3.1 is not build with unicode on as a default and so the prototype for the el_gets callback changed from expecting a char buffer to accepting a wchar buffer. If ast_el_read_char isn't changed, the cli reads garbage from teh terminal. Added a configure test for (*el_rfunc_t)(EditLine *, wchar_t *) and updated ast_el_read_char to use the HAVE_ define to detemrine whether to use char or wchar. ASTERISK-26592 #close Change-Id: I9099b46f68e06d0202ff80e53022a2b68b08871a
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure65
1 files changed, 64 insertions, 1 deletions
diff --git a/configure b/configure
index 0446c4571..0214a0b04 100755
--- a/configure
+++ b/configure
@@ -1031,6 +1031,10 @@ PBX_LIBXML2
LIBXML2_DIR
LIBXML2_INCLUDE
LIBXML2_LIB
+PBX_LIBEDIT_IS_UNICODE
+LIBEDIT_IS_UNICODE_DIR
+LIBEDIT_IS_UNICODE_INCLUDE
+LIBEDIT_IS_UNICODE_LIB
PBX_LIBEDIT
LIBEDIT_DIR
LIBEDIT_INCLUDE
@@ -10652,6 +10656,18 @@ fi
+LIBEDIT_IS_UNICODE_DESCRIP="Libedit compiled for unicode"
+LIBEDIT_IS_UNICODE_OPTION=libedit
+LIBEDIT_IS_UNICODE_DIR=${LIBEDIT_DIR}
+
+PBX_LIBEDIT_IS_UNICODE=0
+
+
+
+
+
+
+
LIBXML2_DESCRIP="LibXML2"
LIBXML2_OPTION="libxml2"
PBX_LIBXML2=0
@@ -20828,11 +20844,58 @@ fi
fi
if test "$PBX_LIBEDIT" = "1"; then
- LIBEDIT_INTERNAL="no"
+ LIBEDIT_INTERNAL="no"
fi
fi
if test "${LIBEDIT_INTERNAL}" = "yes"; then
PBX_LIBEDIT=1
+ LIBEDIT_IS_UNICODE=no
+ else
+
+ if test "x${PBX_LIBEDIT_IS_UNICODE}" != "x1" -a "${USE_LIBEDIT_IS_UNICODE}" != "no"; then
+ if test "xTesting for libedit unicode support" != "x"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Testing for libedit unicode support" >&5
+$as_echo_n "checking for Testing for libedit unicode support... " >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"el_rfunc_t *callback;\" compiles using histedit.h" >&5
+$as_echo_n "checking if \"el_rfunc_t *callback;\" compiles using histedit.h... " >&6; }
+ fi
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${LIBEDIT_IS_UNICODE_DIR}" != "x"; then
+ LIBEDIT_IS_UNICODE_INCLUDE="-I${LIBEDIT_IS_UNICODE_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${LIBEDIT_IS_UNICODE_INCLUDE}"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+ #include <histedit.h>
+int
+main ()
+{
+ el_rfunc_t *callback;;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ PBX_LIBEDIT_IS_UNICODE=1
+
+$as_echo "#define HAVE_LIBEDIT_IS_UNICODE 1" >>confdefs.h
+
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="${saved_cppflags}"
+ fi
+
fi
fi