]> granicus.if.org Git - php/commitdiff
MFH: - Fixed bug #25752 (ext/ncurses: ncurses.h instead of curses.h with BSD).
authorfoobar <sniper@php.net>
Sat, 4 Oct 2003 01:04:54 +0000 (01:04 +0000)
committerfoobar <sniper@php.net>
Sat, 4 Oct 2003 01:04:54 +0000 (01:04 +0000)
NEWS
ext/ncurses/config.m4
ext/ncurses/php_ncurses.h

diff --git a/NEWS b/NEWS
index 0afc3961d302d89dad8c674a6be02ccfc6e09c48..34ec92cd325d5d46daed3899640158e4e5b606f0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP 4                                                                      NEWS
 ?? Oct 2003, Version 4.3.4RC2
 - Fixed multibyte regex engine to properly handle ".*" pattern under
   POSIX compatible mode. (K.Kosako <kosako at sofnec.co.jp>, Moriyoshi)
+- Fixed bug #25752 (ext/ncurses: ncurses.h instead of curses.h with BSD). (Jani)
 - Fixed bug #25745 (ctype functions fail with non-ascii characters). (Moriyoshi)
 - Fixed bug #25744 (make ZTS build of ext/sybase compile). (Ilia)
 - Fixed bug #25738 (alloca() related issues on the Darwin platform). (Moriyoshi)
index f69fb62fe8c31ee4a0f68348eef331b9cee5a2dd..77e3c252dded60385c5587792896495ab33b3995 100644 (file)
@@ -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)
index d8b987458230f3913d9c5245d99d313fe5131b8f..c98e07636a65c22f68963de08e24ab50c242958c 100644 (file)
 #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;