mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-02-21 17:26:41 +00:00
kconfig/lxdialog: more portable and use ncurses from macports on MacOS
check-lxdialog.sh now correctly tests for ncurses and is a bit more portable. On Darwin it uses the ncurses from macports.
This commit is contained in:
parent
d2d3c15c14
commit
5428b220d6
@ -65,7 +65,7 @@ check_gettext = $(CT_LIB_DIR)/kconfig/check-gettext.sh
|
|||||||
check_lxdialog = $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh
|
check_lxdialog = $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh
|
||||||
|
|
||||||
# Build flags
|
# Build flags
|
||||||
CFLAGS =
|
CFLAGS =
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
# Compiler flags to use gettext
|
# Compiler flags to use gettext
|
||||||
|
@ -1,14 +1,24 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Check ncurses compatibility
|
# Check ncurses compatibility
|
||||||
|
|
||||||
|
OS=`uname`
|
||||||
|
|
||||||
|
# Under MACOS make sure that the macports-installed version is used.
|
||||||
|
case "$OS" in
|
||||||
|
Darwin) BASEDIR="/opt/local";;
|
||||||
|
*) BASEDIR="/usr";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
INCLUDEPATH="${BASEDIR}/include"
|
||||||
|
LIBPATH="${BASEDIR}/lib"
|
||||||
|
|
||||||
# What library to link
|
# What library to link
|
||||||
ldflags()
|
ldflags()
|
||||||
{
|
{
|
||||||
for ext in so a dylib ; do
|
for ext in so a dylib ; do
|
||||||
for lib in ncursesw ncurses curses ; do
|
for lib in ncursesw ncurses curses ; do
|
||||||
$cc -print-file-name=lib${lib}.${ext} | grep -q /
|
if [ -f "${LIBPATH}/lib${lib}.${ext}" ]; then
|
||||||
if [ $? -eq 0 ]; then
|
echo "-L${LIBPATH} -l${lib}"
|
||||||
echo "-l${lib}"
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -19,14 +29,20 @@ ldflags()
|
|||||||
# Where is ncurses.h?
|
# Where is ncurses.h?
|
||||||
ccflags()
|
ccflags()
|
||||||
{
|
{
|
||||||
if [ -f /usr/include/ncurses/ncurses.h ]; then
|
if [ -f "${INCLUDEPATH}/ncursesw/ncurses.h" ]; then
|
||||||
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
|
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncursesw/ncurses.h>\""
|
||||||
elif [ -f /usr/include/ncurses/curses.h ]; then
|
elif [ -f "${INCLUDEPATH}/ncurses/ncurses.h" ]; then
|
||||||
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
|
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses/ncurses.h>\""
|
||||||
elif [ -f /usr/include/ncurses.h ]; then
|
elif [ -f "${INCLUDEPATH}/ncursesw/curses.h" ]; then
|
||||||
echo '-DCURSES_LOC="<ncurses.h>"'
|
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncursesw/curses.h>\""
|
||||||
|
elif [ -f "${INCLUDEPATH}/ncurses/curses.h" ]; then
|
||||||
|
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses/curses.h>\""
|
||||||
|
elif [ -f "${INCLUDEPATH}/ncurses.h" ]; then
|
||||||
|
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses.h>\""
|
||||||
|
elif [ -f "${INCLUDEPATH}/curses.h" ]; then
|
||||||
|
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<curses.h>\""
|
||||||
else
|
else
|
||||||
echo '-DCURSES_LOC="<curses.h>"'
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +52,8 @@ trap "rm -f $tmp" 0 1 2 3 15
|
|||||||
|
|
||||||
# Check if we can link to ncurses
|
# Check if we can link to ncurses
|
||||||
check() {
|
check() {
|
||||||
$cc -xc - -o $tmp 2>/dev/null <<'EOF'
|
IF=`echo $(ccflags) | sed -e 's/"//g'`
|
||||||
|
$cc $IF $(ldflags) -xc - -o $tmp 2>/dev/null <<'EOF'
|
||||||
#include CURSES_LOC
|
#include CURSES_LOC
|
||||||
main() {}
|
main() {}
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user