always try to link with ncursesw

This commit is contained in:
Andrzej Rybczak
2009-09-26 00:38:22 +02:00
parent 5866cd6343
commit 3e75ff6455

View File

@@ -76,35 +76,45 @@ dnl ========================
dnl = checking for ncurses = dnl = checking for ncurses =
dnl ======================== dnl ========================
if test "$pdcurses" = "no" ; then if test "$pdcurses" = "no" ; then
pdcurses=XCurses
if test "$unicode" = "yes" ; then if test "$unicode" = "yes" ; then
curses_config_bin=ncursesw5-config curses_config_bin=ncursesw5-config
curses_lib=ncursesw
AC_DEFINE([_UTF8], [1], [enables unicode support]) AC_DEFINE([_UTF8], [1], [enables unicode support])
else else
curses_config_bin=ncurses5-config curses_config_bin=ncurses5-config
curses_lib=ncurses
fi fi
else else
if test "$pdcurses" = "yes" ; then if test "$pdcurses" = "yes" ; then
pdcurses=XCurses pdcurses_lib=XCurses
curses_config_bin=xcurses-config
else
pdcurses_lib=$pdcurses
fi fi
curses_config_bin=xcurses-config
curses_lib=$pdcurses
AC_DEFINE([USE_PDCURSES], [1], [enables pdcurses support]) AC_DEFINE([USE_PDCURSES], [1], [enables pdcurses support])
fi fi
AC_PATH_PROG(CURSES_CONFIG, $curses_config_bin) AC_PATH_PROG(CURSES_CONFIG, $curses_config_bin)
if test "$pdcurses" = "XCurses" && test "$CURSES_CONFIG" != "" ; then if test "$CURSES_CONFIG" != "" ; then
CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags`" CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags`"
LDFLAGS="$LDFLAGS `$CURSES_CONFIG --libs`" LDFLAGS="$LDFLAGS `$CURSES_CONFIG --libs`"
AC_CHECK_LIB($curses_lib, initscr, , AC_MSG_ERROR([$curses_lib library is required]))
else
AC_CHECK_LIB($curses_lib, initscr, LDFLAGS="$LDFLAGS -l$curses_lib", AC_MSG_ERROR([$curses_lib library is required]))
fi fi
if test "$pdcurses" = "no" ; then
AC_CHECK_LIB(ncursesw, initscr,
curses_lib=ncursesw,
curses_lib=ncurses
)
else
curses_lib=$pdcurses_lib
fi
AC_CHECK_LIB($curses_lib, initscr,
if test "$CURSES_CONFIG" = "" ; then
LDFLAGS="$LDFLAGS -l$curses_lib"
fi
,
AC_MSG_ERROR([$curses_lib library is required])
)
if test "$pdcurses" != "no" ; then if test "$pdcurses" != "no" ; then
AC_CHECK_LIB($curses_lib, Xinitscr, AC_DEFINE([XCURSES], [1], [x11 pdcurses available]), ) AC_CHECK_LIB($curses_lib, Xinitscr, AC_DEFINE([XCURSES], [1], [x11 pdcurses available]), )
fi fi
AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing ncurses.h header])) AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing curses.h header]))
dnl ====================== dnl ======================
dnl = checking for fftw3 = dnl = checking for fftw3 =