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

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 de0e9c5f261698d18baeb7cf36181a8e1dcd1bac..123d25a9a8525688ba80a8ed908ee1f4e90c28c0 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;