diff options
author | foobar <sniper@php.net> | 2003-10-04 01:04:31 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2003-10-04 01:04:31 +0000 |
commit | 96e0010f137d2549714a9562ab28c4f0649dad5d (patch) | |
tree | 611a27be389beafa33e0fc4963516dbc28bac0db | |
parent | 708dee922c2b23328a4efeff0b9d8a42076821cc (diff) | |
download | php-git-96e0010f137d2549714a9562ab28c4f0649dad5d.tar.gz |
- Fixed bug #25752 (ext/ncurses: ncurses.h instead of curses.h with BSD).
-rw-r--r-- | ext/ncurses/config.m4 | 25 | ||||
-rw-r--r-- | ext/ncurses/php_ncurses.h | 6 |
2 files changed, 17 insertions, 14 deletions
diff --git a/ext/ncurses/config.m4 b/ext/ncurses/config.m4 index f69fb62fe8..77e3c252dd 100644 --- a/ext/ncurses/config.m4 +++ b/ext/ncurses/config.m4 @@ -7,21 +7,20 @@ PHP_ARG_WITH(ncurses, for ncurses support, if test "$PHP_NCURSES" != "no"; then - # --with-ncurses -> check with-path - SEARCH_PATH="/usr/local /usr" - SEARCH_FOR="/include/curses.h" - - if test -d $PHP_NCURSES/; then # path given as parameter - NCURSES_DIR=$PHP_NCURSES - else # search default path list - AC_MSG_CHECKING(for ncurses files in default path) - for i in $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then + SEARCH_PATH="$PHP_NCURSES /usr/local /usr" + + for i in $SEARCH_PATH ; do + if test -d $i/include; then + if test -r $i/include/ncurses.h; then + NCURSES_DIR=$i + AC_DEFINE(HAVE_NCURSES_H,1,[ ]) + break + elif test -r $i/include/curses.h; then NCURSES_DIR=$i - AC_MSG_RESULT(found in $i) + break fi - done - fi + fi + done if test -z "$NCURSES_DIR"; then AC_MSG_RESULT(not found) diff --git a/ext/ncurses/php_ncurses.h b/ext/ncurses/php_ncurses.h index de0e9c5f26..123d25a9a8 100644 --- a/ext/ncurses/php_ncurses.h +++ b/ext/ncurses/php_ncurses.h @@ -19,7 +19,11 @@ #ifndef PHP_NCURSES_H #define PHP_NCURSES_H -#include <curses.h> +#ifdef HAVE_NCURSES_H +# include <ncurses.h> +#else +# include <curses.h> +#endif extern int le_ncurses_windows; |