Mike Frysinger | 20 Nov 2011 09:33
Picon
Favicon
Gravatar

[PATCH] uses ncursesw5-config by default

The ncurses package exports a ncursesw5-config script that lets you query
the library/compiler flags needed to build against it.  So let's use that
if it's available rather than hardcoding search paths.

Signed-off-by: Mike Frysinger <vapier <at> gentoo.org>
---
 configure.ac |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 987ca1a..1f61ae4 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -442,7 +442,15  <at>  <at>  if eval "test x$CURSES_LIB_NAME = x"; then
     AC_CHECK_HEADERS(ncurses.h)

     if test x$enable_utf8 != xno; then
-	AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CPPFLAGS="-I/usr/include/ncursesw
$CPPFLAGS" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
+	AC_CHECK_TOOL(NCURSESW_CONFIG, ncursesw5-config, no)
+	if test "x$NCURSESW_CONFIG" != xno; then
+	    CURSES_LIB=`$NCURSESW_CONFIG --libs`
+	    CPPFLAGS="`$NCURSESW_CONFIG --cflags` $CPPFLAGS"
+	    CURSES_LIB_NAME=ncursesw
+	    CURSES_LIB_WIDE=yes
+	else
+	    AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CPPFLAGS="-I/usr/include/ncursesw
$CPPFLAGS" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
+	fi
     fi
(Continue reading)


Gmane