History

kbuild: Allow kernel installation packaging to override pkg-config

Add HOSTPKG_CONFIG to allow tooling that builds the kernel to override what pkg-config and parameters are used.

Chun-Tse Shao committed 4 years ago

Commit d5ea4fe1 parent 9a227178 files · +37 −36Browse files

Showing the changes to scripts (5 of 8 files). Show all

Unified · Split

5 files
  1. scripts/Makefile +2 −2
  2. scripts/kconfig/gconf-cfg.sh +6 −6
  3. scripts/kconfig/mconf-cfg.sh +8 −8
  4. scripts/kconfig/nconf-cfg.sh +8 −8
  5. scripts/kconfig/qconf-cfg.sh +7 −7
scripts/Makefile+2−2
@@ -14,8 +14,8 @@ hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert · 13 unmodified lines
14HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include14HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
15HOSTLDLIBS_sorttable = -lpthread15HOSTLDLIBS_sorttable = -lpthread
16HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include16HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
17HOSTCFLAGS_sign-file.o = $(shell pkg-config --cflags libcrypto 2> /dev/null)17HOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null)
18HOSTLDLIBS_sign-file = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)18HOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
19 19
20ifdef CONFIG_UNWINDER_ORC20ifdef CONFIG_UNWINDER_ORC
21ifeq ($(ARCH),x86_64)21ifeq ($(ARCH),x86_64)
scripts/kconfig/gconf-cfg.sh+6−6
@@ -3,14 +3,14 @@ · 2 unmodified lines
3 3
4PKG="gtk+-2.0 gmodule-2.0 libglade-2.0"4PKG="gtk+-2.0 gmodule-2.0 libglade-2.0"
5 5
6if [ -z "$(command -v pkg-config)" ]; then6if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then
7 echo >&2 "*"7 echo >&2 "*"
8 echo >&2 "* 'make gconfig' requires 'pkg-config'. Please install it."8 echo >&2 "* 'make gconfig' requires '${HOSTPKG_CONFIG}'. Please install it."
9 echo >&2 "*"9 echo >&2 "*"
10 exit 110 exit 1
11fi11fi
12 12
13if ! pkg-config --exists $PKG; then13if ! ${HOSTPKG_CONFIG} --exists $PKG; then
14 echo >&2 "*"14 echo >&2 "*"
15 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"
16 echo >&2 "* the GTK+ 2.0 development package is correctly installed."16 echo >&2 "* the GTK+ 2.0 development package is correctly installed."
@@ -19,12 +19,12 @@ if ! pkg-config --exists $PKG; then · 2 unmodified lines
19 exit 119 exit 1
20fi20fi
21 21
22if ! pkg-config --atleast-version=2.0.0 gtk+-2.0; then22if ! ${HOSTPKG_CONFIG} --atleast-version=2.0.0 gtk+-2.0; then
23 echo >&2 "*"23 echo >&2 "*"
24 echo >&2 "* GTK+ is present but version >= 2.0.0 is required."24 echo >&2 "* GTK+ is present but version >= 2.0.0 is required."
25 echo >&2 "*"25 echo >&2 "*"
26 exit 126 exit 1
27fi27fi
28 28
29echo cflags=\"$(pkg-config --cflags $PKG)\"29echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\"
30echo libs=\"$(pkg-config --libs $PKG)\"30echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
scripts/kconfig/mconf-cfg.sh+8−8
@@ -4,16 +4,16 @@ · 3 unmodified lines
4PKG="ncursesw"4PKG="ncursesw"
5PKG2="ncurses"5PKG2="ncurses"
6 6
7if [ -n "$(command -v pkg-config)" ]; then7if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
8 if pkg-config --exists $PKG; then8 if ${HOSTPKG_CONFIG} --exists $PKG; then
9 echo cflags=\"$(pkg-config --cflags $PKG)\"9 echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\"
10 echo libs=\"$(pkg-config --libs $PKG)\"10 echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
11 exit 011 exit 0
12 fi12 fi
13 13
14 if pkg-config --exists $PKG2; then14 if ${HOSTPKG_CONFIG} --exists $PKG2; then
15 echo cflags=\"$(pkg-config --cflags $PKG2)\"15 echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG2)\"
16 echo libs=\"$(pkg-config --libs $PKG2)\"16 echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG2)\"
17 exit 017 exit 0
18 fi18 fi
19fi19fi
@@ -46,7 +46,7 @@ echo >&2 "* Unable to find the ncurses package." · 26 unmodified lines
46echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"46echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
47echo >&2 "* depending on your distribution)."47echo >&2 "* depending on your distribution)."
48echo >&2 "*"48echo >&2 "*"
49echo >&2 "* You may also need to install pkg-config to find the"49echo >&2 "* You may also need to install ${HOSTPKG_CONFIG} to find the"
50echo >&2 "* ncurses installed in a non-default location."50echo >&2 "* ncurses installed in a non-default location."
51echo >&2 "*"51echo >&2 "*"
52exit 152exit 1
scripts/kconfig/nconf-cfg.sh+8−8
@@ -4,16 +4,16 @@ · 3 unmodified lines
4PKG="ncursesw menuw panelw"4PKG="ncursesw menuw panelw"
5PKG2="ncurses menu panel"5PKG2="ncurses menu panel"
6 6
7if [ -n "$(command -v pkg-config)" ]; then7if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
8 if pkg-config --exists $PKG; then8 if ${HOSTPKG_CONFIG} --exists $PKG; then
9 echo cflags=\"$(pkg-config --cflags $PKG)\"9 echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\"
10 echo libs=\"$(pkg-config --libs $PKG)\"10 echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
11 exit 011 exit 0
12 fi12 fi
13 13
14 if pkg-config --exists $PKG2; then14 if ${HOSTPKG_CONFIG} --exists $PKG2; then
15 echo cflags=\"$(pkg-config --cflags $PKG2)\"15 echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG2)\"
16 echo libs=\"$(pkg-config --libs $PKG2)\"16 echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG2)\"
17 exit 017 exit 0
18 fi18 fi
19fi19fi
@@ -44,7 +44,7 @@ echo >&2 "* Unable to find the ncurses package." · 24 unmodified lines
44echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"44echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
45echo >&2 "* depending on your distribution)."45echo >&2 "* depending on your distribution)."
46echo >&2 "*"46echo >&2 "*"
47echo >&2 "* You may also need to install pkg-config to find the"47echo >&2 "* You may also need to install ${HOSTPKG_CONFIG} to find the"
48echo >&2 "* ncurses installed in a non-default location."48echo >&2 "* ncurses installed in a non-default location."
49echo >&2 "*"49echo >&2 "*"
50exit 150exit 1
scripts/kconfig/qconf-cfg.sh+7−7
@@ -3,22 +3,22 @@ · 2 unmodified lines
3 3
4PKG="Qt5Core Qt5Gui Qt5Widgets"4PKG="Qt5Core Qt5Gui Qt5Widgets"
5 5
6if [ -z "$(command -v pkg-config)" ]; then6if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then
7 echo >&2 "*"7 echo >&2 "*"
8 echo >&2 "* 'make xconfig' requires 'pkg-config'. Please install it."8 echo >&2 "* 'make xconfig' requires '${HOSTPKG_CONFIG}'. Please install it."
9 echo >&2 "*"9 echo >&2 "*"
10 exit 110 exit 1
11fi11fi
12 12
13if pkg-config --exists $PKG; then13if ${HOSTPKG_CONFIG} --exists $PKG; then
14 echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags $PKG)\"14 echo cflags=\"-std=c++11 -fPIC $(${HOSTPKG_CONFIG} --cflags $PKG)\"
15 echo libs=\"$(pkg-config --libs $PKG)\"15 echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
16 echo moc=\"$(pkg-config --variable=host_bins Qt5Core)/moc\"16 echo moc=\"$(${HOSTPKG_CONFIG} --variable=host_bins Qt5Core)/moc\"
17 exit 017 exit 0
18fi18fi
19 19
20echo >&2 "*"20echo >&2 "*"
21echo >&2 "* Could not find Qt5 via pkg-config."21echo >&2 "* Could not find Qt5 via ${HOSTPKG_CONFIG}."
22echo >&2 "* Please install Qt5 and make sure it's in PKG_CONFIG_PATH"22echo >&2 "* Please install Qt5 and make sure it's in PKG_CONFIG_PATH"
23echo >&2 "*"23echo >&2 "*"
24exit 124exit 1