Skip to content

Commit 4ab3b80

Browse files
rddunlapmasahir0y
authored andcommitted
kconfig: check for pkg-config on make {menu,n,g,x}config
Each of 'make {menu,n,g,x}config' uses (needs) pkg-config to make sure that other required files are present and to determine build flags settings, but none of these check that pkg-config itself is present. Add a check for all 4 of these targets and update Documentation/process/changes.rst to mention 'pkg-config'. Fixes kernel bugzilla #77511: https://bugzilla.kernel.org/show_bug.cgi?id=77511 Signed-off-by: Randy Dunlap <[email protected]> Cc: Bjørn Forsman <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 9d3cce1 commit 4ab3b80

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

Documentation/process/changes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ The build system has, as of 4.13, switched to using thin archives (`ar T`)
8181
rather than incremental linking (`ld -r`) for built-in.a intermediate steps.
8282
This requires binutils 2.20 or newer.
8383

84+
pkg-config
85+
----------
86+
87+
The build system, as of 4.18, requires pkg-config to check for installed
88+
kconfig tools and to determine flags settings for use in
89+
'make {menu,n,g,x}config'. Previously pkg-config was being used but not
90+
verified or documented.
91+
8492
Flex
8593
----
8694

scripts/kconfig/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c
215215

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

scripts/kconfig/check-pkgconfig.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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

0 commit comments

Comments
 (0)