Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/sh
0002 # SPDX-License-Identifier: GPL-2.0
0003 
0004 PKG="ncursesw menuw panelw"
0005 PKG2="ncurses menu panel"
0006 
0007 if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then
0008         if ${HOSTPKG_CONFIG} --exists $PKG; then
0009                 echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\"
0010                 echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\"
0011                 exit 0
0012         fi
0013 
0014         if ${HOSTPKG_CONFIG} --exists $PKG2; then
0015                 echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG2)\"
0016                 echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG2)\"
0017                 exit 0
0018         fi
0019 fi
0020 
0021 # Check the default paths in case pkg-config is not installed.
0022 # (Even if it is installed, some distributions such as openSUSE cannot
0023 # find ncurses by pkg-config.)
0024 if [ -f /usr/include/ncursesw/ncurses.h ]; then
0025         echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\"
0026         echo libs=\"-lncursesw -lmenuw -lpanelw\"
0027         exit 0
0028 fi
0029 
0030 if [ -f /usr/include/ncurses/ncurses.h ]; then
0031         echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncurses\"
0032         echo libs=\"-lncurses -lmenu -lpanel\"
0033         exit 0
0034 fi
0035 
0036 if [ -f /usr/include/ncurses.h ]; then
0037         echo cflags=\"-D_GNU_SOURCE\"
0038         echo libs=\"-lncurses -lmenu -lpanel\"
0039         exit 0
0040 fi
0041 
0042 echo >&2 "*"
0043 echo >&2 "* Unable to find the ncurses package."
0044 echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev"
0045 echo >&2 "* depending on your distribution)."
0046 echo >&2 "*"
0047 echo >&2 "* You may also need to install ${HOSTPKG_CONFIG} to find the"
0048 echo >&2 "* ncurses installed in a non-default location."
0049 echo >&2 "*"
0050 exit 1