logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: pecl /memcache config.m4: msg#00226

Subject: cvs: pecl /memcache config.m4
tony2001                Sat Nov 26 12:53:20 2005 EDT

  Modified files:              
    /pecl/memcache      config.m4 
  Log:
  add zlib autodetection (thanks to Ben Gollmer [ben at jatosoft dot com] for 
the idea)
  
  
http://cvs.php.net/diff.php/pecl/memcache/config.m4?r1=1.3&r2=1.4&ty=u
Index: pecl/memcache/config.m4
diff -u pecl/memcache/config.m4:1.3 pecl/memcache/config.m4:1.4
--- pecl/memcache/config.m4:1.3 Tue Apr 19 10:01:44 2005
+++ pecl/memcache/config.m4     Sat Nov 26 12:53:18 2005
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.3 2005/04/19 14:01:44 tony2001 Exp $
+dnl $Id: config.m4,v 1.4 2005/11/26 17:53:18 tony2001 Exp $
 dnl
 
 PHP_ARG_ENABLE(memcache, whether to enable memcache support,
@@ -12,6 +12,26 @@
 
 if test "$PHP_MEMCACHE" != "no"; then
 
+  if test "$PHP_ZLIB_DIR" != "no"; then
+    if test -f $PHP_ZLIB_DIR/include/zlib/zlib.h; then
+      PHP_ZLIB_DIR=$PHP_ZLIB_DIR
+      PHP_ZLIB_INCDIR=$PHP_ZLIB_DIR/include/zlib
+    elif test -f $PHP_ZLIB_DIR/include/zlib.h; then
+      PHP_ZLIB_DIR=$PHP_ZLIB_DIR
+      PHP_ZLIB_INCDIR=$PHP_ZLIB_DIR/include
+    fi
+  else
+    for i in /usr/local /usr; do
+      if test -f $i/include/zlib/zlib.h; then
+        PHP_ZLIB_DIR=$i
+        PHP_ZLIB_INCDIR=$i/include/zlib
+      elif test -f $i/include/zlib.h; then
+        PHP_ZLIB_DIR=$i
+        PHP_ZLIB_INCDIR=$i/include
+      fi
+    done
+  fi
+
   dnl # zlib
   AC_MSG_CHECKING([for the location of zlib])
   if test "$PHP_ZLIB_DIR" = "no"; then
@@ -19,6 +39,7 @@
   else
     AC_MSG_RESULT([$PHP_ZLIB_DIR])
     PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, MEMCACHE_SHARED_LIBADD)
+    PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR)
   fi
 
   AC_DEFINE(HAVE_MEMCACHE,1,[Whether you want memcache support])



<Prev in Thread] Current Thread [Next in Thread>