From 0af71a13603c5d0a49ddcb5ab7a4a5b32ba73643 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 19 Aug 2024 19:08:19 +0200 Subject: [PATCH 1/5] Document fbclient 3.0+ version requirement --- UPGRADING | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UPGRADING b/UPGRADING index 6e20a824b089c..d9bc98f9b550a 100644 --- a/UPGRADING +++ b/UPGRADING @@ -148,7 +148,8 @@ PHP 8.4 UPGRADE NOTES - PDO_FIREBIRD: . Since some Firebird C++ APIs are used now, this extension requires a C++ - compiler to be built. + compiler to be built. This also implies that the extension has to be built + against fbclient 3.0 or higher. . getAttribute, ATTR_AUTOCOMMIT has been changed to get the value as a bool. - PDO_MYSQL: From d6e27dc3a258cb25826746b6651392bfbcdc84f5 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 19 Aug 2024 19:39:50 +0200 Subject: [PATCH 2/5] Check existence of Interface.h Since we now require fbclient (3.0), we can drop support for the Interbase gds32_ms.lib right away. --- ext/pdo_firebird/config.w32 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ext/pdo_firebird/config.w32 b/ext/pdo_firebird/config.w32 index f7cd342120ff2..003a1a677082a 100644 --- a/ext/pdo_firebird/config.w32 +++ b/ext/pdo_firebird/config.w32 @@ -4,11 +4,12 @@ ARG_WITH("pdo-firebird", "Firebird support for PDO", "no"); if (PHP_PDO_FIREBIRD != "no") { - if ((CHECK_LIB("fbclient_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD) - || CHECK_LIB("gds32_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD) - ) && CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_PDO_FIREBIRD", - PHP_PHP_BUILD + "\\include\\interbase;" + PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD) - ) { + if (CHECK_LIB("fbclient_ms.lib", "pdo_firebird", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_PDO_FIREBIRD) + && CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_PDO_FIREBIRD", + PHP_PHP_BUILD + "\\include\\interbase;" + PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD) + && CHECK_HEADER_ADD_INCLUDE("firebird\\Interface.h", "CFLAGS_PDO_FIREBIRD", + PHP_PHP_BUILD + "\\include\\interbase;" + PHP_PHP_BUILD + "\\interbase\\include;" + PHP_PDO_FIREBIRD) + ) { EXTENSION("pdo_firebird", "pdo_firebird.c firebird_driver.c firebird_statement.c pdo_firebird_utils.cpp"); ADD_FLAG("CFLAGS_PDO_FIREBIRD", "/EHsc"); From 45b097894a872070058e1c3ff2161c86c8eeb7ad Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 19 Aug 2024 20:49:40 +0200 Subject: [PATCH 3/5] 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. --- ext/pdo_firebird/config.m4 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4 index 18db4eda20897..c2472182705c3 100644 --- a/ext/pdo_firebird/config.m4 +++ b/ext/pdo_firebird/config.m4 @@ -28,13 +28,7 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then PHP_CHECK_LIBRARY([fbclient], [isc_detach_database], [FIREBIRD_LIBNAME=fbclient], - [PHP_CHECK_LIBRARY([gds], [isc_detach_database], - [FIREBIRD_LIBNAME=gds], - [PHP_CHECK_LIBRARY([ib_util], [isc_detach_database], - [FIREBIRD_LIBNAME=ib_util], - [AC_MSG_FAILURE([libfbclient, libgds or libib_util not found.])], - [$FIREBIRD_LIBDIR_FLAG])], - [$FIREBIRD_LIBDIR_FLAG])], + [AC_MSG_FAILURE([libfbclient not found.])], [$FIREBIRD_LIBDIR_FLAG]) PHP_ADD_LIBRARY_WITH_PATH([$FIREBIRD_LIBNAME], [$FIREBIRD_LIBDIR], From c350715f151542c988306edd93f7185ae4b99f13 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 19 Aug 2024 20:54:36 +0200 Subject: [PATCH 4/5] Check for minimum required libfbclient version with fb_config Co-authored-by: Peter Kokot --- ext/pdo_firebird/config.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4 index c2472182705c3..964e751333ce2 100644 --- a/ext/pdo_firebird/config.m4 +++ b/ext/pdo_firebird/config.m4 @@ -13,6 +13,8 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then FB_LIBDIR=$($FB_CONFIG --libs) FB_VERSION=$($FB_CONFIG --version) AC_MSG_RESULT([version $FB_VERSION]) + AS_VERSION_COMPARE([$FB_VERSION], [3.0], + [AC_MSG_ERROR([Firebird required version is at least 3.0])]) PHP_EVAL_LIBLINE([$FB_LIBDIR], [PDO_FIREBIRD_SHARED_LIBADD]) PHP_EVAL_INCLINE([$FB_CFLAGS]) else From 6b33f9b3b9bc3a7f55cdb3bb9b5500a00904684a Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Tue, 20 Aug 2024 11:50:21 +0200 Subject: [PATCH 5/5] config.m4: check for `fb_get_master_interface()` and simplify Co-authored-by: Peter Kokot --- ext/pdo_firebird/config.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4 index 964e751333ce2..f328dbd03b1b5 100644 --- a/ext/pdo_firebird/config.m4 +++ b/ext/pdo_firebird/config.m4 @@ -28,11 +28,11 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then FIREBIRD_LIBDIR_FLAG=-L$FIREBIRD_LIBDIR ]) - PHP_CHECK_LIBRARY([fbclient], [isc_detach_database], - [FIREBIRD_LIBNAME=fbclient], + PHP_CHECK_LIBRARY([fbclient], [fb_get_master_interface], + [], [AC_MSG_FAILURE([libfbclient not found.])], [$FIREBIRD_LIBDIR_FLAG]) - PHP_ADD_LIBRARY_WITH_PATH([$FIREBIRD_LIBNAME], + PHP_ADD_LIBRARY_WITH_PATH([fbclient], [$FIREBIRD_LIBDIR], [PDO_FIREBIRD_SHARED_LIBADD]) PHP_ADD_INCLUDE([$FIREBIRD_INCDIR])