stas            Wed Sep  3 18:43:56 2008 UTC

  Modified files:              
    /php-src/ext/pdo_oci        config.m4 
  Log:
  better detection for client libraries
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/config.m4?r1=1.24&r2=1.25&diff_format=u
Index: php-src/ext/pdo_oci/config.m4
diff -u php-src/ext/pdo_oci/config.m4:1.24 php-src/ext/pdo_oci/config.m4:1.25
--- php-src/ext/pdo_oci/config.m4:1.24  Fri Jul 25 13:38:40 2008
+++ php-src/ext/pdo_oci/config.m4       Wed Sep  3 18:43:56 2008
@@ -1,83 +1,53 @@
-dnl $Id: config.m4,v 1.24 2008/07/25 13:38:40 jani Exp $
+dnl $Id: config.m4,v 1.25 2008/09/03 18:43:56 stas Exp $
 dnl config.m4 for extension pdo_oci
 dnl vim:et:sw=2:ts=2:
 
+if test "$PHP_PDO" != "no"; then
+SUPPORTED_VERS="1 8 9 10 11"
 AC_DEFUN([AC_PDO_OCI_VERSION],[
   AC_MSG_CHECKING([Oracle version])
   if test -s "$PDO_OCI_DIR/orainst/unix.rgs"; then
-    PDO_OCI_VERSION=`grep '"ocommon"' $PDO_OCI_DIR/orainst/unix.rgs | sed 's/[ 
][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
+    PDO_OCI_VERSION=`grep '"ocommon"' $PDO_OCI_DIR/orainst/unix.rgs | sed 's/  
*/:/g' | cut -d: -f 6 | cut -c 2-4`
     test -z "$PDO_OCI_VERSION" && PDO_OCI_VERSION=7.3
-  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
-    PDO_OCI_VERSION=11.1    
-  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
-    PDO_OCI_VERSION=10.1    
-  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
-    PDO_OCI_VERSION=9.0
-  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
-    PDO_OCI_VERSION=8.1
-  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
-    PDO_OCI_VERSION=8.0
-  elif test -f $PDO_OCI_LIB_DIR/libclntsh.a; then 
-    if test -f $PDO_OCI_LIB_DIR/libcore4.a; then 
-      PDO_OCI_VERSION=8.0
+  elif test -f $PDO_OCI_DIR/lib/libclntsh.a; then
+    if test -f $PDO_OCI_DIR/lib/libcore4.a; then
+      PDO_OCI_VERSION=8.x
     else
-      PDO_OCI_VERSION=8.1
+      PDO_OCI_VERSION=8.x
     fi
   else
-    AC_MSG_ERROR(Oracle OCI libraries not found under $PDO_OCI_DIR)
+          for OCI_VER in $SUPPORTED_VERS; do
+                  if test -f 
$PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER.*; then
+                    PDO_OCI_VERSION="$OCI_VER.x"
+                    echo $PDO_OCI_VERSION
+                  fi
+          done
+  fi
+  if [ -z "$PDO_OCI_VERSION" ] ;then
+    { { echo "$as_me:$LINENO: error: Oracle-OCI needed libraries not found 
under $PDO_OCI_DIR" >&5
+        echo "$as_me: error: Oracle-OCI needed libraries not found under 
$PDO_OCI_DIR" >&2;}
+   { (exit 1); exit 1; }; }
   fi
-  AC_MSG_RESULT($PDO_OCI_VERSION)
-])                                                                             
                                                                                
   
-
-AC_DEFUN([AC_PDO_OCI_CHECK_LIB_DIR],[
-  AC_CHECK_SIZEOF(long int, 4)
-  AC_MSG_CHECKING([if we're on a 64-bit platform])
-  if test "$ac_cv_sizeof_long_int" = "4" ; then
-    AC_MSG_RESULT([no])
-    TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32"
-  else
-    AC_MSG_RESULT([yes])
-    TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib"
-  fi
-
-  AC_MSG_CHECKING([OCI8 libraries dir])
-  if test -d "$PDO_OCI_DIR/lib" && test ! -d "$PDO_OCI_DIR/lib32"; then
-    PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib"
-  elif test ! -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then
-    PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32"
-  elif test -d "$PDO_OCI_DIR/lib" && test -d "$PDO_OCI_DIR/lib32"; then
-    PDO_OCI_LIB_DIR=$TMP_PDO_OCI_LIB_DIR
-  else
-    AC_MSG_ERROR([Oracle (OCI8) required libraries not found])
-  fi
-  AC_MSG_RESULT($PDO_OCI_LIB_DIR)
-])
 
 PHP_ARG_WITH(pdo-oci, Oracle OCI support for PDO,
-[  --with-pdo-oci[=DIR]      PDO: Oracle OCI support. DIR defaults to 
\$ORACLE_HOME.
-                            Use --with-pdo-oci=instantclient,prefix,version 
-                            for an Oracle Instant Client SDK. 
-                            For Linux with 10.2.0.3 RPMs (for example) use:
-                            --with-pdo-oci=instantclient,/usr,10.2.0.3])
+[  --with-pdo-oci[=DIR]      PDO: Oracle-OCI support. Default DIR is 
ORACLE_HOME.
+                            You may also use 
--with-pdo-oci=instantclient,prefix,version to use
+                            the InstantClient SDK. For Linux with 10.1.0.3 
rpms (for example) use:
+                            --with-pdo-oci=instantclient,/usr,10.1.0.3])
 
 if test "$PHP_PDO_OCI" != "no"; then
-
-  if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
-    AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure 
line.])
-  fi
-
   AC_MSG_CHECKING([Oracle Install-Dir])
