[vlc-commits] ncurses: rewrite configure detection with pkg-config

Rémi Denis-Courmont git at videolan.org
Thu Aug 30 22:35:59 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 30 23:34:51 2012 +0300| [65d11fbb2ab3ca24a3df687b65b1837286d23329] | committer: Rémi Denis-Courmont

ncurses: rewrite configure detection with pkg-config

This makes sure that the correct header files are checked and used.
That is to say the ncursesw headers as opposed to ncurses.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=65d11fbb2ab3ca24a3df687b65b1837286d23329
---

 configure.ac |   28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0457fa0..5e3a588 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3795,26 +3795,18 @@ dnl  ncurses module
 dnl
 AC_ARG_ENABLE(ncurses,
 [AS_HELP_STRING([--disable-ncurses],[ncurses text-based interface (default auto)])])
-if test "${enable_ncurses}" != "no"; then
-  VLC_SAVE_FLAGS
-  LIBS=""
-  AC_CHECK_HEADER(ncurses.h, [
-    AC_CHECK_LIB(ncursesw, mvprintw, [
-      AC_SEARCH_LIBS([tgetent], [ncursesw tinfow tinfo], [
-        VLC_ADD_PLUGIN([ncurses])
-        ALIASES="${ALIASES} nvlc"
-        VLC_ADD_LIBS([ncurses],[-lncursesw ${LIBS}])
-      ], [
-        AS_IF([test "${enable_ncurses}" = "yes"], [AC_MSG_ERROR([tgetent not found])])
-      ])
-    ], [
-      AS_IF([test "${enable_ncurses}" = "yes"], [AC_MSG_ERROR([libncursesw not found])])
-    ])
+AS_IF([test "${enable_ncurses}" != "no"] ,[
+  PKG_CHECK_MODULES([NCURSES], [ncursesw], [
+    VLC_ADD_PLUGIN([ncurses])
+    VLC_ADD_CFLAGS([ncurses],[${NCURSES_CFLAGS}])
+    VLC_ADD_LIBS([ncurses],[${NCURSES_LIBS}])
+    ALIASES="${ALIASES} nvlc"
   ], [
-    AS_IF([test "${enable_ncurses}" = "yes"], [AC_MSG_ERROR([ncurses.h not found])])
+    AS_IF([test -n "${enable_ncurses}"], [
+      AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
+    ])
   ])
-  VLC_RESTORE_FLAGS
-fi
+])
 
 dnl
 dnl  Lirc plugin



More information about the vlc-commits mailing list