Move ncurses check into libgnt directory.
--- a/gnt.h Fri Apr 27 04:49:22 2018 -0400
+++ b/gnt.h Fri Apr 27 05:38:28 2018 -0400
@@ -32,7 +32,7 @@
--- a/gntmain.c Fri Apr 27 04:49:22 2018 -0400
+++ b/gntmain.c Fri Apr 27 05:38:28 2018 -0400
@@ -25,8 +25,6 @@
#define _XOPEN_SOURCE_EXTENDED
--- a/gntutils.c Fri Apr 27 04:49:22 2018 -0400
+++ b/gntutils.c Fri Apr 27 05:38:28 2018 -0400
@@ -20,8 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
#define GNT_LOG_DOMAIN "Utils"
--- a/gntwm.c Fri Apr 27 04:49:22 2018 -0400
+++ b/gntwm.c Fri Apr 27 05:38:28 2018 -0400
@@ -20,7 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include "gntinternal.h" +#define GNT_LOG_DOMAIN "WM" @@ -44,10 +46,6 @@
-#include "gntinternal.h"
-#define GNT_LOG_DOMAIN "WM"
--- a/meson.build Fri Apr 27 04:49:22 2018 -0400
+++ b/meson.build Fri Apr 27 05:38:28 2018 -0400
@@ -1,3 +1,66 @@
+gnt_config = configuration_data() +####################################################################### +# Check for ncurses and other things used by the console UI +####################################################################### +ncurses_available = false +if get_option('consoleui') + ncurses_available = true + compiler.find_library('ncursesw', required : false), + compiler.find_library('panelw', required : false) + if not ncurses_libs[0].found() or not ncurses_libs[1].found() + ncurses_available = false + ncurses_sys_prefix = '/usr/$host/sys-root/mingw' + ncurses_sys_prefix = '/usr' + ncurses_sys_dirs = [ncurses_sys_prefix + '/include/ncursesw', + ncurses_sys_prefix + '/include'] + # Some distros put the headers in ncursesw/, some don't + found_ncurses_h = false + foreach location : ncurses_sys_dirs + f = location + '/ncurses.h' + if compiler.has_header_symbol(f, 'get_wch', + prefix : '#define _XOPEN_SOURCE_EXTENDED') + ncurses_inc += [include_directories(location)] + ncurses_available = false + # ncursesw was not found. Look for plain old ncurses + compiler.find_library('ncurses', required : false), + compiler.find_library('panel', required : false) + ncurses_available = ncurses_libs[0].found() and ncurses_libs[1].found() + gnt_config.set('NO_WIDECHAR', true) + ncurses = declare_dependency( + include_directories : ncurses_inc, + dependencies : ncurses_libs @@ -56,7 +119,14 @@
+# Check for Python headers +python_dep = dependency('python3') +gnt_config.set('USE_PYTHON', python_dep.found()) +configure_file(output : 'gntconfig.h', + configuration : gnt_config) install_headers(libgnt_headers, subdir : 'gnt')
@@ -99,4 +169,4 @@
-endif # enable_consoleui
+endif # ncurses_available