com php-src: Allow building dblib with machine-dependent libdir: ext/pdo_dblib/config.m4
| From: | Nikita Popov | Date: | Mon, 14 Dec 2020 09:25:03 +0000 |
| Subject: | com php-src: Allow building dblib with machine-dependent libdir: ext/pdo_dblib/config.m4 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-114429@lists.php.net to get a copy of this message | ||
Commit: 47fe4125189833e80eac8c09f7d1cf83b10aeb0d
Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 14 Dec 2020 10:17:57 +0100
Parents: aa58db723221ec891d4432621003bfa55dc15edf
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=47fe4125189833e80eac8c09f7d1cf83b10aeb0d
Log:
Allow building dblib with machine-dependent libdir
Use the same approach as for GMP: If no explicit directory is
given, assume it must be on the default include path and libdir.
Otherwise use the provided path. It does not look like libsybdb
has support for pkg-config.
Changed paths:
M ext/pdo_dblib/config.m4
Diff:
diff --git a/ext/pdo_dblib/config.m4 b/ext/pdo_dblib/config.m4
index b6cbc01a5a3..4160cd9596f 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