summaryrefslogtreecommitdiff
path: root/ext/pdo_dblib/config.m4
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2005-07-12 12:16:02 +0000
committerWez Furlong <wez@php.net>2005-07-12 12:16:02 +0000
commit04dd0e1094cebff3ea70bd065b78b4bbb95a2a0d (patch)
treed065289af5fafeb60dc3cb32a906ec0aa4ab921d /ext/pdo_dblib/config.m4
parentbf9288d457e592c5fe3e653fc14edd7f2547df18 (diff)
downloadphp-git-04dd0e1094cebff3ea70bd065b78b4bbb95a2a0d.tar.gz
Enable unix build for dblib/sybase/freetds.
The extension is named pdo_dblib and the driver dblib on unix.
Diffstat (limited to 'ext/pdo_dblib/config.m4')
-rw-r--r--ext/pdo_dblib/config.m457
1 files changed, 57 insertions, 0 deletions
diff --git a/ext/pdo_dblib/config.m4 b/ext/pdo_dblib/config.m4
new file mode 100644
index 0000000000..ee6f537010
--- /dev/null
+++ b/ext/pdo_dblib/config.m4
@@ -0,0 +1,57 @@
+dnl
+dnl $Id$
+dnl
+
+if test "$PHP_PDO" != "no"; then
+PHP_ARG_WITH(pdo-dblib, for PDO_DBLIB support via FreeTDS,
+[ --with-pdo-dblib[=DIR] Include PDO_DBLIB-DB support. DIR is the FreeTDS home
+ directory])
+
+
+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
+ break
+ fi
+ done
+
+ if test -z "$PDO_FREETDS_INSTALLATION_DIR"; then
+ AC_MSG_ERROR(Cannot find FreeTDS in known installation directories)
+ fi
+
+ elif test "$PHP_PDO_DBLIB" != "no"; then
+
+ if test -f $PHP_PDO_DBLIB/include/tds.h; then
+ PDO_FREETDS_INSTALLATION_DIR=$PHP_PDO_DBLIB
+ else
+ AC_MSG_ERROR(Directory $PHP_PDO_DBLIB is not a FreeTDS installation directory)
+ fi
+ 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])
+ fi
+
+ PDO_DBLIB_INCDIR=$PDO_FREETDS_INSTALLATION_DIR/include
+ PDO_DBLIB_LIBDIR=$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR
+
+ PHP_ADD_INCLUDE($PDO_DBLIB_INCDIR)
+ PHP_ADD_LIBRARY_WITH_PATH(sybdb, $PDO_DBLIB_LIBDIR, PDO_DBLIB_SHARED_LIBADD)
+ PHP_CHECK_PDO_INCLUDES
+ PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\""
+ PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_DBLIB_DEFS)
+ AC_CHECK_LIB(dnet_stub, dnet_addr,
+ [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,PDO_DBLIB_SHARED_LIBADD)
+ AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ])
+ ])
+ AC_DEFINE(HAVE_PDO_DBLIB,1,[ ])
+ AC_DEFINE(HAVE_FREETDS,1,[ ])
+ PHP_SUBST(PDO_DBLIB_SHARED_LIBADD)
+fi
+
+fi