diff options
| author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-08-31 05:34:55 -0400 |
|---|---|---|
| committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-09-02 13:13:48 -0400 |
| commit | fd65465b7016dc6d9fa5c2f39cc706c231c9a089 (patch) | |
| tree | 56763fcfd78b59f7f8096a3616a34ef8fec30245 /scripts | |
| parent | bc8d2e20a3eb2f8d268ad7bbca878cf3acdcf389 (diff) | |
kconfig: do not require pkg-config on make {menu,n}config
Meelis Roos reported a {menu,n}config regression:
"I have libncurses devel package installed in the default system
location (as do 99%+ on actual developers probably) and in this
case, pkg-config is useless. pkg-config is needed only when
libraries and headers are installed in non-default locations but
it is bad to require installation of pkg-config on all the machines
where make menuconfig would be possibly run."
For {menu,n}config, do not use pkg-config if it is not installed.
For {g,x}config, keep checking pkg-config since we really rely on it
for finding the installation paths of the required packages.
Fixes: 4ab3b80159d4 ("kconfig: check for pkg-config on make {menu,n,g,x}config")
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Meelis Roos <mroos@linux.ee>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/kconfig/Makefile | 1 | ||||
| -rw-r--r-- | scripts/kconfig/check-pkgconfig.sh | 8 | ||||
| -rwxr-xr-x | scripts/kconfig/gconf-cfg.sh | 7 | ||||
| -rwxr-xr-x | scripts/kconfig/mconf-cfg.sh | 25 | ||||
| -rw-r--r-- | scripts/kconfig/nconf-cfg.sh | 25 | ||||
| -rwxr-xr-x | scripts/kconfig/qconf-cfg.sh | 7 |
6 files changed, 42 insertions, 31 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 4a7bd2192073..67ed9f6ccdf8 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
| @@ -221,7 +221,6 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c | |||
| 221 | 221 | ||
| 222 | # check if necessary packages are available, and configure build flags | 222 | # check if necessary packages are available, and configure build flags |
| 223 | define filechk_conf_cfg | 223 | define filechk_conf_cfg |
| 224 | $(CONFIG_SHELL) $(srctree)/scripts/kconfig/check-pkgconfig.sh; \ | ||
| 225 | $(CONFIG_SHELL) $< | 224 | $(CONFIG_SHELL) $< |
| 226 | endef | 225 | endef |
| 227 | 226 | ||
diff --git a/scripts/kconfig/check-pkgconfig.sh b/scripts/kconfig/check-pkgconfig.sh deleted file mode 100644 index 7a1c40bfb58c..000000000000 --- a/scripts/kconfig/check-pkgconfig.sh +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | # Check for pkg-config presence | ||
| 4 | |||
| 5 | if [ -z $(command -v pkg-config) ]; then | ||
| 6 | echo "'make *config' requires 'pkg-config'. Please install it." 1>&2 | ||
| 7 | exit 1 | ||
| 8 | fi | ||
diff --git a/scripts/kconfig/gconf-cfg.sh b/scripts/kconfig/gconf-cfg.sh index 533b3d8f8f08..480ecd8b9f41 100755 --- a/scripts/kconfig/gconf-cfg.sh +++ b/scripts/kconfig/gconf-cfg.sh | |||
| @@ -3,6 +3,13 @@ | |||
| 3 | 3 | ||
| 4 | PKG="gtk+-2.0 gmodule-2.0 libglade-2.0" | 4 | PKG="gtk+-2.0 gmodule-2.0 libglade-2.0" |
| 5 | 5 | ||
| 6 | if [ -z "$(command -v pkg-config)" ]; then | ||
| 7 | echo >&2 "*" | ||
| 8 | echo >&2 "* 'make gconfig' requires 'pkg-config'. Please install it." | ||
| 9 | echo >&2 "*" | ||
| 10 | exit 1 | ||
| 11 | fi | ||
| 12 | |||
| 6 | if ! pkg-config --exists $PKG; then | 13 | if ! pkg-config --exists $PKG; then |
| 7 | echo >&2 "*" | 14 | echo >&2 "*" |
| 8 | echo >&2 "* Unable to find the GTK+ installation. Please make sure that" | 15 | echo >&2 "* Unable to find the GTK+ installation. Please make sure that" |
diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh index e6f9facd0077..c812872d7f9d 100755 --- a/scripts/kconfig/mconf-cfg.sh +++ b/scripts/kconfig/mconf-cfg.sh | |||
| @@ -4,20 +4,23 @@ | |||
| 4 | PKG="ncursesw" | 4 | PKG="ncursesw" |
| 5 | PKG2="ncurses" | 5 | PKG2="ncurses" |
| 6 | 6 | ||
| 7 | if pkg-config --exists $PKG; then | 7 | if [ -n "$(command -v pkg-config)" ]; then |
| 8 | echo cflags=\"$(pkg-config --cflags $PKG)\" | 8 | if pkg-config --exists $PKG; then |
| 9 | echo libs=\"$(pkg-config --libs $PKG)\" | 9 | echo cflags=\"$(pkg-config --cflags $PKG)\" |
| 10 | exit 0 | 10 | echo libs=\"$(pkg-config --libs $PKG)\" |
| 11 | fi | 11 | exit 0 |
| 12 | fi | ||
| 12 | 13 | ||
| 13 | if pkg-config --exists $PKG2; then | 14 | if pkg-config --exists $PKG2; then |
| 14 | echo cflags=\"$(pkg-config --cflags $PKG2)\" | 15 | echo cflags=\"$(pkg-config --cflags $PKG2)\" |
| 15 | echo libs=\"$(pkg-config --libs $PKG2)\" | 16 | echo libs=\"$(pkg-config --libs $PKG2)\" |
| 16 | exit 0 | 17 | exit 0 |
| 18 | fi | ||
| 17 | fi | 19 | fi |
| 18 | 20 | ||
| 19 | # Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses | 21 | # Check the default paths in case pkg-config is not installed. |
| 20 | # by pkg-config. | 22 | # (Even if it is installed, some distributions such as openSUSE cannot |
| 23 | # find ncurses by pkg-config.) | ||
| 21 | if [ -f /usr/include/ncursesw/ncurses.h ]; then | 24 | if [ -f /usr/include/ncursesw/ncurses.h ]; then |
| 22 | echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" | 25 | echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" |
| 23 | echo libs=\"-lncursesw\" | 26 | echo libs=\"-lncursesw\" |
diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh index 42f5ac73548e..001559ef0a60 100644 --- a/scripts/kconfig/nconf-cfg.sh +++ b/scripts/kconfig/nconf-cfg.sh | |||
| @@ -4,20 +4,23 @@ | |||
| 4 | PKG="ncursesw menuw panelw" | 4 | PKG="ncursesw menuw panelw" |
| 5 | PKG2="ncurses menu panel" | 5 | PKG2="ncurses menu panel" |
| 6 | 6 | ||
| 7 | if pkg-config --exists $PKG; then | 7 | if [ -n "$(command -v pkg-config)" ]; then |
| 8 | echo cflags=\"$(pkg-config --cflags $PKG)\" | 8 | if pkg-config --exists $PKG; then |
| 9 | echo libs=\"$(pkg-config --libs $PKG)\" | 9 | echo cflags=\"$(pkg-config --cflags $PKG)\" |
| 10 | exit 0 | 10 | echo libs=\"$(pkg-config --libs $PKG)\" |
| 11 | fi | 11 | exit 0 |
| 12 | fi | ||
| 12 | 13 | ||
| 13 | if pkg-config --exists $PKG2; then | 14 | if pkg-config --exists $PKG2; then |
| 14 | echo cflags=\"$(pkg-config --cflags $PKG2)\" | 15 | echo cflags=\"$(pkg-config --cflags $PKG2)\" |
| 15 | echo libs=\"$(pkg-config --libs $PKG2)\" | 16 | echo libs=\"$(pkg-config --libs $PKG2)\" |
| 16 | exit 0 | 17 | exit 0 |
| 18 | fi | ||
| 17 | fi | 19 | fi |
| 18 | 20 | ||
| 19 | # Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses | 21 | # Check the default paths in case pkg-config is not installed. |
| 20 | # by pkg-config. | 22 | # (Even if it is installed, some distributions such as openSUSE cannot |
| 23 | # find ncurses by pkg-config.) | ||
| 21 | if [ -f /usr/include/ncursesw/ncurses.h ]; then | 24 | if [ -f /usr/include/ncursesw/ncurses.h ]; then |
| 22 | echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" | 25 | echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" |
| 23 | echo libs=\"-lncursesw -lmenuw -lpanelw\" | 26 | echo libs=\"-lncursesw -lmenuw -lpanelw\" |
diff --git a/scripts/kconfig/qconf-cfg.sh b/scripts/kconfig/qconf-cfg.sh index 0862e1562536..02ccc0ae1031 100755 --- a/scripts/kconfig/qconf-cfg.sh +++ b/scripts/kconfig/qconf-cfg.sh | |||
| @@ -4,6 +4,13 @@ | |||
| 4 | PKG="Qt5Core Qt5Gui Qt5Widgets" | 4 | PKG="Qt5Core Qt5Gui Qt5Widgets" |
| 5 | PKG2="QtCore QtGui" | 5 | PKG2="QtCore QtGui" |
| 6 | 6 | ||
| 7 | if [ -z "$(command -v pkg-config)" ]; then | ||
| 8 | echo >&2 "*" | ||
| 9 | echo >&2 "* 'make xconfig' requires 'pkg-config'. Please install it." | ||
| 10 | echo >&2 "*" | ||
| 11 | exit 1 | ||
| 12 | fi | ||
| 13 | |||
| 7 | if pkg-config --exists $PKG; then | 14 | if pkg-config --exists $PKG; then |
| 8 | echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)\" | 15 | echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)\" |
| 9 | echo libs=\"$(pkg-config --libs $PKG)\" | 16 | echo libs=\"$(pkg-config --libs $PKG)\" |
