LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] fixup! kconfig: refactor ncurses package checks for building mconf and nconf
@ 2018-05-23  2:11 Masahiro Yamada
  2018-05-23  4:48 ` Sam Ravnborg
  2018-05-23 21:07 ` Randy Dunlap
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2018-05-23  2:11 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Ulf Magnusson, Randy Dunlap, Masahiro Yamada, linux-kernel

It is redundant to pass -DNCURSES_WIDECHAR=1 explicitly; when we use
'pkg-config --cflags', it takes care of appropriate flags.

Actually, 'pkg-config --cflags' will add -D_GNU_SOURCE, which will
define _XOPEN_SOURCE_EXTENDED, and NCURSES_WIDECHAR=1, anyway.

I added -D_GNU_SOURCE to follow the suggestion of pkg-config
for cases where pkg-config is not useful.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

The v3 (https://patchwork.kernel.org/patch/10417413/) was
reviewed and tested.

I'd like to squash this into it.


 scripts/kconfig/mconf-cfg.sh | 8 ++++----
 scripts/kconfig/nconf-cfg.sh | 7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh
index 1c2fe90..e6f9fac 100755
--- a/scripts/kconfig/mconf-cfg.sh
+++ b/scripts/kconfig/mconf-cfg.sh
@@ -5,7 +5,7 @@ PKG="ncursesw"
 PKG2="ncurses"
 
 if pkg-config --exists $PKG; then
-	echo cflags=\"-DNCURSES_WIDECHAR=1 $(pkg-config --cflags $PKG)\"
+	echo cflags=\"$(pkg-config --cflags $PKG)\"
 	echo libs=\"$(pkg-config --libs $PKG)\"
 	exit 0
 fi
@@ -19,19 +19,19 @@ fi
 # Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses
 # by pkg-config.
 if [ -f /usr/include/ncursesw/ncurses.h ]; then
-	echo cflags=\"-DNCURSES_WIDECHAR=1 -I/usr/include/ncursesw\"
+	echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\"
 	echo libs=\"-lncursesw\"
 	exit 0
 fi
 
 if [ -f /usr/include/ncurses/ncurses.h ]; then
-	echo cflags=\"-I/usr/include/ncurses\"
+	echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncurses\"
 	echo libs=\"-lncurses\"
 	exit 0
 fi
 
 if [ -f /usr/include/ncurses.h ]; then
-	echo cflags=\"\"
+	echo cflags=\"-D_GNU_SOURCE\"
 	echo libs=\"-lncurses\"
 	exit 0
 fi
diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh
index 4c95b4e..42f5ac7 100644
--- a/scripts/kconfig/nconf-cfg.sh
+++ b/scripts/kconfig/nconf-cfg.sh
@@ -5,7 +5,7 @@ PKG="ncursesw menuw panelw"
 PKG2="ncurses menu panel"
 
 if pkg-config --exists $PKG; then
-	echo cflags=\"-DNCURSES_WIDECHAR=1 $(pkg-config --cflags $PKG)\"
+	echo cflags=\"$(pkg-config --cflags $PKG)\"
 	echo libs=\"$(pkg-config --libs $PKG)\"
 	exit 0
 fi
@@ -19,18 +19,19 @@ fi
 # Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses
 # by pkg-config.
 if [ -f /usr/include/ncursesw/ncurses.h ]; then
-	echo cflags=\"-DNCURSES_WIDECHAR=1 -I/usr/include/ncursesw\"
+	echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\"
 	echo libs=\"-lncursesw -lmenuw -lpanelw\"
 	exit 0
 fi
 
 if [ -f /usr/include/ncurses/ncurses.h ]; then
-	echo cflags=\"-I/usr/include/ncurses\"
+	echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncurses\"
 	echo libs=\"-lncurses -lmenu -lpanel\"
 	exit 0
 fi
 
 if [ -f /usr/include/ncurses.h ]; then
+	echo cflags=\"-D_GNU_SOURCE\"
 	echo libs=\"-lncurses -lmenu -lpanel\"
 	exit 0
 fi
-- 
2.7.4

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

* Re: [PATCH] fixup! kconfig: refactor ncurses package checks for building mconf and nconf
  2018-05-23  2:11 [PATCH] fixup! kconfig: refactor ncurses package checks for building mconf and nconf Masahiro Yamada
@ 2018-05-23  4:48 ` Sam Ravnborg
  2018-05-23 21:07 ` Randy Dunlap
  1 sibling, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2018-05-23  4:48 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kbuild, Ulf Magnusson, Randy Dunlap, linux-kernel

On Wed, May 23, 2018 at 11:11:31AM +0900, Masahiro Yamada wrote:
> It is redundant to pass -DNCURSES_WIDECHAR=1 explicitly; when we use
> 'pkg-config --cflags', it takes care of appropriate flags.
> 
> Actually, 'pkg-config --cflags' will add -D_GNU_SOURCE, which will
> define _XOPEN_SOURCE_EXTENDED, and NCURSES_WIDECHAR=1, anyway.
> 
> I added -D_GNU_SOURCE to follow the suggestion of pkg-config
> for cases where pkg-config is not useful.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> The v3 (https://patchwork.kernel.org/patch/10417413/) was
> reviewed and tested.
> 
> I'd like to squash this into it.

Looks good.
Reviewed-off-by: Sam Ravnborg <sam@ravnborg.org>

	Sam

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

* Re: [PATCH] fixup! kconfig: refactor ncurses package checks for building mconf and nconf
  2018-05-23  2:11 [PATCH] fixup! kconfig: refactor ncurses package checks for building mconf and nconf Masahiro Yamada
  2018-05-23  4:48 ` Sam Ravnborg
@ 2018-05-23 21:07 ` Randy Dunlap
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2018-05-23 21:07 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: Sam Ravnborg, Ulf Magnusson, linux-kernel

On 05/22/2018 07:11 PM, Masahiro Yamada wrote:
> It is redundant to pass -DNCURSES_WIDECHAR=1 explicitly; when we use
> 'pkg-config --cflags', it takes care of appropriate flags.
> 
> Actually, 'pkg-config --cflags' will add -D_GNU_SOURCE, which will
> define _XOPEN_SOURCE_EXTENDED, and NCURSES_WIDECHAR=1, anyway.
> 
> I added -D_GNU_SOURCE to follow the suggestion of pkg-config
> for cases where pkg-config is not useful.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> The v3 (https://patchwork.kernel.org/patch/10417413/) was
> reviewed and tested.
> 
> I'd like to squash this into it.

Sure.  Works for me.  Thanks.

> 
> 
>  scripts/kconfig/mconf-cfg.sh | 8 ++++----
>  scripts/kconfig/nconf-cfg.sh | 7 ++++---
>  2 files changed, 8 insertions(+), 7 deletions(-)


-- 
~Randy

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

end of thread, other threads:[~2018-05-23 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23  2:11 [PATCH] fixup! kconfig: refactor ncurses package checks for building mconf and nconf Masahiro Yamada
2018-05-23  4:48 ` Sam Ravnborg
2018-05-23 21:07 ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).