Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd65465b authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

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: 4ab3b801 ("kconfig: check for pkg-config on make {menu,n,g,x}config")
Reported-by: default avatarMeelis Roos <mroos@linux.ee>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: default avatarMeelis Roos <mroos@linux.ee>
Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
parent bc8d2e20
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ pkg-config

The build system, as of 4.18, requires pkg-config to check for installed
kconfig tools and to determine flags settings for use in
'make {menu,n,g,x}config'.  Previously pkg-config was being used but not
'make {g,x}config'.  Previously pkg-config was being used but not
verified or documented.

Flex
+0 −1
Original line number Diff line number Diff line
@@ -221,7 +221,6 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c

# check if necessary packages are available, and configure build flags
define filechk_conf_cfg
	$(CONFIG_SHELL) $(srctree)/scripts/kconfig/check-pkgconfig.sh; \
	$(CONFIG_SHELL) $<
endef

+0 −8
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Check for pkg-config presence

if [ -z $(command -v pkg-config) ]; then
	echo "'make *config' requires 'pkg-config'. Please install it." 1>&2
	exit 1
fi
+7 −0
Original line number Diff line number Diff line
@@ -3,6 +3,13 @@

PKG="gtk+-2.0 gmodule-2.0 libglade-2.0"

if [ -z "$(command -v pkg-config)" ]; then
	echo >&2 "*"
	echo >&2 "* 'make gconfig' requires 'pkg-config'. Please install it."
	echo >&2 "*"
	exit 1
fi

if ! pkg-config --exists $PKG; then
	echo >&2 "*"
	echo >&2 "* Unable to find the GTK+ installation. Please make sure that"
+14 −11
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
PKG="ncursesw"
PKG2="ncurses"

if [ -n "$(command -v pkg-config)" ]; then
	if pkg-config --exists $PKG; then
		echo cflags=\"$(pkg-config --cflags $PKG)\"
		echo libs=\"$(pkg-config --libs $PKG)\"
@@ -15,9 +16,11 @@ if pkg-config --exists $PKG2; then
		echo libs=\"$(pkg-config --libs $PKG2)\"
		exit 0
	fi
fi

# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses
# by pkg-config.
# Check the default paths in case pkg-config is not installed.
# (Even if it is installed, some distributions such as 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\"
Loading