kconfig/lxdialog/check-lxdialog.sh
changeset 1174 7710d81d15e7
parent 706 607277e3cdab
child 1229 8864e5255c2d
     1.1 --- a/kconfig/lxdialog/check-lxdialog.sh	Tue Jul 22 09:16:07 2008 +0000
     1.2 +++ b/kconfig/lxdialog/check-lxdialog.sh	Thu Jan 29 18:53:32 2009 +0000
     1.3 @@ -4,21 +4,15 @@
     1.4  # What library to link
     1.5  ldflags()
     1.6  {
     1.7 -	$cc -print-file-name=libncursesw.so | grep -q /
     1.8 -	if [ $? -eq 0 ]; then
     1.9 -		echo '-lncursesw'
    1.10 -		exit
    1.11 -	fi
    1.12 -	$cc -print-file-name=libncurses.so | grep -q /
    1.13 -	if [ $? -eq 0 ]; then
    1.14 -		echo '-lncurses'
    1.15 -		exit
    1.16 -	fi
    1.17 -	$cc -print-file-name=libcurses.so | grep -q /
    1.18 -	if [ $? -eq 0 ]; then
    1.19 -		echo '-lcurses'
    1.20 -		exit
    1.21 -	fi
    1.22 +	for ext in so a dylib ; do
    1.23 +		for lib in ncursesw ncurses curses ; do
    1.24 +			$cc -print-file-name=lib${lib}.${ext} | grep -q /
    1.25 +			if [ $? -eq 0 ]; then
    1.26 +				echo "-l${lib}"
    1.27 +				exit
    1.28 +			fi
    1.29 +		done
    1.30 +	done
    1.31  	exit 1
    1.32  }
    1.33  
    1.34 @@ -42,14 +36,18 @@
    1.35  
    1.36  # Check if we can link to ncurses
    1.37  check() {
    1.38 -	echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null
    1.39 -	if [ $? -ne 0 ]; then
    1.40 -		echo " *** Unable to find the ncurses libraries."          1>&2
    1.41 -		echo " *** make menuconfig require the ncurses libraries"  1>&2
    1.42 -		echo " *** "                                               1>&2
    1.43 -		echo " *** Install ncurses (ncurses-devel) and try again"  1>&2
    1.44 -		echo " *** "                                               1>&2
    1.45 -		exit 1
    1.46 +        $cc -xc - -o $tmp 2>/dev/null <<'EOF'
    1.47 +#include CURSES_LOC
    1.48 +main() {}
    1.49 +EOF
    1.50 +	if [ $? != 0 ]; then
    1.51 +	    echo " *** Unable to find the ncurses libraries or the"       1>&2
    1.52 +	    echo " *** required header files."                            1>&2
    1.53 +	    echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
    1.54 +	    echo " *** "                                                  1>&2
    1.55 +	    echo " *** Install ncurses (ncurses-devel) and try again."    1>&2
    1.56 +	    echo " *** "                                                  1>&2
    1.57 +	    exit 1
    1.58  	fi
    1.59  }
    1.60