]> granicus.if.org Git - php/commitdiff
- Fixed bug #44991 (Compile Failure With freetds0.82) (patch by matthias at dsx dot at)
authorFelipe Pena <felipe@php.net>
Sat, 4 Oct 2008 12:51:51 +0000 (12:51 +0000)
committerFelipe Pena <felipe@php.net>
Sat, 4 Oct 2008 12:51:51 +0000 (12:51 +0000)
- MFB: Fix #35032; pdo_dblib doesn't find includes on some systems

ext/pdo_dblib/config.m4

index f2600b2396b6f36e535b4f9e2df1ab38a653548c..3410ba9c6b8f39925a5c43f2b1bdef51a7cb60da 100644 (file)
@@ -11,13 +11,17 @@ if test "$PHP_PDO_DBLIB" != "no"; then
     AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
   fi
 
-  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
+      if test -f $i/include/sybdb.h; then
         PDO_FREETDS_INSTALLATION_DIR=$i
+        PDO_FREETDS_INCLUDE_DIR=$i/include
         break
+      elif test -f $i/include/freetds/sybdb.h; then
+        PDO_FREETDS_INSTALLATION_DIR=$i
+        PDO_FREETDS_INCLUDE_DIR=$i/include/freetds
+        break;
       fi
     done
 
@@ -27,8 +31,12 @@ if test "$PHP_PDO_DBLIB" != "no"; then
 
   elif test "$PHP_PDO_DBLIB" != "no"; then
 
-    if test -f $PHP_PDO_DBLIB/include/tds.h; then
+    if test -f $PHP_PDO_DBLIB/include/sybdb.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/sybdb.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
@@ -38,15 +46,13 @@ if test "$PHP_PDO_DBLIB" != "no"; then
     PHP_LIBDIR=lib
   fi
 
-  if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.so"; then
-     AC_MSG_ERROR(Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so])
+  if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
+     AC_MSG_ERROR(Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[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