Skip to content

Commit 9684007

Browse files
cmb69petk
andauthored
Cater to raised requirement of fbclient 3.0+ for pdo_firebird (GH-15498)
We * Document the fbclient 3.0+ version requirement * Windows: check existence of Interface.h Since we now require fbclient (3.0), we can drop support for the Interbase gds32_ms.lib right away. * POSIX: check for minimum required libfbclient version with fb_config * POSIX: check for `fb_get_master_interface()` The existence of `isc_detach_database` is implied by this. * POSIX: remove detection of unsupported or even wrong libraries libgds is for old Interbase which is incompatible with pdo_firebird for may years, and libib_util is a utitity library, not a replacement for libfbclient. Co-authored-by: Peter Kokot <peterkokot@gmail.com>
1 parent 57f02e2 commit 9684007

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

UPGRADING

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ PHP 8.4 UPGRADE NOTES
148148

149149
- PDO_FIREBIRD:
150150
. Since some Firebird C++ APIs are used now, this extension requires a C++
151-
compiler to be built.
151+
compiler to be built. This also implies that the extension has to be built
152+
against fbclient 3.0 or higher.
152153
. getAttribute, ATTR_AUTOCOMMIT has been changed to get the value as a bool.
153154

154155
- PDO_MYSQL:

ext/pdo_firebird/config.m4

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then
1313
FB_LIBDIR=$($FB_CONFIG --libs)
1414
FB_VERSION=$($FB_CONFIG --version)
1515
AC_MSG_RESULT([version $FB_VERSION])
16+
AS_VERSION_COMPARE([$FB_VERSION], [3.0],
17+
[AC_MSG_ERROR([Firebird required version is at least 3.0])])
1618
PHP_EVAL_LIBLINE([$FB_LIBDIR], [PDO_FIREBIRD_SHARED_LIBADD])
1719
PHP_EVAL_INCLINE([$FB_CFLAGS])
1820
else
@@ -26,17 +28,11 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then
2628
FIREBIRD_LIBDIR_FLAG=-L$FIREBIRD_LIBDIR
2729
])
2830

29-
PHP_CHECK_LIBRARY([fbclient], [isc_detach_database],
30-
[FIREBIRD_LIBNAME=fbclient],
31-
[PHP_CHECK_LIBRARY([gds], [isc_detach_database],
32-
[FIREBIRD_LIBNAME=gds],
33-
[PHP_CHECK_LIBRARY([ib_util], [isc_detach_database],
34-
[FIREBIRD_LIBNAME=ib_util],
35-
[AC_MSG_FAILURE([libfbclient, libgds or libib_util not found.])],
36-
[$FIREBIRD_LIBDIR_FLAG])],
37-
[$FIREBIRD_LIBDIR_FLAG])],
31+
PHP_CHECK_LIBRARY([fbclient], [fb_get_master_interface],
32+
[],
33+
[AC_MSG_FAILURE([libfbclient not found.])],
3834
[$FIREBIRD_LIBDIR_FLAG])
39-
PHP_ADD_LIBRARY_WITH_PATH([$FIREBIRD_LIBNAME],
35+
PHP_ADD_LIBRARY_WITH_PATH([fbclient],
4036
[$FIREBIRD_LIBDIR],
4137
[PDO_FIREBIRD_SHARED_LIBADD])
4238
PHP_ADD_INCLUDE([$FIREBIRD_INCDIR])

ext/pdo_firebird/config.w32

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ ARG_WITH("pdo-firebird", "Firebird support for PDO", "no");
44

55
if (PHP_PDO_FIREBIRD != "no") {
66

7-
if ((CHECK_LIB("fbclient_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD)
8-
|| CHECK_LIB("gds32_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD)
9-
) && CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_PDO_FIREBIRD",
10-
PHP_PHP_BUILD + "\\include\\interbase;" + PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD)
11-
) {
7+
if (CHECK_LIB("fbclient_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD)
8+
&& CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_PDO_FIREBIRD",
9+
PHP_PHP_BUILD + "\\include\\interbase;" + PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD)
10+
&& CHECK_HEADER_ADD_INCLUDE("firebird\\Interface.h", "CFLAGS_PDO_FIREBIRD",
11+
PHP_PHP_BUILD + "\\include\\interbase;" + PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD)
12+
) {
1213

1314
EXTENSION("pdo_firebird", "pdo_firebird.c firebird_driver.c firebird_statement.c pdo_firebird_utils.cpp");
1415
ADD_FLAG("CFLAGS_PDO_FIREBIRD", "/EHsc");

0 commit comments

Comments
 (0)