[vlc-devel] [PATCH] configure: only enable ncurses if wcswidth() can be used

Steve Lhomme robux4 at videolabs.io
Tue Feb 9 15:04:29 CET 2016


In MinGW the wchar.h that is used in the one defining Windows APIs,
ncurses tries to build even though it can't
---
 configure.ac | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/configure.ac b/configure.ac
index 344d93e..74cbb57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3950,12 +3950,20 @@ AC_ARG_ENABLE(ncurses,
 have_ncurses="no"
 AS_IF([test "${enable_ncurses}" != "no"] ,[
   PKG_CHECK_MODULES([NCURSES], [ncursesw], [
+   AC_CHECK_DECLS([wcswidth],[
     have_ncurses="yes"
     ALIASES="${ALIASES} nvlc"
   ], [
     AS_IF([test -n "${enable_ncurses}"], [
       AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
     ])
+  ], [
+#define _XOPEN_SOURCE 1
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <wchar.h>])  ], [
+    AS_IF([test -n "${enable_ncurses}"], [
+      AC_MSG_ERROR([${NCURSES_PKG_ERRORS}.])
+    ])
   ])
 ])
 AM_CONDITIONAL([HAVE_NCURSES], [test "${have_ncurses}" = "yes"])
-- 
2.7.0



More information about the vlc-devel mailing list