-  if test "$PHP_PDO_OCI" = "yes" || test -z "$PHP_PDO_OCI"; then
+  if test "$PHP_PDO_OCI" = "yes" -o -z "$PHP_PDO_OCI"; then
     PDO_OCI_DIR=$ORACLE_HOME
   else
     PDO_OCI_DIR=$PHP_PDO_OCI
   fi
-  AC_MSG_RESULT($PHP_PDO_OCI)
+  AC_MSG_RESULT($PDO_OCI_DIR :$PHP_PDO_OCI:)
 
   AC_MSG_CHECKING([if that is sane])
   if test -z "$PDO_OCI_DIR"; then
     AC_MSG_ERROR([
-You need to tell me where to find your Oracle Instant Client SDK, or set 
ORACLE_HOME.
+You need to tell me where to find your oracle SDK, or set ORACLE_HOME.
 ])
   else
     AC_MSG_RESULT([yes])
@@ -93,28 +63,12 @@
     elif test -f 
$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include/oci.h ; then
       
PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include)
       
AC_MSG_RESULT($PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include)
-    elif test -f $PDO_OCI_IC_PREFIX/sdk/include/oci.h ; then
-      PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/sdk/include)
-      AC_MSG_RESULT($PDO_OCI_IC_PREFIX/sdk/include)
-    elif test -f $PDO_OCI_IC_PREFIX/client/include/oci.h ; then
-      PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/client/include)
-      AC_MSG_RESULT($PDO_OCI_IC_PREFIX/client/include)
     else
-      AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in 
your Instant Client install])
+      AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in 
your instant client install])
     fi
-    if test -f 
"$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib/libclntsh.so" ; then
     PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib"
-    elif test -f "$PDO_OCI_IC_PREFIX/client/lib/libclntsh.so" ; then
-      PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/client/lib"
-    elif test -f "$PDO_OCI_IC_PREFIX/libclntsh.so" ; then
-      PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX"
-    else
-      AC_MSG_ERROR([I'm too dumb to figure out where the libraries are in your 
Instant Client install])
-    fi
     PDO_OCI_VERSION="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`"
   else
-    AC_PDO_OCI_CHECK_LIB_DIR($PDO_OCI_DIR)
-
     if test -d "$PDO_OCI_DIR/rdbms/public"; then
       PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/public)
       PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/rdbms/public"
@@ -136,14 +90,14 @@
       PDO_OCI_INCLUDES="$PDO_OCI_INCLUDES -I$PDO_OCI_DIR/include"
     fi
 
-    if test -f "$PDO_OCI_LIB_DIR/sysliblist"; then
-      PHP_EVAL_LIBLINE(`cat $PDO_OCI_LIB_DIR/sysliblist`, PDO_OCI_SYSLIB)
+    if test -f "$PDO_OCI_DIR/lib/sysliblist"; then
+      PHP_EVAL_LIBLINE(`cat $PDO_OCI_DIR/lib/sysliblist`, PDO_OCI_SYSLIB)
     elif test -f "$PDO_OCI_DIR/rdbms/lib/sysliblist"; then
       PHP_EVAL_LIBLINE(`cat $PDO_OCI_DIR/rdbms/lib/sysliblist`, PDO_OCI_SYSLIB)
     fi
+    PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib"
     AC_PDO_OCI_VERSION($PDO_OCI_DIR)
   fi
-
   case $PDO_OCI_VERSION in
     8.0)
       PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, "", PDO_OCI_SHARED_LIBADD)
@@ -152,26 +106,16 @@
       PHP_ADD_LIBRARY_WITH_PATH(clntsh, $PDO_OCI_LIB_DIR, 
PDO_OCI_SHARED_LIBADD)
       ;;
 
-    8.1)
-      PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
-      ;;
-
-    9.0)
+    9.x|10.x|11.x)
       PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
       ;;
-
-    10.1)
-      PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
-      ;;
-
-    10.2)
-      PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
-      ;;
-
-    11.1)
-      PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
-      ;;
-
+      
+    #11.1)
+    #  PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+    #  ;;
+    #10.2)
+    #  PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+    #  ;;
     *)
       AC_MSG_ERROR(Unsupported Oracle version! $PDO_OCI_VERSION)
       ;;
@@ -256,6 +200,7 @@
   [
     PHP_ADD_EXTENSION_DEP(pdo_oci, pdo)
   ])
+  
+fi
 
-  AC_DEFINE_UNQUOTED(PHP_PDO_OCI_CLIENT_VERSION, "$PDO_OCI_VERSION", [ ])
 fi

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to