-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kconfig: refactor ncurses package checks for building mconf and nconf
The mconf (or its infrastructure, lxdiaglog) depends on the ncurses. Move and rename check-lxdialog.sh to mconf-cfg.sh to make it work in the same way as for qconf and gconf. This commit fixes some more weirdnesses. The nconf also needs ncurses packages. HOSTLOADLIBES_nconf is set to the libraries needed for nconf, but the cflags is not explicitly set. Actually, nconf relies on the check-lxdialog.sh for the proper cflags: HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ -DLOCALE The code above passes the ncurses flags to all objects, even for conf, qconf, gconf. Let's pass the ncurses flags only to mconf and nconf. Currently, the presence of ncurses is not checked for nconf. Let's show a prompt like the mconf case. According to Randy's report, the shell scripts still need to carry the fallback code in case the pkg-config fails to find the ncurses packages. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
- Loading branch information
Masahiro Yamada
committed
May 28, 2018
1 parent
b464ef5
commit 1c5af5c
Showing
5 changed files
with
113 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
PKG="ncursesw" | ||
PKG2="ncurses" | ||
|
||
if pkg-config --exists $PKG; then | ||
echo cflags=\"$(pkg-config --cflags $PKG)\" | ||
echo libs=\"$(pkg-config --libs $PKG)\" | ||
exit 0 | ||
fi | ||
|
||
if pkg-config --exists $PKG2; then | ||
echo cflags=\"$(pkg-config --cflags $PKG2)\" | ||
echo libs=\"$(pkg-config --libs $PKG2)\" | ||
exit 0 | ||
fi | ||
|
||
# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses | ||
# by pkg-config. | ||
if [ -f /usr/include/ncursesw/ncurses.h ]; then | ||
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=\"-D_GNU_SOURCE -I/usr/include/ncurses\" | ||
echo libs=\"-lncurses\" | ||
exit 0 | ||
fi | ||
|
||
if [ -f /usr/include/ncurses.h ]; then | ||
echo cflags=\"-D_GNU_SOURCE\" | ||
echo libs=\"-lncurses\" | ||
exit 0 | ||
fi | ||
|
||
echo >&2 "*" | ||
echo >&2 "* Unable to find the ncurses package." | ||
echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev" | ||
echo >&2 "* depending on your distribution)." | ||
echo >&2 "*" | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
PKG="ncursesw menuw panelw" | ||
PKG2="ncurses menu panel" | ||
|
||
if pkg-config --exists $PKG; then | ||
echo cflags=\"$(pkg-config --cflags $PKG)\" | ||
echo libs=\"$(pkg-config --libs $PKG)\" | ||
exit 0 | ||
fi | ||
|
||
if pkg-config --exists $PKG2; then | ||
echo cflags=\"$(pkg-config --cflags $PKG2)\" | ||
echo libs=\"$(pkg-config --libs $PKG2)\" | ||
exit 0 | ||
fi | ||
|
||
# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses | ||
# by pkg-config. | ||
if [ -f /usr/include/ncursesw/ncurses.h ]; then | ||
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=\"-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 | ||
|
||
echo >&2 "*" | ||
echo >&2 "* Unable to find the ncurses package." | ||
echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev" | ||
echo >&2 "* depending on your distribution)." | ||
echo >&2 "*" | ||
exit 1 |