summaryrefslogtreecommitdiff
path: root/kconfig/lxdialog
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-10-03 22:16:56 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-10-03 22:16:56 (GMT)
commitddac60504f62c8d34d53cbd24b3f1dd5805483cd (patch)
tree2022284e0f8bcc0135aff451295fb3de9efdd30d /kconfig/lxdialog
parenta6552be181a3fb178df12c7c98a91008107e9814 (diff)
kconfig: resync curses check with Linux kernel
check-lxdialog.sh breaks on 64-bit distributions which are lacking the lib -> lib64 symlinks (eg. some Fedora). The script from the 2.6.35 Linux kernel is reportedly functional on the systems that were requiring the current hack. See: http://sourceware.org/ml/crossgcc/2010-09/msg00113.html Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'kconfig/lxdialog')
-rw-r--r--kconfig/lxdialog/check-lxdialog.sh39
1 files changed, 11 insertions, 28 deletions
diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
index a576d1c..fcef0f5 100644
--- a/kconfig/lxdialog/check-lxdialog.sh
+++ b/kconfig/lxdialog/check-lxdialog.sh
@@ -1,24 +1,14 @@
#!/bin/sh
# 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
ldflags()
{
for ext in so a dylib ; do
for lib in ncursesw ncurses curses ; do
- if [ -f "${LIBPATH}/lib${lib}.${ext}" ]; then
- echo "-L${LIBPATH} -l${lib}"
+ $cc -print-file-name=lib${lib}.${ext} | grep -q /
+ if [ $? -eq 0 ]; then
+ echo "-l${lib}"
exit
fi
done
@@ -29,20 +19,14 @@ ldflags()
# Where is ncurses.h?
ccflags()
{
- if [ -f "${INCLUDEPATH}/ncursesw/ncurses.h" ]; then
- echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncursesw/ncurses.h>\""
- elif [ -f "${INCLUDEPATH}/ncurses/ncurses.h" ]; then
- echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses/ncurses.h>\""
- elif [ -f "${INCLUDEPATH}/ncursesw/curses.h" ]; then
- 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>\""
+ if [ -f /usr/include/ncurses/ncurses.h ]; then
+ echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
+ elif [ -f /usr/include/ncurses/curses.h ]; then
+ echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
+ elif [ -f /usr/include/ncurses.h ]; then
+ echo '-DCURSES_LOC="<ncurses.h>"'
else
- exit 1
+ echo '-DCURSES_LOC="<curses.h>"'
fi
}
@@ -52,8 +36,7 @@ trap "rm -f $tmp" 0 1 2 3 15
# Check if we can link to ncurses
check() {
- IF=`echo $(ccflags) | sed -e 's/"//g'`
- $cc $IF $(ldflags) -xc - -o $tmp 2>/dev/null <<'EOF'
+ $cc -xc - -o $tmp 2>/dev/null <<'EOF'
#include CURSES_LOC
main() {}
EOF