2018-05-22 16:22:19 +09:00
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
2022-12-11 11:54:48 +09:00
cflags = $1
libs = $2
bin = $3
2023-08-09 13:42:31 +02:00
PKG5 = "Qt5Core Qt5Gui Qt5Widgets"
PKG6 = "Qt6Core Qt6Gui Qt6Widgets"
2018-05-22 16:22:19 +09:00
2022-04-01 23:18:02 +00:00
if [ -z " $( command -v ${ HOSTPKG_CONFIG } ) " ] ; then
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: 4ab3b80159d4 ("kconfig: check for pkg-config on make {menu,n,g,x}config")
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Meelis Roos <mroos@linux.ee>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
2018-08-31 18:34:55 +09:00
echo >& 2 "*"
2022-04-01 23:18:02 +00:00
echo >& 2 " * 'make xconfig' requires ' ${ HOSTPKG_CONFIG } '. Please install it. "
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: 4ab3b80159d4 ("kconfig: check for pkg-config on make {menu,n,g,x}config")
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Meelis Roos <mroos@linux.ee>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
2018-08-31 18:34:55 +09:00
echo >& 2 "*"
exit 1
fi
2023-08-09 13:42:31 +02:00
if ${ HOSTPKG_CONFIG } --exists $PKG6 ; then
${ HOSTPKG_CONFIG } --cflags ${ PKG6 } > ${ cflags }
# Qt6 requires C++17.
echo -std= c++17 >> ${ cflags }
${ HOSTPKG_CONFIG } --libs ${ PKG6 } > ${ libs }
${ HOSTPKG_CONFIG } --variable= libexecdir Qt6Core > ${ bin }
exit 0
fi
if ${ HOSTPKG_CONFIG } --exists $PKG5 ; then
${ HOSTPKG_CONFIG } --cflags ${ PKG5 } > ${ cflags }
${ HOSTPKG_CONFIG } --libs ${ PKG5 } > ${ libs }
2022-12-11 11:54:48 +09:00
${ HOSTPKG_CONFIG } --variable= host_bins Qt5Core > ${ bin }
2018-05-22 16:22:19 +09:00
exit 0
fi
echo >& 2 "*"
2023-08-09 13:42:31 +02:00
echo >& 2 " * Could not find Qt6 or Qt5 via ${ HOSTPKG_CONFIG } . "
echo >& 2 "* Please install Qt6 or Qt5 and make sure it's in PKG_CONFIG_PATH"
echo >& 2 " * You need $PKG6 for Qt6 "
echo >& 2 " * You need $PKG5 for Qt5 "
2018-05-22 16:22:19 +09:00
echo >& 2 "*"
exit 1