]> granicus.if.org Git - php/commitdiff
- Fix build for distros where the header files are under */include/freetds/
authorfoobar <sniper@php.net>
Mon, 10 Oct 2005 09:50:24 +0000 (09:50 +0000)
committerfoobar <sniper@php.net>
Mon, 10 Oct 2005 09:50:24 +0000 (09:50 +0000)
ext/mssql/config.m4

index 13b38d958f552c0d1150f5c9b566004c917aa28b..27b87600c23320ca08f42532b0f46c057d78c6b7 100644 (file)
@@ -6,15 +6,17 @@ PHP_ARG_WITH(mssql,for MSSQL support via FreeTDS,
 [  --with-mssql[=DIR]      Include MSSQL-DB support.  DIR is the FreeTDS home
                           directory, defaults to /usr/local/freetds])
 
-
 if test "$PHP_MSSQL" != "no"; then
 
-  FREETDS_INSTALLATION_DIR=""
   if test "$PHP_MSSQL" = "yes"; then
-
     for i in /usr/local /usr; do
       if test -f $i/include/tds.h; then
         FREETDS_INSTALLATION_DIR=$i
+        FREETDS_INCLUDE_DIR=$/include
+        break
+      elif test -f $i/include/freetds/tds.h; then
+        FREETDS_INSTALLATION_DIR=$i
+        FREETDS_INCLUDE_DIR=$/include/freetds
         break
       fi
     done
@@ -27,6 +29,10 @@ if test "$PHP_MSSQL" != "no"; then
 
     if test -f $PHP_MSSQL/include/tds.h; then
       FREETDS_INSTALLATION_DIR=$PHP_MSSQL
+      FREETDS_INCLUDE_DIR=$/include
+    elif test -f $i/include/freetds/tds.h; then
+      FREETDS_INSTALLATION_DIR=$i
+      FREETDS_INCLUDE_DIR=$/include/freetds
     else
       AC_MSG_ERROR(Directory $PHP_MSSQL is not a FreeTDS installation directory)
     fi
@@ -36,11 +42,9 @@ if test "$PHP_MSSQL" != "no"; then
      AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libtds.[a|so])
   fi
 
-  MSSQL_INCDIR=$FREETDS_INSTALLATION_DIR/include
-  MSSQL_LIBDIR=$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR
+  PHP_ADD_INCLUDE($FREETDS_INCLUDE_DIR)
+  PHP_ADD_LIBRARY_WITH_PATH(sybdb, $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, MSSQL_SHARED_LIBADD)
 
-  PHP_ADD_INCLUDE($MSSQL_INCDIR)
-  PHP_ADD_LIBRARY_WITH_PATH(sybdb, $MSSQL_LIBDIR, MSSQL_SHARED_LIBADD)
   PHP_NEW_EXTENSION(mssql, php_mssql.c, $ext_shared)
   AC_CHECK_LIB(dnet_stub, dnet_addr,
      [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,MSSQL_SHARED_LIBADD)