2018-05-22 10:22:21 +03:00
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
PKG = "ncursesw menuw panelw"
PKG2 = "ncurses menu panel"
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 12:34:55 +03:00
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
2018-05-22 10:22:21 +03:00
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 12:34:55 +03:00
if pkg-config --exists $PKG2 ; then
echo cflags = \" $( pkg-config --cflags $PKG2 ) \"
echo libs = \" $( pkg-config --libs $PKG2 ) \"
exit 0
fi
2018-05-22 10:22:21 +03:00
fi
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 12:34:55 +03:00
# 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.)
2018-05-22 10:22:21 +03:00
if [ -f /usr/include/ncursesw/ncurses.h ] ; then
echo cflags = \" -D_GNU_SOURCE -I/usr/include/ncursesw\"
echo libs = \" -lncursesw -lmenuw -lpanelw\"
exit 0
fi
if [ -f /usr/include/ncurses/ncurses.h ] ; then
echo cflags = \" -D_GNU_SOURCE -I/usr/include/ncurses\"
echo libs = \" -lncurses -lmenu -lpanel\"
exit 0
fi
if [ -f /usr/include/ncurses.h ] ; then
echo cflags = \" -D_GNU_SOURCE\"
echo libs = \" -lncurses -lmenu -lpanel\"
exit 0
fi
echo >& 2 "*"
echo >& 2 "* Unable to find the ncurses package."
echo >& 2 "* Install ncurses (ncurses-devel or libncurses-dev"
echo >& 2 "* depending on your distribution)."
echo >& 2 "*"
exit 1