All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] meson.build: Support ncurses on MacOS
@ 2021-06-12  8:03 Stefan Weil
  2021-06-13  1:40 ` Brad Smith
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Weil @ 2021-06-12  8:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, Daniel P . Berrangé

MacOS provides header files for curses 5.7 with support
for wide characters, but requires _XOPEN_SOURCE_EXTENDED=1
to activate that.

By default those old header files are used even if there
is a newer Homebrew installation of ncurses 6.2 available.

Change also the old macro definition of NCURSES_WIDECHAR
and set it to 1 like it is done in newer versions of
curses.h when _XOPEN_SOURCE_EXTENDED=1 is defined.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index d2a9ce91f5..3ca8faa264 100644
--- a/meson.build
+++ b/meson.build
@@ -606,7 +606,11 @@ if have_system and not get_option('curses').disabled()
     endif
   endforeach
   msg = get_option('curses').enabled() ? 'curses library not found' : ''
-  curses_compile_args = ['-DNCURSES_WIDECHAR']
+  if host_machine.system() == 'darwin'
+    curses_compile_args = [ '-D_XOPEN_SOURCE_EXTENDED=1']
+  else
+    curses_compile_args = ['-DNCURSES_WIDECHAR=1']
+  endif
   if curses.found()
     if cc.links(curses_test, args: curses_compile_args, dependencies: [curses])
       curses = declare_dependency(compile_args: curses_compile_args, dependencies: [curses])
-- 
2.30.1 (Apple Git-130)



^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] meson.build: Support ncurses on MacOS
@ 2021-06-12  8:51 Stefan Weil
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Weil @ 2021-06-12  8:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, Daniel P . Berrangé

MacOS provides header files for curses 5.7 with support
for wide characters, but requires _XOPEN_SOURCE_EXTENDED=1
to activate that.

By default those old header files are used even if there
is a newer Homebrew installation of ncurses 6.2 available.

Change also the old macro definition of NCURSES_WIDECHAR
and set it to 1 like it is done in newer versions of
curses.h when _XOPEN_SOURCE_EXTENDED=1 is defined.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index d2a9ce91f5..3ca8faa264 100644
--- a/meson.build
+++ b/meson.build
@@ -606,7 +606,11 @@ if have_system and not get_option('curses').disabled()
     endif
   endforeach
   msg = get_option('curses').enabled() ? 'curses library not found' : ''
-  curses_compile_args = ['-DNCURSES_WIDECHAR']
+  if host_machine.system() == 'darwin'
+    curses_compile_args = [ '-D_XOPEN_SOURCE_EXTENDED=1']
+  else
+    curses_compile_args = ['-DNCURSES_WIDECHAR=1']
+  endif
   if curses.found()
     if cc.links(curses_test, args: curses_compile_args, dependencies: [curses])
       curses = declare_dependency(compile_args: curses_compile_args, dependencies: [curses])
-- 
2.30.1 (Apple Git-130)



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-09 18:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12  8:03 [PATCH] meson.build: Support ncurses on MacOS Stefan Weil
2021-06-13  1:40 ` Brad Smith
2021-06-13  6:33   ` Stefan Weil
2021-06-14  5:45     ` Philippe Mathieu-Daudé
2021-06-15  1:53       ` Brad Smith
2021-11-09 17:49         ` Stefan Weil
2021-11-09 18:30           ` Daniel P. Berrangé
2021-06-12  8:51 Stefan Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.