From:             [EMAIL PROTECTED]
Operating system: Mac OS X
PHP version:      5CVS-2005-10-28 (CVS)
PHP Bug Type:     PDO related
Bug description:  pdo_dblib can't find the FreeTDS includes on some systems

Description:
------------
On some systems FreeTDS include files are being installed on
$prefix/include/freetds instead of $prefix/include where configure is
trying to find them.

I have modified the ext/pdo_dblib/config.m4 to also search that directory
with the following patch:

--- config.m4   2005-10-31 10:08:18.000000000 +0200
+++ config.m4.new       2005-10-31 10:17:30.000000000 +0200
@@ -10,13 +10,17 @@
 
 if test "$PHP_PDO_DBLIB" != "no"; then
 
-  PDO_FREETDS_INSTALLATION_DIR=""
   if test "$PHP_PDO_DBLIB" = "yes"; then
 
     for i in /usr/local /usr; do
       if test -f $i/include/tds.h; then
         PDO_FREETDS_INSTALLATION_DIR=$i
+        PDO_FREETDS_INCLUDE_DIR=$i/include
         break
+      elif test -f $i/include/freetds/tds.h; then
+        PDO_FREETDS_INSTALLATION_DIR=$i
+        PDO_FREETDS_INCLUDE_DIR=$i/include/freetds
+        break;
       fi
     done
 
@@ -28,6 +32,10 @@
 
     if test -f $PHP_PDO_DBLIB/include/tds.h; then
       PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB
+      PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include
+    elif test -f $PHP_PDO_DBLIB/include/freetds/tds.h; then
+      PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB
+      PDO_FREETDS_INCLUDE_DIR=$PHP_PDO_DBLIB/include/freetds
     else
       AC_MSG_ERROR(Directory $PHP_PDO_DBLIB is not a FreeTDS installation
directory)
     fi
@@ -41,11 +49,9 @@
      AC_MSG_ERROR(Could not find
$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so])
   fi
 
-  PDO_DBLIB_INCDIR=$PDO_FREETDS_INSTALLATION_DIR/include
-  PDO_DBLIB_LIBDIR=$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR
+  PHP_ADD_INCLUDE($PDO_FREETDS_INCLUDE_DIR)
+  PHP_ADD_LIBRARY_WITH_PATH(sybdb,
$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, PDO_DBLIB_SHARED_LIBADD)
 
-  PHP_ADD_INCLUDE($PDO_DBLIB_INCDIR)
-  PHP_ADD_LIBRARY_WITH_PATH(sybdb, $PDO_DBLIB_LIBDIR,
PDO_DBLIB_SHARED_LIBADD)
   ifdef([PHP_CHECK_PDO_INCLUDES],
   [
     PHP_CHECK_PDO_INCLUDES



-- 
Edit bug report at http://bugs.php.net/?id=35032&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35032&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35032&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35032&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35032&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35032&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35032&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35032&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35032&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35032&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35032&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35032&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35032&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35032&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35032&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35032&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35032&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35032&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35032&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35032&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35032&r=mysqlcfg

Reply via email to