Skip to content

Commit a6d7d52

Browse files
authored
Autotools: Fix pdo_firebird shared build (#15371)
Follow-up of GH-15230: - Redundant variables removed - Redundant duplicate middle newlines removed - PHP_CXX_COMPILE_STDCXX macro arguments quoted - When extension is built as shared the PHP_ADD_SOURCES works differently, and PHP_ADD_SOURCES_X needs to be used so this can be used: ./configure --with-pdo-firebird=shared
1 parent 65e96c1 commit a6d7d52

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ext/pdo_firebird/config.m4

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then
1515
AC_MSG_RESULT([version $FB_VERSION])
1616
PHP_EVAL_LIBLINE([$FB_LIBDIR], [PDO_FIREBIRD_SHARED_LIBADD])
1717
PHP_EVAL_INCLINE([$FB_CFLAGS])
18-
1918
else
2019
AS_VAR_IF([PHP_PDO_FIREBIRD], [yes], [
2120
FIREBIRD_INCDIR=
@@ -45,24 +44,25 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then
4544

4645
PHP_CHECK_PDO_INCLUDES
4746

48-
49-
PHP_PDO_FIREBIRD_COMMON_FLAGS=""
5047
PHP_NEW_EXTENSION([pdo_firebird],
5148
[pdo_firebird.c firebird_driver.c firebird_statement.c],
52-
[$ext_shared],,
53-
[$PHP_PDO_FIREBIRD_COMMON_FLAGS],
49+
[$ext_shared],,,
5450
[cxx])
5551
PHP_SUBST([PDO_FIREBIRD_SHARED_LIBADD])
5652
PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo)
5753

58-
PHP_PDO_FIREBIRD_CXX_SOURCES="pdo_firebird_utils.cpp"
59-
6054
PHP_REQUIRE_CXX()
61-
PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_PDO_FIREBIRD_STDCXX)
62-
PHP_PDO_FIREBIRD_CXX_FLAGS="$PHP_PDO_FIREBIRD_COMMON_FLAGS $PHP_PDO_FIREBIRD_STDCXX"
55+
PHP_CXX_COMPILE_STDCXX([11], [mandatory], [PHP_PDO_FIREBIRD_STDCXX])
6356

64-
PHP_ADD_SOURCES([$ext_dir],
65-
[$PHP_PDO_FIREBIRD_CXX_SOURCES],
66-
[$PHP_PDO_FIREBIRD_CXX_FLAGS])
57+
PHP_PDO_FIREBIRD_CXX_SOURCES="pdo_firebird_utils.cpp"
6758

59+
AS_VAR_IF([ext_shared], [no],
60+
[PHP_ADD_SOURCES([$ext_dir],
61+
[$PHP_PDO_FIREBIRD_CXX_SOURCES],
62+
[$PHP_PDO_FIREBIRD_STDCXX])],
63+
[PHP_ADD_SOURCES_X([$ext_dir],
64+
[$PHP_PDO_FIREBIRD_CXX_SOURCES],
65+
[$PHP_PDO_FIREBIRD_STDCXX],
66+
[shared_objects_pdo_firebird],
67+
[yes])])
6868
fi

0 commit comments

Comments
 (0)