Skip to content

Commit

Permalink
Merge tag 'kbuild-fixes-v4.19' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - make setlocalversion more robust about -dirty check

 - loosen the pkg-config requirement for Kconfig

 - change missing depmod to a warning from an error

 - warn modules_install when System.map is missing

* tag 'kbuild-fixes-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: modules_install: warn when missing System.map file
  kbuild: make missing $DEPMOD a Warning instead of an Error
  kconfig: do not require pkg-config on make {menu,n}config
  kconfig: remove a spurious self-assignment
  scripts/setlocalversion: git: Make -dirty check more robust
  • Loading branch information
torvalds committed Sep 9, 2018
2 parents f8f6538 + f0b0d88 commit 1d22577
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Documentation/process/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions scripts/depmod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ DEPMOD=$1
KERNELRELEASE=$2

if ! test -r System.map ; then
echo "Warning: modules_install: missing 'System.map' file. Skipping depmod." >&2
exit 0
fi

if [ -z $(command -v $DEPMOD) ]; then
echo "'make modules_install' requires $DEPMOD. Please install it." >&2
echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2
echo "This is probably in the kmod package." >&2
exit 1
exit 0
fi

# older versions of depmod require the version string to start with three
Expand Down
1 change: 0 additions & 1 deletion scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 0 additions & 8 deletions scripts/kconfig/check-pkgconfig.sh

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/kconfig/gconf-cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
25 changes: 14 additions & 11 deletions scripts/kconfig/mconf-cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@
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 [ -n "$(command -v pkg-config)" ]; then
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
if pkg-config --exists $PKG2; then
echo cflags=\"$(pkg-config --cflags $PKG2)\"
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\"
Expand Down
1 change: 0 additions & 1 deletion scripts/kconfig/mconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ static void build_conf(struct menu *menu)
switch (prop->type) {
case P_MENU:
child_count++;
prompt = prompt;
if (single_menu_mode) {
item_make("%s%*c%s",
menu->data ? "-->" : "++>",
Expand Down
25 changes: 14 additions & 11 deletions scripts/kconfig/nconf-cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@
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 [ -n "$(command -v pkg-config)" ]; then
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
if pkg-config --exists $PKG2; then
echo cflags=\"$(pkg-config --cflags $PKG2)\"
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 -lmenuw -lpanelw\"
Expand Down
7 changes: 7 additions & 0 deletions scripts/kconfig/qconf-cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
PKG="Qt5Core Qt5Gui Qt5Widgets"
PKG2="QtCore QtGui"

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

if pkg-config --exists $PKG; then
echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)\"
echo libs=\"$(pkg-config --libs $PKG)\"
Expand Down
2 changes: 1 addition & 1 deletion scripts/setlocalversion
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ scm_version()
fi

# Check for uncommitted changes
if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
if git status -uno --porcelain | grep -qv '^.. scripts/package'; then
printf '%s' -dirty
fi

Expand Down

0 comments on commit 1d22577

Please sign in to comment.