All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: qemu-devel@nongnu.org
Cc: "Stefan Weil" <sw@weilnetz.de>,
	"Daniel P . Berrangé" <berrange@redhat.com>
Subject: [PATCH] meson.build: Support ncurses on MacOS
Date: Sat, 12 Jun 2021 10:51:01 +0200	[thread overview]
Message-ID: <20210612085101.61304-1-sw@weilnetz.de> (raw)

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)



             reply	other threads:[~2021-06-12  8:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-12  8:51 Stefan Weil [this message]
  -- strict thread matches above, loose matches on Subject: below --
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é

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210612085101.61304-1-sw@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.