From: danw Date: Tue, 26 Jan 1999 20:07:20 +0000 (+0000) Subject: Check to see if -lcurses has the newterm() function. X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/4753fa797ae3c4886d64e6b0b9ec2acf35b5549f Check to see if -lcurses has the newterm() function. (SVR4 curses exits if initscr() fails, so use that instead if it's there.) --- diff --git a/configure b/configure index a74267c6..d11868db 100755 --- a/configure +++ b/configure @@ -2398,6 +2398,22 @@ else fi rm -f conftest* fi +rm -f conftest* + cat > conftest.$ac_ext < +int main() { +newterm(NULL, NULL, NULL); +; return 0; } +EOF +if { (eval echo configure:2411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + CURSES_CPPFLAGS="$CURSES_CPPFLAGS -DCURSES_HAS_NEWTERM" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi rm -f conftest* LIBS=$OLDLIBS CURSES_CPPFLAGS="-DHAVE_CURSES $CURSES_CPPFLAGS" @@ -2413,12 +2429,12 @@ fi for ac_func in getusershell do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2417: checking for $ac_func" >&5 +echo "configure:2433: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/configure.in b/configure.in index fd3ebf91..f85ab9e7 100755 --- a/configure.in +++ b/configure.in @@ -373,6 +373,8 @@ if test -n "$CURSES_LIBS"; then AC_TRY_COMPILE([#include ],[WINDOW *w; w->_maxx;], [CURSES_CPPFLAGS="-D'getmaxx(w)=w->_maxx'"], [CURSES_CPPFLAGS="-D'getmaxx(w)=w->maxx'"])) + AC_TRY_LINK([#include ],[newterm(NULL, NULL, NULL);], + [CURSES_CPPFLAGS="$CURSES_CPPFLAGS -DCURSES_HAS_NEWTERM"]) LIBS=$OLDLIBS CURSES_CPPFLAGS="-DHAVE_CURSES $CURSES_CPPFLAGS" CURSES_SUBDIRS='$(CURSES_SUBDIRS)'