From patchwork Sat Jun 12 08:03:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 12316915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31BC4C48BCF for ; Sat, 12 Jun 2021 08:53:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB03761249 for ; Sat, 12 Jun 2021 08:53:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB03761249 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=weilnetz.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrzOX-0007s8-SV for qemu-devel@archiver.kernel.org; Sat, 12 Jun 2021 04:53:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrzMD-0005hF-T9 for qemu-devel@nongnu.org; Sat, 12 Jun 2021 04:51:09 -0400 Received: from p57b42637.dip0.t-ipconnect.de ([87.180.38.55]:55337 helo=mini.fritz.box) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrzMB-0007zo-2V for qemu-devel@nongnu.org; Sat, 12 Jun 2021 04:51:09 -0400 Received: by mini.fritz.box (Postfix, from userid 502) id 4C6A71223130; Sat, 12 Jun 2021 10:04:21 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org Subject: [PATCH] meson.build: Support ncurses on MacOS Date: Sat, 12 Jun 2021 10:03:58 +0200 Message-Id: <20210612080358.61176-1-sw@weilnetz.de> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Received-SPF: none client-ip=87.180.38.55; envelope-from=stefan@mini.fritz.box; helo=mini.fritz.box X-Spam_score_int: 21 X-Spam_score: 2.1 X-Spam_bar: ++ X-Spam_report: (2.1 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, KHOP_HELO_FCRDNS=0.398, NO_DNS_FOR_FROM=0.001, RCVD_IN_PBL=3.335, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Weil , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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é Signed-off-by: Stefan Weil --- 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])