From patchwork Thu Aug 24 03:58:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 805227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xd9XD4gMDz9t3C for ; Thu, 24 Aug 2017 13:59:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 66078890C9; Thu, 24 Aug 2017 03:59:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mO9McGfAFKkg; Thu, 24 Aug 2017 03:59:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 8814D890CB; Thu, 24 Aug 2017 03:59:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 12D4B1C411E for ; Thu, 24 Aug 2017 03:58:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0E2E18835F for ; Thu, 24 Aug 2017 03:58:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kacB6IKWe5q1 for ; Thu, 24 Aug 2017 03:58:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by fraxinus.osuosl.org (Postfix) with ESMTPS id F2C158835E for ; Thu, 24 Aug 2017 03:58:50 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id 3ACAB14D18EE; Thu, 24 Aug 2017 00:55:28 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id 2C0EC14C24CB; Thu, 24 Aug 2017 00:55:28 -0300 (BRT) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eABWKVmdQCvp; Thu, 24 Aug 2017 00:55:28 -0300 (BRT) Received: from p7-1130br.casantos.org (unknown [177.97.77.129]) by mail.datacom.ind.br (Postfix) with ESMTPSA id B1F7914D192A; Thu, 24 Aug 2017 00:55:27 -0300 (BRT) From: Carlos Santos To: buildroot@buildroot.org Date: Thu, 24 Aug 2017 00:58:38 -0300 Message-Id: <20170824035838.14466-2-casantos@datacom.ind.br> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170824035838.14466-1-casantos@datacom.ind.br> References: <20170823154252.03f70fea@windsurf> <20170824035838.14466-1-casantos@datacom.ind.br> Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH 2/2] util-linux: use a patch from upstream to fix ncursesw support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch is much smaller the the previous one and will unlikely cause a conflict with some forthcoming 2.30.x release. Signed-off-by: Carlos Santos --- ...-Revert-build-sys-ncurses-headers-cleanup.patch | 191 --------------------- ...upport-ncursesw-without-headers-in-ncurse.patch | 58 +++++++ 2 files changed, 58 insertions(+), 191 deletions(-) delete mode 100644 package/util-linux/0001-Revert-build-sys-ncurses-headers-cleanup.patch create mode 100644 package/util-linux/0001-build-sys-support-ncursesw-without-headers-in-ncurse.patch diff --git a/package/util-linux/0001-Revert-build-sys-ncurses-headers-cleanup.patch b/package/util-linux/0001-Revert-build-sys-ncurses-headers-cleanup.patch deleted file mode 100644 index a344ee9035..0000000000 --- a/package/util-linux/0001-Revert-build-sys-ncurses-headers-cleanup.patch +++ /dev/null @@ -1,191 +0,0 @@ -From 51157b7416cd9d09cb21ee8cebf5750b48f44201 Mon Sep 17 00:00:00 2001 -From: Carlos Santos -Date: Thu, 22 Jun 2017 20:53:55 -0300 -Subject: [PATCH] Revert "build-sys: ncurses headers cleanup" - -This reverts commit 3947ca4ca9737d830f54658ef353f5626c0d0282. ---- - configure.ac | 8 +++++--- - lib/colors.c | 15 ++++----------- - misc-utils/cal.c | 8 ++++---- - term-utils/setterm.c | 8 ++++---- - text-utils/more.c | 8 ++++---- - text-utils/pg.c | 16 +++++++++------- - text-utils/ul.c | 8 ++++---- - 7 files changed, 34 insertions(+), 37 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 53d25b8ab..3512162df 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -803,8 +803,9 @@ have_ncursesw_header=no - AS_IF([test "x$with_ncursesw" != xno], [ - UL_NCURSES_CHECK([ncursesw]) - AS_IF([test "x$have_ncursesw" = xyes], [ -- AC_CHECK_HEADERS([ncursesw/ncurses.h], [have_ncursesw_header=yes]) -- AC_CHECK_HEADERS([ncursesw/term.h]) -+ AC_CHECK_HEADERS([ncursesw/ncurses.h ncurses.h], -+ [have_ncursesw_header=yes]) -+ AC_CHECK_HEADERS([ncursesw/term.h term.h]) - AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no]) - ]) - AS_IF([test "x$have_ncursesw" = xyes], [ -@@ -829,7 +830,8 @@ AS_CASE([$with_ncurses:$build_widechar], - AS_IF([test "x$have_ncursesw" = xno -a "x$with_ncurses" != xno ], [ - UL_NCURSES_CHECK([ncurses]) - AS_IF([test "x$have_ncurses" = xyes], [ -- AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h], [have_ncurses_header=yes]) -+ AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h], -+ [have_ncurses_header=yes]) - AC_CHECK_HEADERS([ncurses/term.h term.h]) - AS_IF([test "x$have_ncurses_header" = xno], [have_ncurses=no]) - ]) -diff --git a/lib/colors.c b/lib/colors.c -index f82496d7a..72c5158cb 100644 ---- a/lib/colors.c -+++ b/lib/colors.c -@@ -12,19 +12,12 @@ - #include - - #if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW) --# if defined(HAVE_NCURSESW_NCURSES_H) --# include --# elif defined(HAVE_NCURSES_NCURSES_H) --# include --# elif defined(HAVE_NCURSES_H) --# include --# endif --# if defined(HAVE_NCURSESW_TERM_H) --# include -+# ifdef HAVE_TERM_H -+# include - # elif defined(HAVE_NCURSES_TERM_H) - # include --# elif defined(HAVE_TERM_H) --# include -+# elif defined(HAVE_NCURSESW_TERM_H) -+# include - # endif - #endif - -diff --git a/misc-utils/cal.c b/misc-utils/cal.c -index 604eb26a7..2b16979db 100644 ---- a/misc-utils/cal.c -+++ b/misc-utils/cal.c -@@ -80,12 +80,12 @@ static int has_term = 0; - static const char *Senter = "", *Sexit = ""; /* enter and exit standout mode */ - - #if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW) --# if defined(HAVE_NCURSESW_TERM_H) --# include -+# ifdef HAVE_TERM_H -+# include - # elif defined(HAVE_NCURSES_TERM_H) - # include --# elif defined(HAVE_TERM_H) --# include -+# elif defined(HAVE_NCURSESW_TERM_H) -+# include - # endif - #endif - -diff --git a/term-utils/setterm.c b/term-utils/setterm.c -index 9f60e5693..53826f954 100644 ---- a/term-utils/setterm.c -+++ b/term-utils/setterm.c -@@ -60,12 +60,12 @@ - #include - #include - --#if defined(HAVE_NCURSESW_TERM_H) --# include -+#ifdef HAVE_TERM_H -+# include - #elif defined(HAVE_NCURSES_TERM_H) - # include --#elif defined(HAVE_TERM_H) --# include -+#elif defined(HAVE_NCURSESW_TERM_H) -+# include - #endif - - #ifdef HAVE_LINUX_TIOCL_H -diff --git a/text-utils/more.c b/text-utils/more.c -index 72dd96bf4..cc53075f6 100644 ---- a/text-utils/more.c -+++ b/text-utils/more.c -@@ -190,12 +190,12 @@ static struct { - } context, screen_start; - extern char PC; /* pad character */ - --#if defined(HAVE_NCURSESW_TERM_H) --# include -+#ifdef HAVE_TERM_H -+# include - #elif defined(HAVE_NCURSES_TERM_H) - # include --#elif defined(HAVE_TERM_H) --# include -+#elif defined(HAVE_NCURSESW_TERM_H) -+# include - #endif - - #define TERM_AUTO_RIGHT_MARGIN "am" -diff --git a/text-utils/pg.c b/text-utils/pg.c -index 1b9b8d7dd..bc485e2fe 100644 ---- a/text-utils/pg.c -+++ b/text-utils/pg.c -@@ -59,20 +59,22 @@ - #include - #include - --#if defined(HAVE_NCURSESW_NCURSES_H) -+#ifdef HAVE_NCURSESW_H -+# include -+#elif defined(HAVE_NCURSES_H) -+# include -+#elif defined(HAVE_NCURSESW_NCURSES_H) - # include - #elif defined(HAVE_NCURSES_NCURSES_H) - # include --#elif defined(HAVE_NCURSES_H) --# include - #endif - --#if defined(HAVE_NCURSESW_TERM_H) --# include -+#ifdef HAVE_TERM_H -+# include - #elif defined(HAVE_NCURSES_TERM_H) - # include --#elif defined(HAVE_TERM_H) --# include -+#elif defined(HAVE_NCURSESW_TERM_H) -+# include - #endif - - #include "nls.h" -diff --git a/text-utils/ul.c b/text-utils/ul.c -index 3986b4206..3d1518cea 100644 ---- a/text-utils/ul.c -+++ b/text-utils/ul.c -@@ -49,12 +49,12 @@ - #include - #include - --#if defined(HAVE_NCURSESW_TERM_H) --# include -+#ifdef HAVE_TERM_H -+# include - #elif defined(HAVE_NCURSES_TERM_H) - # include --#elif defined(HAVE_TERM_H) --# include -+#elif defined(HAVE_NCURSESW_TERM_H) -+# include - #endif - - #include "nls.h" --- -2.11.0 - diff --git a/package/util-linux/0001-build-sys-support-ncursesw-without-headers-in-ncurse.patch b/package/util-linux/0001-build-sys-support-ncursesw-without-headers-in-ncurse.patch new file mode 100644 index 0000000000..062ac6725b --- /dev/null +++ b/package/util-linux/0001-build-sys-support-ncursesw-without-headers-in-ncurse.patch @@ -0,0 +1,58 @@ +From 87c26ce5b689abe1b52181f98ef3c9eb1b1a5165 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 1 Aug 2017 14:36:25 +0200 +Subject: [PATCH] build-sys: support ncursesw without headers in ncursesw/ + directory + +Let's check always for alone ncurses.h and term.h if the preferred +variant with ncursesw/ subdirectory is not available. + +The patch also minimize number of HAVE_...NCURSES_H macros in +config.h. We don't need to check for ncurses.h if ncurses/ncurses.h is +available. + +Reported-by: Carlos Santos +Signed-off-by: Karel Zak +--- + configure.ac | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b204ec11e..592bd587e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -810,6 +810,13 @@ AS_IF([test "x$with_ncursesw" != xno], [ + AS_IF([test "x$have_ncursesw" = xyes], [ + AC_CHECK_HEADERS([ncursesw/ncurses.h], [have_ncursesw_header=yes]) + AC_CHECK_HEADERS([ncursesw/term.h]) ++ ++ # Define HAVE_NCURSES_H only if check for HAVE_NCURSESW_NCURSES_H is ++ # unsuccessful to avoid too many *_H permitations in config.h ++ AS_IF([test "x$have_ncursesw_header" = xno], [ ++ AC_CHECK_HEADERS([ncurses.h], [have_ncursesw_header=yes]) ++ AC_CHECK_HEADERS([term.h]) ++ ]) + AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no]) + ]) + AS_IF([test "x$have_ncursesw" = xyes], [ +@@ -834,8 +841,15 @@ AS_CASE([$with_ncurses:$build_widechar], + AS_IF([test "x$have_ncursesw" = xno -a "x$with_ncurses" != xno ], [ + UL_NCURSES_CHECK([ncurses]) + AS_IF([test "x$have_ncurses" = xyes], [ +- AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h], [have_ncurses_header=yes]) +- AC_CHECK_HEADERS([ncurses/term.h term.h]) ++ AC_CHECK_HEADERS([ncurses/ncurses.h], [have_ncurses_header=yes]) ++ AC_CHECK_HEADERS([ncurses/term.h]) ++ ++ # Define HAVE_NCURSES_H only if check for HAVE_NCURSES_NCURSES_H is ++ # unsuccessful to avoid too many *_H permitations in config.h ++ AS_IF([test "x$have_ncurses_header" = xno], [ ++ AC_CHECK_HEADERS([ncurses.h], [have_ncurses_header=yes]) ++ AC_CHECK_HEADERS([term.h]) ++ ]) + AS_IF([test "x$have_ncurses_header" = xno], [have_ncurses=no]) + ]) + AS_IF([test "x$have_ncurses" = xyes], [ +-- +2.13.5 +