php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35032 pdo_dblib can't find the FreeTDS includes on some systems
Submitted: 2005-10-31 11:15 UTC Modified: 2005-11-01 14:28 UTC
From: spheroid@php.net Assigned: wez (profile)
Status: Closed Package: PDO related
PHP Version: 5CVS-2005-10-28 (CVS) OS: Mac OS X
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: spheroid@php.net
New email:
PHP Version: OS:

 

 [2005-10-31 11:15 UTC] spheroid@php.net
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



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-01 02:43 UTC] wez@php.net
Provide a link to a downloadable patch against PHP_5_1 branch; your patch would not apply.
 [2005-11-01 13:00 UTC] spheroid@php.net
Yeah, I was afraid this would happen. The patch can be downloaded at http://eloris.spheroid.info/~henkka/tmp/pdo_dblib-config.m4.patch
 [2005-11-01 14:28 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 20 19:03:35 2022 UTC