Skip to content

Cater to raised requirement of fbclient 3.0+ for pdo_firebird #15498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 6 additions & 10 deletions ext/pdo_firebird/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,17 +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([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])],
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])
Expand Down
11 changes: 6 additions & 5 deletions ext/pdo_firebird/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Loading