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
1414 HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
1515 HOSTLDLIBS_sorttable = -lpthread
1616 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
17−HOSTCFLAGS_sign-file.o = $(shell pkg-config --cflags libcrypto 2> /dev/null)
18−HOSTLDLIBS_sign-file = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
17+HOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null)
18+HOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto)
1919
2020 ifdef CONFIG_UNWINDER_ORC
2121 ifeq ($(ARCH),x86_64)
scripts/kconfig/gconf-cfg.sh+6−6
@@ -3,14 +3,14 @@ · 2 unmodified lines
33
44 PKG="gtk+-2.0 gmodule-2.0 libglade-2.0"
55
6−if [ -z "$(command -v pkg-config)" ]; then
6+if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then
77 echo >&2 "*"
8− echo >&2 "* 'make gconfig' requires 'pkg-config'. Please install it."
8+ echo >&2 "* 'make gconfig' requires '${HOSTPKG_CONFIG}'. Please install it."
99 echo >&2 "*"
1010 exit 1
1111 fi
1212
13−if ! pkg-config --exists $PKG; then
13+if ! ${HOSTPKG_CONFIG} --exists $PKG; then
1414 echo >&2 "*"
1515 echo >&2 "* Unable to find the GTK+ installation. Please make sure that"
1616 echo >&2 "* the GTK+ 2.0 development package is correctly installed."
@@ -19,12 +19,12 @@ if ! pkg-config --exists $PKG; then · 2 unmodified lines
1919 exit 1
2020 fi
2121
22−if ! pkg-config --atleast-version=2.0.0 gtk+-2.0; then
22+if ! ${HOSTPKG_CONFIG} --atleast-version=2.0.0 gtk+-2.0; then
2323 echo >&2 "*"
2424 echo >&2 "* GTK+ is present but version >= 2.0.0 is required."
2525 echo >&2 "*"
2626 exit 1
2727 fi
2828
29−echo cflags=\"$(pkg-config --cflags $PKG)\"
30−echo libs=\"$(pkg-config --libs $PKG)\"
29+echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\"
30+echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
scripts/kconfig/mconf-cfg.sh+8−8
@@ -4,16 +4,16 @@ · 3 unmodified lines
44 PKG="ncursesw"
55 PKG2="ncurses"
66
7−if [ -n "$(command -v pkg-config)" ]; then
8− if pkg-config --exists $PKG; then
9− echo cflags=\"$(pkg-config --cflags $PKG)\"
10− echo libs=\"$(pkg-config --libs $PKG)\"
7+if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
8+ if ${HOSTPKG_CONFIG} --exists $PKG; then
9+ echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\"
10+ echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
1111 exit 0
1212 fi
1313
14− if pkg-config --exists $PKG2; then
15− echo cflags=\"$(pkg-config --cflags $PKG2)\"
16− echo libs=\"$(pkg-config --libs $PKG2)\"
14+ if ${HOSTPKG_CONFIG} --exists $PKG2; then
15+ echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG2)\"
16+ echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG2)\"
1717 exit 0
1818 fi
1919 fi
@@ -46,7 +46,7 @@ echo >&2 "* Unable to find the ncurses package." · 26 unmodified lines
4646 echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
4747 echo >&2 "* depending on your distribution)."
4848 echo >&2 "*"
49−echo >&2 "* You may also need to install pkg-config to find the"
49+echo >&2 "* You may also need to install ${HOSTPKG_CONFIG} to find the"
5050 echo >&2 "* ncurses installed in a non-default location."
5151 echo >&2 "*"
5252 exit 1
scripts/kconfig/nconf-cfg.sh+8−8
@@ -4,16 +4,16 @@ · 3 unmodified lines
44 PKG="ncursesw menuw panelw"
55 PKG2="ncurses menu panel"
66
7−if [ -n "$(command -v pkg-config)" ]; then
8− if pkg-config --exists $PKG; then
9− echo cflags=\"$(pkg-config --cflags $PKG)\"
10− echo libs=\"$(pkg-config --libs $PKG)\"
7+if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
8+ if ${HOSTPKG_CONFIG} --exists $PKG; then
9+ echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\"
10+ echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
1111 exit 0
1212 fi
1313
14− if pkg-config --exists $PKG2; then
15− echo cflags=\"$(pkg-config --cflags $PKG2)\"
16− echo libs=\"$(pkg-config --libs $PKG2)\"
14+ if ${HOSTPKG_CONFIG} --exists $PKG2; then
15+ echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG2)\"
16+ echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG2)\"
1717 exit 0
1818 fi
1919 fi
@@ -44,7 +44,7 @@ echo >&2 "* Unable to find the ncurses package." · 24 unmodified lines
4444 echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
4545 echo >&2 "* depending on your distribution)."
4646 echo >&2 "*"
47−echo >&2 "* You may also need to install pkg-config to find the"
47+echo >&2 "* You may also need to install ${HOSTPKG_CONFIG} to find the"
4848 echo >&2 "* ncurses installed in a non-default location."
4949 echo >&2 "*"
5050 exit 1
scripts/kconfig/qconf-cfg.sh+7−7
@@ -3,22 +3,22 @@ · 2 unmodified lines
33
44 PKG="Qt5Core Qt5Gui Qt5Widgets"
55
6−if [ -z "$(command -v pkg-config)" ]; then
6+if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then
77 echo >&2 "*"
8− echo >&2 "* 'make xconfig' requires 'pkg-config'. Please install it."
8+ echo >&2 "* 'make xconfig' requires '${HOSTPKG_CONFIG}'. Please install it."
99 echo >&2 "*"
1010 exit 1
1111 fi
1212
13−if pkg-config --exists $PKG; then
14− echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags $PKG)\"
15− echo libs=\"$(pkg-config --libs $PKG)\"
16− echo moc=\"$(pkg-config --variable=host_bins Qt5Core)/moc\"
13+if ${HOSTPKG_CONFIG} --exists $PKG; then
14+ echo cflags=\"-std=c++11 -fPIC $(${HOSTPKG_CONFIG} --cflags $PKG)\"
15+ echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
16+ echo moc=\"$(${HOSTPKG_CONFIG} --variable=host_bins Qt5Core)/moc\"
1717 exit 0
1818 fi
1919
2020 echo >&2 "*"
21−echo >&2 "* Could not find Qt5 via pkg-config."
21+echo >&2 "* Could not find Qt5 via ${HOSTPKG_CONFIG}."
2222 echo >&2 "* Please install Qt5 and make sure it's in PKG_CONFIG_PATH"
2323 echo >&2 "*"
2424 exit 1