2 # Check ncurses compatibility
6 # Under MACOS make sure that the macports-installed version is used.
8 Darwin) BASEDIR="/opt/local";;
12 INCLUDEPATH="${BASEDIR}/include"
13 LIBPATH="${BASEDIR}/lib"
15 # What library to link
18 for ext in so a dylib ; do
19 for lib in ncursesw ncurses curses ; do
20 if [ -f "${LIBPATH}/lib${lib}.${ext}" ]; then
21 echo "-L${LIBPATH} -l${lib}"
32 if [ -f "${INCLUDEPATH}/ncursesw/ncurses.h" ]; then
33 echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncursesw/ncurses.h>\""
34 elif [ -f "${INCLUDEPATH}/ncurses/ncurses.h" ]; then
35 echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses/ncurses.h>\""
36 elif [ -f "${INCLUDEPATH}/ncursesw/curses.h" ]; then
37 echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncursesw/curses.h>\""
38 elif [ -f "${INCLUDEPATH}/ncurses/curses.h" ]; then
39 echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses/curses.h>\""
40 elif [ -f "${INCLUDEPATH}/ncurses.h" ]; then
41 echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses.h>\""
42 elif [ -f "${INCLUDEPATH}/curses.h" ]; then
43 echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<curses.h>\""
49 # Temp file, try to clean up after us
51 trap "rm -f $tmp" 0 1 2 3 15
53 # Check if we can link to ncurses
55 IF=`echo $(ccflags) | sed -e 's/"//g'`
56 $cc $IF $(ldflags) -xc - -o $tmp 2>/dev/null <<'EOF'
61 echo " *** Unable to find the ncurses libraries or the" 1>&2
62 echo " *** required header files." 1>&2
63 echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
65 echo " *** Install ncurses (ncurses-devel) and try again." 1>&2
72 printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n"