<p>Kevin Harwell <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9770">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Matthew Fredrickson: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BuildSystem: Enable ncurses for menuselect in Solaris 11.<br><br>The check for the library ncurses should use not use the header <curses.h> but<br><ncurses.h>, because on some platforms <curses.h> is not a drop-in replacement<br>for <ncurses.h>: For example in Solaris, the symbol initscr is a typedef in<br><curses.h> to a symbol which does not exist in the library ncurses (initscr32).<br>Simply use <ncurses.h> when you link to ncurses.<br><br>Furthermore in Solaris, the header <ncurses.h> is in a subdirectory<br>/usr/include/ncurses and not available via pkg-config.<br><br>ASTERISK-15331<br>ASTERISK-14935<br>ASTERISK-12382<br>ASTERISK-9107<br><br>Change-Id: Ife367776b0ccf17d3fefed868245376bfb93745d<br>---<br>M menuselect/Makefile<br>M menuselect/configure<br>M menuselect/configure.ac<br>M menuselect/makeopts.in<br>M menuselect/menuselect_curses.c<br>5 files changed, 223 insertions(+), 96 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/menuselect/Makefile b/menuselect/Makefile</span><br><span>index d949efd..da4a6c0 100644</span><br><span>--- a/menuselect/Makefile</span><br><span>+++ b/menuselect/Makefile</span><br><span>@@ -41,6 +41,10 @@</span><br><span> C_LIBS +=$(NCURSES_LIB)</span><br><span> C_INCLUDE += $(NCURSES_INCLUDE)</span><br><span> ALL_TGTS += cmenuselect</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS += -DHAVE_NCURSES</span><br><span style="color: hsl(120, 100%, 40%);">+ ifeq ($(HAVE_NCURSES_SUBDIR),yes)</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS += -DHAVE_NCURSES_SUBDIR</span><br><span style="color: hsl(120, 100%, 40%);">+ endif</span><br><span> else</span><br><span> ifdef CURSES_LIB</span><br><span> C_OBJS += menuselect_curses.o</span><br><span>diff --git a/menuselect/configure b/menuselect/configure</span><br><span>index 7cbe477..8efb637 100755</span><br><span>--- a/menuselect/configure</span><br><span>+++ b/menuselect/configure</span><br><span>@@ -634,6 +634,7 @@</span><br><span> PKG_CONFIG</span><br><span> CONFIG_LIBXML2</span><br><span> SED</span><br><span style="color: hsl(120, 100%, 40%);">+HAVE_NCURSES_SUBDIR</span><br><span> PBX_LIBXML2</span><br><span> LIBXML2_DIR</span><br><span> LIBXML2_INCLUDE</span><br><span>@@ -4012,6 +4013,201 @@</span><br><span> </span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+if test "x${PBX_NCURSES}" != "x1" -a "${USE_NCURSES}" != "no"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir=""</span><br><span style="color: hsl(120, 100%, 40%);">+ # if --with-NCURSES=DIR has been specified, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${NCURSES_DIR}" != "x"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -d ${NCURSES_DIR}/lib; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir="-L${NCURSES_DIR}/lib"</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir="-L${NCURSES_DIR}"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS="${CFLAGS} "</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo_n "checking for initscr in -lncurses... " >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+if ${ac_cv_lib_ncurses_initscr+:} false; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo_n "(cached) " >&6</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_check_lib_save_LIBS=$LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+LIBS="-lncurses ${pbxlibdir} $LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+cat confdefs.h - <<_ACEOF >conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+/* end confdefs.h. */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Override any GCC internal prototype to avoid an error.</span><br><span style="color: hsl(120, 100%, 40%);">+ Use char because int might match the return type of a GCC</span><br><span style="color: hsl(120, 100%, 40%);">+ builtin and then its argument prototype would still apply. */</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef __cplusplus</span><br><span style="color: hsl(120, 100%, 40%);">+extern "C"</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+char initscr ();</span><br><span style="color: hsl(120, 100%, 40%);">+int</span><br><span style="color: hsl(120, 100%, 40%);">+main ()</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+return initscr ();</span><br><span style="color: hsl(120, 100%, 40%);">+ ;</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+if ac_fn_c_try_link "$LINENO"; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_cv_lib_ncurses_initscr=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_cv_lib_ncurses_initscr=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+rm -f core conftest.err conftest.$ac_objext \</span><br><span style="color: hsl(120, 100%, 40%);">+ conftest$ac_exeext conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+LIBS=$ac_check_lib_save_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "$ac_cv_lib_ncurses_initscr" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_lib_ncurses_initscr" = xyes; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_NCURSES_FOUND=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_NCURSES_FOUND=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # now check for the header.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "${AST_NCURSES_FOUND}" = "yes"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_LIB="${pbxlibdir} -lncurses "</span><br><span style="color: hsl(120, 100%, 40%);">+ # if --with-NCURSES=DIR has been specified, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${NCURSES_DIR}" != "x"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_INCLUDE="-I${NCURSES_DIR}/include"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_INCLUDE="${NCURSES_INCLUDE} "</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # check for the header</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+ CPPFLAGS="${CPPFLAGS} ${NCURSES_INCLUDE}"</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_header_ncurses_h" = xyes; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_HEADER_FOUND=1</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_HEADER_FOUND=0</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${NCURSES_HEADER_FOUND}" = "x0" ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_LIB=""</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_INCLUDE=""</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_NCURSES=1</span><br><span style="color: hsl(120, 100%, 40%);">+ cat >>confdefs.h <<_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+#define HAVE_NCURSES 1</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test "${PBX_NCURSES}" != 1; then</span><br><span style="color: hsl(120, 100%, 40%);">+ # some platforms have the header in a sub-directory, for example Solaris</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x${PBX_NCURSES}" != "x1" -a "${USE_NCURSES}" != "no"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir=""</span><br><span style="color: hsl(120, 100%, 40%);">+ # if --with-NCURSES=DIR has been specified, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${NCURSES_DIR}" != "x"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -d ${NCURSES_DIR}/lib; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir="-L${NCURSES_DIR}/lib"</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir="-L${NCURSES_DIR}"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS="${CFLAGS} "</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo_n "checking for initscr in -lncurses... " >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+if ${ac_cv_lib_ncurses_initscr+:} false; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo_n "(cached) " >&6</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_check_lib_save_LIBS=$LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+LIBS="-lncurses ${pbxlibdir} $LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+cat confdefs.h - <<_ACEOF >conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+/* end confdefs.h. */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Override any GCC internal prototype to avoid an error.</span><br><span style="color: hsl(120, 100%, 40%);">+ Use char because int might match the return type of a GCC</span><br><span style="color: hsl(120, 100%, 40%);">+ builtin and then its argument prototype would still apply. */</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef __cplusplus</span><br><span style="color: hsl(120, 100%, 40%);">+extern "C"</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+char initscr ();</span><br><span style="color: hsl(120, 100%, 40%);">+int</span><br><span style="color: hsl(120, 100%, 40%);">+main ()</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+return initscr ();</span><br><span style="color: hsl(120, 100%, 40%);">+ ;</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+if ac_fn_c_try_link "$LINENO"; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_cv_lib_ncurses_initscr=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_cv_lib_ncurses_initscr=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+rm -f core conftest.err conftest.$ac_objext \</span><br><span style="color: hsl(120, 100%, 40%);">+ conftest$ac_exeext conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+LIBS=$ac_check_lib_save_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "$ac_cv_lib_ncurses_initscr" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_lib_ncurses_initscr" = xyes; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_NCURSES_FOUND=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_NCURSES_FOUND=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # now check for the header.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "${AST_NCURSES_FOUND}" = "yes"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_LIB="${pbxlibdir} -lncurses "</span><br><span style="color: hsl(120, 100%, 40%);">+ # if --with-NCURSES=DIR has been specified, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${NCURSES_DIR}" != "x"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_INCLUDE="-I${NCURSES_DIR}/include"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_INCLUDE="${NCURSES_INCLUDE} "</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # check for the header</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+ CPPFLAGS="${CPPFLAGS} ${NCURSES_INCLUDE}"</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default"</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_HEADER_FOUND=1</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_HEADER_FOUND=0</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${NCURSES_HEADER_FOUND}" = "x0" ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_LIB=""</span><br><span style="color: hsl(120, 100%, 40%);">+ NCURSES_INCLUDE=""</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_NCURSES=1</span><br><span style="color: hsl(120, 100%, 40%);">+ cat >>confdefs.h <<_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+#define HAVE_NCURSES 1</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "${PBX_NCURSES}" != 1; then</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if test "x${PBX_CURSES}" != "x1" -a "${USE_CURSES}" != "no"; then</span><br><span> pbxlibdir=""</span><br><span> # if --with-CURSES=DIR has been specified, use it.</span><br><span>@@ -4107,101 +4303,10 @@</span><br><span> fi</span><br><span> </span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-if test "x${PBX_NCURSES}" != "x1" -a "${USE_NCURSES}" != "no"; then</span><br><span style="color: hsl(0, 100%, 40%);">- pbxlibdir=""</span><br><span style="color: hsl(0, 100%, 40%);">- # if --with-NCURSES=DIR has been specified, use it.</span><br><span style="color: hsl(0, 100%, 40%);">- if test "x${NCURSES_DIR}" != "x"; then</span><br><span style="color: hsl(0, 100%, 40%);">- if test -d ${NCURSES_DIR}/lib; then</span><br><span style="color: hsl(0, 100%, 40%);">- pbxlibdir="-L${NCURSES_DIR}/lib"</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- pbxlibdir="-L${NCURSES_DIR}"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- ast_ext_lib_check_save_CFLAGS="${CFLAGS}"</span><br><span style="color: hsl(0, 100%, 40%);">- CFLAGS="${CFLAGS} "</span><br><span style="color: hsl(0, 100%, 40%);">- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5</span><br><span style="color: hsl(0, 100%, 40%);">-$as_echo_n "checking for initscr in -lncurses... " >&6; }</span><br><span style="color: hsl(0, 100%, 40%);">-if ${ac_cv_lib_ncurses_initscr+:} false; then :</span><br><span style="color: hsl(0, 100%, 40%);">- $as_echo_n "(cached) " >&6</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- ac_check_lib_save_LIBS=$LIBS</span><br><span style="color: hsl(0, 100%, 40%);">-LIBS="-lncurses ${pbxlibdir} $LIBS"</span><br><span style="color: hsl(0, 100%, 40%);">-cat confdefs.h - <<_ACEOF >conftest.$ac_ext</span><br><span style="color: hsl(0, 100%, 40%);">-/* end confdefs.h. */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/* Override any GCC internal prototype to avoid an error.</span><br><span style="color: hsl(0, 100%, 40%);">- Use char because int might match the return type of a GCC</span><br><span style="color: hsl(0, 100%, 40%);">- builtin and then its argument prototype would still apply. */</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef __cplusplus</span><br><span style="color: hsl(0, 100%, 40%);">-extern "C"</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-char initscr ();</span><br><span style="color: hsl(0, 100%, 40%);">-int</span><br><span style="color: hsl(0, 100%, 40%);">-main ()</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-return initscr ();</span><br><span style="color: hsl(0, 100%, 40%);">- ;</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-_ACEOF</span><br><span style="color: hsl(0, 100%, 40%);">-if ac_fn_c_try_link "$LINENO"; then :</span><br><span style="color: hsl(0, 100%, 40%);">- ac_cv_lib_ncurses_initscr=yes</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- ac_cv_lib_ncurses_initscr=no</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ HAVE_NCURSES_SUBDIR=yes</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span> fi</span><br><span style="color: hsl(0, 100%, 40%);">-rm -f core conftest.err conftest.$ac_objext \</span><br><span style="color: hsl(0, 100%, 40%);">- conftest$ac_exeext conftest.$ac_ext</span><br><span style="color: hsl(0, 100%, 40%);">-LIBS=$ac_check_lib_save_LIBS</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(0, 100%, 40%);">-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5</span><br><span style="color: hsl(0, 100%, 40%);">-$as_echo "$ac_cv_lib_ncurses_initscr" >&6; }</span><br><span style="color: hsl(0, 100%, 40%);">-if test "x$ac_cv_lib_ncurses_initscr" = xyes; then :</span><br><span style="color: hsl(0, 100%, 40%);">- AST_NCURSES_FOUND=yes</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- AST_NCURSES_FOUND=no</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- CFLAGS="${ast_ext_lib_check_save_CFLAGS}"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- # now check for the header.</span><br><span style="color: hsl(0, 100%, 40%);">- if test "${AST_NCURSES_FOUND}" = "yes"; then</span><br><span style="color: hsl(0, 100%, 40%);">- NCURSES_LIB="${pbxlibdir} -lncurses "</span><br><span style="color: hsl(0, 100%, 40%);">- # if --with-NCURSES=DIR has been specified, use it.</span><br><span style="color: hsl(0, 100%, 40%);">- if test "x${NCURSES_DIR}" != "x"; then</span><br><span style="color: hsl(0, 100%, 40%);">- NCURSES_INCLUDE="-I${NCURSES_DIR}/include"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- NCURSES_INCLUDE="${NCURSES_INCLUDE} "</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- # check for the header</span><br><span style="color: hsl(0, 100%, 40%);">- ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"</span><br><span style="color: hsl(0, 100%, 40%);">- CPPFLAGS="${CPPFLAGS} ${NCURSES_INCLUDE}"</span><br><span style="color: hsl(0, 100%, 40%);">- ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"</span><br><span style="color: hsl(0, 100%, 40%);">-if test "x$ac_cv_header_curses_h" = xyes; then :</span><br><span style="color: hsl(0, 100%, 40%);">- NCURSES_HEADER_FOUND=1</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- NCURSES_HEADER_FOUND=0</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if test "x${NCURSES_HEADER_FOUND}" = "x0" ; then</span><br><span style="color: hsl(0, 100%, 40%);">- NCURSES_LIB=""</span><br><span style="color: hsl(0, 100%, 40%);">- NCURSES_INCLUDE=""</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- PBX_NCURSES=1</span><br><span style="color: hsl(0, 100%, 40%);">- cat >>confdefs.h <<_ACEOF</span><br><span style="color: hsl(0, 100%, 40%);">-#define HAVE_NCURSES 1</span><br><span style="color: hsl(0, 100%, 40%);">-_ACEOF</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> </span><br><span> { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5</span><br><span> $as_echo_n "checking for a sed that does not truncate output... " >&6; }</span><br><span>diff --git a/menuselect/configure.ac b/menuselect/configure.ac</span><br><span>index 4a2d0ac..e2ae2cb 100644</span><br><span>--- a/menuselect/configure.ac</span><br><span>+++ b/menuselect/configure.ac</span><br><span>@@ -67,8 +67,17 @@</span><br><span> AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])</span><br><span> </span><br><span> AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])</span><br><span style="color: hsl(0, 100%, 40%);">-AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])</span><br><span style="color: hsl(0, 100%, 40%);">-AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])</span><br><span style="color: hsl(120, 100%, 40%);">+AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [ncurses.h])</span><br><span style="color: hsl(120, 100%, 40%);">+if test "${PBX_NCURSES}" != 1; then</span><br><span style="color: hsl(120, 100%, 40%);">+ # some platforms have the header in a sub-directory, for example Solaris</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [ncurses/ncurses.h])</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "${PBX_NCURSES}" != 1; then</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ HAVE_NCURSES_SUBDIR=yes</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+AC_SUBST(HAVE_NCURSES_SUBDIR)</span><br><span> AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , ,</span><br><span> [#include <libxml/tree.h></span><br><span> #include <libxml/parser.h>],</span><br><span>diff --git a/menuselect/makeopts.in b/menuselect/makeopts.in</span><br><span>index 495555d..efafbab 100644</span><br><span>--- a/menuselect/makeopts.in</span><br><span>+++ b/menuselect/makeopts.in</span><br><span>@@ -17,6 +17,7 @@</span><br><span> </span><br><span> NCURSES_INCLUDE=@NCURSES_INCLUDE@</span><br><span> NCURSES_LIB=@NCURSES_LIB@</span><br><span style="color: hsl(120, 100%, 40%);">+HAVE_NCURSES_SUBDIR=@HAVE_NCURSES_SUBDIR@</span><br><span> </span><br><span> NEWT_INCLUDE=@NEWT_INCLUDE@</span><br><span> NEWT_LIB=@NEWT_LIB@</span><br><span>diff --git a/menuselect/menuselect_curses.c b/menuselect/menuselect_curses.c</span><br><span>index 0917eba..fe42119 100644</span><br><span>--- a/menuselect/menuselect_curses.c</span><br><span>+++ b/menuselect/menuselect_curses.c</span><br><span>@@ -31,7 +31,15 @@</span><br><span> #include <string.h></span><br><span> #include <signal.h></span><br><span> #include <time.h></span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef HAVE_NCURSES</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef HAVE_NCURSES_SUBDIR</span><br><span style="color: hsl(120, 100%, 40%);">+#include <ncurses/ncurses.h></span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span style="color: hsl(120, 100%, 40%);">+#include <ncurses.h></span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span> #include <curses.h></span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> </span><br><span> #include "menuselect.h"</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9770">change 9770</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/9770"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ife367776b0ccf17d3fefed868245376bfb93745d </div>
<div style="display:none"> Gerrit-Change-Number: 9770 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-Reviewer: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Matthew Fredrickson <creslin@digium.com> </div>