From patchwork Fri Jun 2 14:35:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 101275 Delivered-To: patches@linaro.org Received: by 10.182.202.35 with SMTP id kf3csp223329obc; Fri, 2 Jun 2017 07:35:43 -0700 (PDT) X-Received: by 10.28.193.198 with SMTP id r189mr3361514wmf.82.1496414142911; Fri, 02 Jun 2017 07:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496414142; cv=none; d=google.com; s=arc-20160816; b=tokbhG23IT7O9KEtc2ndgSscU9H0J4GD8fbEPUUSAAAuxCAvuBtcKosWqhGPadN+ZO IEG1wMvxAVEbENkuFtlYHiVO8lR8fc7dEqAYyM2hCHKvVq41Kmgv3KEVXLQy0f4i52Ss nX1mhs9u6LYkPXfYqGZAFJB7zFQtVriQH5UWDopCJBHnQ2vFreccA3q0F6sz8EpLfZfq RXwuDhh7r7I/L3mP5uN5fXI1n+1eosstcrpT/BYUJqJUbnJr5Tn2vIPnNZYmm7qETiuj 9zZLy84Lp6lJmo6uH7TGOdrzgAQhYNhugVJhiiQlbk4tarxYMPlGDCbzCVvUG4FJWUwq qPRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=j+lN85ThAKK+1bbVsNNLu3qTRPnHE3pbYSJV8NEAkKU=; b=kKUITTp4QkPLS3qLbvr3AS8ZOe9kP0zMa5ZILUcoJ5dj0fl0CcSV55rxpTulp08rsB CUbxfPYcZI5ayBiLljLijseTXIUm5TrQxMa63LemvXllt4/v+7yysd+cKBxUA8gd1ygi 9JeW40wqs9u1ylIF6i9Af5Sl/tj/nOxSRZst+TQrTGU3Q5nkQjirnNXfuikzQD+RpKdE jF3ZtF+A7twmh4hbPDrCS+goNjkGKJ8REa2zWABOqHnkXGuMVGqWhyMUs/Kr2niCLTnN gfCv14wxIjhds0EsDQDdPKSxLnULavwRNvh/napQ2oOy1qMAlPczvAEi6xTkLYVsusAh Ui4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id h46si3638073wrh.65.2017.06.02.07.35.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jun 2017 07:35:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dGnfw-0008QA-87; Fri, 02 Jun 2017 15:35:40 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Chad Joan , Paolo Bonzini , Laszlo Ersek , =?utf-8?q?Rainer_M=C3=BCller?= Subject: [PATCH] configure: Define NCURSES_WIDECHAR if we're using curses Date: Fri, 2 Jun 2017 15:35:38 +0100 Message-Id: <1496414138-7622-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 We want the wide character functions from the ncurses header. Unfortunately it doesn't provide them by default, but only if either: * NCURSES_WIDECHAR is defined (for ncurses 20111030 and up) * _XOPEN_SOURCE/_XOPEN_SOURCE_EXTENDED are suitably defined So far we have been implicitly relying on the latter, because for GNU libc when we define _GNU_SOURCE this causes libc to define the _XOPEN_SOURCE macros for us. Unfortunately this doesn't work on all libcs, because some (like OSX and musl libc) do not define _XOPEN_SOURCE when _GNU_SOURCE is defined. We can't fix this by defining _XOPEN_SOURCE ourselves, because that also means "and don't provide any functions that aren't in that standard", and not all libcs provide any way to override that to also get the non-standard functions. In particular FreeBSD has no such mechanism, and OSX's _DARWIN_C_SOURCE doesn't reenable everything (for instance getpagesize() is still not prototyped if _DARWIN_C_SOURCE and _XOPEN_SOURCE are both defined). So we have to define NCURSES_WIDECHAR. (This will only work if your ncurses is at least 20111030, as older versions don't honour this macro.) Signed-off-by: Peter Maydell --- Testing from the people with musl libc and OSX-with-ncurses appreciated, as I don't have any systems which have the bug which this patch is attempting to fix... configure | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 Acked-by: Laszlo Ersek diff --git a/configure b/configure index 0586ec9..6aca5d1 100755 --- a/configure +++ b/configure @@ -3053,6 +3053,8 @@ int main(void) { EOF IFS=: for curses_inc in $curses_inc_list; do + # Make sure we get the wide character prototypes + curses_inc="-DNCURSES_WIDECHAR $curses_inc" IFS=: for curses_lib in $curses_lib_list; do unset IFS