summaryrefslogtreecommitdiff
path: root/ext/pdo_dblib/config.m4
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_dblib/config.m4')
-rw-r--r--ext/pdo_dblib/config.m442
1 files changed, 16 insertions, 26 deletions
diff --git a/ext/pdo_dblib/config.m4 b/ext/pdo_dblib/config.m4
index b6cbc01a5a..4160cd9596 100644
--- a/ext/pdo_dblib/config.m4
+++ b/ext/pdo_dblib/config.m4
@@ -10,23 +10,13 @@ if test "$PHP_PDO_DBLIB" != "no"; then
fi
if test "$PHP_PDO_DBLIB" = "yes"; then
-
- for i in /usr/local /usr; do
- 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
-
- if test -z "$PDO_FREETDS_INSTALLATION_DIR"; then
- AC_MSG_ERROR(Cannot find FreeTDS in known installation directories)
- fi
-
+ dnl FreeTDS must be on the default system include/library path.
+ dnl Only perform a sanity check that this is really the case.
+ PHP_CHECK_LIBRARY(sybdb, dbsqlexec,
+ [],[
+ AC_MSG_ERROR([Cannot find FreeTDS in known installation directories])
+ ])
+ PHP_ADD_LIBRARY(sybdb,,GMP_SHARED_LIBADD)
elif test "$PHP_PDO_DBLIB" != "no"; then
if test -f $PHP_PDO_DBLIB/include/sybdb.h; then
@@ -38,18 +28,18 @@ if test "$PHP_PDO_DBLIB" != "no"; then
else
AC_MSG_ERROR(Directory $PHP_PDO_DBLIB is not a FreeTDS installation directory)
fi
- fi
- if test "x$PHP_LIBDIR" = "x" ; then
- PHP_LIBDIR=lib
- fi
+ if test "x$PHP_LIBDIR" = "x" ; then
+ PHP_LIBDIR=lib
+ fi
- 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
+ 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
- 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_FREETDS_INCLUDE_DIR)
+ PHP_ADD_LIBRARY_WITH_PATH(sybdb, $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, PDO_DBLIB_SHARED_LIBADD)
+ fi
PHP_CHECK_PDO_INCLUDES