Skip to content
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Removed configuration variables:

* Aspell_ROOT
* Cclient_ROOT
* EXT_DBA_GDBM
* EXT_IMAP
* EXT_IMAP_KERBEROS
* EXT_IMAP_SHARED
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sudo dnf install cmake gcc gcc-c++ bison sqlite-devel
brew install cmake bison # See https://brew.sh how to install Homebrew

# Prerequisites for Alpine Linux:
sudo apk add --no-cache cmake make gcc g++ bison sqlite-dev musl-dev
sudo apk add --no-cache cmake make gcc g++ musl-dev bison sqlite-dev

# Prerequisites for BSD-based systems:
sudo pkg install cmake bison sqlite3
Expand Down
16 changes: 3 additions & 13 deletions cmake/cmake/modules/FindDbm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Find the dbm library.
Depending on the system, the dbm library can be part of other libraries as an
interface.

* GNU dbm has compatibility interface via gdbm_compatibility
* GNU dbm library (GDBM) has compatibility interface via gdbm_compatibility but
it is licensed as GPL 3, which is incompatible with PHP.
* TODO: Built into default libraries (C): Solaris still has some macros
definitions mapping to internal dbm functions available in the db.h header.
When defining `DB_DBM_HSEARCH` dbm handler is available as built into C
Expand All @@ -22,8 +23,6 @@ Module defines the following `IMPORTED` target(s):
* `Dbm_IS_BUILT_IN` - Whether dbm is a part of the C library.
* `Dbm_INCLUDE_DIRS` - Include directories needed to use this package.
* `Dbm_LIBRARIES` - Libraries needed to link to the package library.
* `Dbm_IMPLEMENTATION` - String of the library name that implements the dbm
library.

## Cache variables

Expand Down Expand Up @@ -72,7 +71,6 @@ else()
find_path(
Dbm_INCLUDE_DIR
NAMES dbm.h
PATH_SUFFIXES gdbm
DOC "Directory containing dbm library headers"
)

Expand All @@ -82,9 +80,7 @@ else()

find_library(
Dbm_LIBRARY
NAMES
gdbm_compat
dbm
NAMES dbm
DOC "The path to the dbm library"
)

Expand All @@ -104,12 +100,6 @@ else()
mark_as_advanced(Dbm_INCLUDE_DIR Dbm_LIBRARY)
endif()

if(Dbm_LIBRARY MATCHES "gdbm_compat")
set(Dbm_IMPLEMENTATION "GDBM")
elseif(Dbm_LIBRARY)
set(Dbm_IMPLEMENTATION "DBM")
endif()

find_package_handle_standard_args(
Dbm
REQUIRED_VARS
Expand Down
95 changes: 0 additions & 95 deletions cmake/cmake/modules/FindGDBM.cmake

This file was deleted.

6 changes: 3 additions & 3 deletions cmake/cmake/modules/FindNdbm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Find the ndbm library.
Depending on the system, the nbdm ("new" dbm) can be part of other libraries as
an interface.
* GNU dbm library (GDBM) has a compatibility interface that provides ndbm.h
header and gdbm_compat library.
* GNU dbm library (GDBM) has compatibility interface via gdbm_compatibility that
provides ndbm.h header but it is licensed as GPL 3, which is incompatible with
PHP.
* Built into default libraries (C): BSD-based systems, macOS, Solaris.
Module defines the following `IMPORTED` target(s):
Expand Down Expand Up @@ -78,7 +79,6 @@ else()
Ndbm_LIBRARY
NAMES
ndbm
gdbm_compat
db1
DOC "The path to the ndbm library"
)
Expand Down
78 changes: 4 additions & 74 deletions cmake/ext/dba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,6 @@ add_feature_info(
"bundled flat-file DBA handler support"
)

cmake_dependent_option(
EXT_DBA_GDBM
"DBA: Enable the GNU dbm (GDBM) support"
OFF
[[EXT_DBA AND NOT EXT_DBA_QDBM]]
OFF
)
mark_as_advanced(EXT_DBA_GDBM)
add_feature_info(
"ext/dba GDBM"
EXT_DBA_GDBM
"GNU dbm support"
)

cmake_dependent_option(
EXT_DBA_INIFILE
"DBA: Enable the bundled INI-file DBA handler support"
Expand Down Expand Up @@ -164,21 +150,15 @@ cmake_dependent_option(
EXT_DBA_QDBM
"DBA: Enable the QDBM support"
OFF
[[EXT_DBA AND NOT EXT_DBA_DBM AND NOT EXT_DBA_GDBM]]
[[EXT_DBA AND NOT EXT_DBA_DBM]]
OFF
)
add_feature_info(
"ext/dba QDBM"
EXT_DBA_QDBM
"Quick Database Manager support"
)
if(EXT_DBA_QDBM AND EXT_DBA_GDBM)
message(
FATAL_ERROR
"You cannot combine EXT_DBA_GDBM with EXT_DBA_QDBM. Please select either "
"GDBM or QDBM."
)
elseif(EXT_DBA_QDBM AND EXT_DBA_DBM)
if(EXT_DBA_QDBM AND EXT_DBA_DBM)
message(
FATAL_ERROR
"You cannot combine EXT_DBA_DBM with EXT_DBA_QDBM. Please select either "
Expand Down Expand Up @@ -327,24 +307,13 @@ if(EXT_DBA_DBM)
PURPOSE "Necessary to enable the DBM support in the dba extension."
)

if(Dbm_LIBRARY MATCHES "gdbm")
message(
WARNING
"The GNU dbm (GDBM) library is licensed under the GNU GPL 3, which is "
"not compatible with the PHP license. PHP then shouldn't be distributed. "
"The EXT_DBA_DBM is a legacy artifact for testing purposes. The "
"recommendation for using and distributing the PHP 'dba' extension is to "
"disable the EXT_DBA_DBM."
)
endif()

target_link_libraries(php_dba PRIVATE Dbm::Dbm)

target_sources(php_dba PRIVATE dba_dbm.c)

set(DBM_INCLUDE_FILE "<dbm.h>")
set(DBA_DBM 1)
set(DBM_VERSION "${Dbm_IMPLEMENTATION}")
set(DBM_VERSION "DBM")
endif()

################################################################################
Expand All @@ -361,34 +330,6 @@ if(EXT_DBA_FLATFILE)
set(DBA_FLATFILE 1)
endif()

################################################################################
# The GNU dbm (GDBM) support.
################################################################################
if(EXT_DBA_GDBM)
message(
WARNING
"The GNU dbm (GDBM) library is licensed under the GNU GPL 3, which is not "
"compatible with the PHP license. PHP then shouldn't be distributed. The "
"recommendation for using and distributing the PHP 'dba' extension is to "
"disable EXT_DBA_GDBM."
)

find_package(GDBM)
set_package_properties(
GDBM
PROPERTIES
TYPE REQUIRED
PURPOSE "Necessary to enable the GDBM support in the dba extension."
)

target_link_libraries(php_dba PRIVATE GDBM::GDBM)

target_sources(php_dba PRIVATE dba_gdbm.c)

set(GDBM_INCLUDE_FILE "<gdbm.h>")
set(DBA_GDBM 1)
endif()

################################################################################
# INI-file support.
################################################################################
Expand Down Expand Up @@ -435,17 +376,6 @@ if(EXT_DBA_NDBM)
PURPOSE "Necessary to enable the ndbm support in the dba extension."
)

if(Ndbm_LIBRARY MATCHES "gdbm")
message(
WARNING
"The GNU dbm (GDBM) library is licensed under the GNU GPL 3, which is "
"not compatible with the PHP license. PHP then shouldn't be distributed. "
"The EXT_DBA_NDBM is a legacy artifact for testing purposes. The "
"recommendation for using and distributing the PHP 'dba' extension is to "
"disable the EXT_DBA_NDBM."
)
endif()

target_link_libraries(php_dba PRIVATE Ndbm::Ndbm)

target_sources(php_dba PRIVATE dba_ndbm.c)
Expand All @@ -457,7 +387,7 @@ endif()
################################################################################
# The qdbm handler support.
################################################################################
if(EXT_DBA_QDBM AND NOT EXT_DBA_DBM AND NOT EXT_DBA_GDBM)
if(EXT_DBA_QDBM AND NOT EXT_DBA_DBM)
find_package(QDBM)
set_package_properties(
QDBM
Expand Down
6 changes: 0 additions & 6 deletions cmake/ext/dba/config.cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
/* Define to 1 if the dba extension uses the bundled flatfile handler. */
#cmakedefine DBA_FLATFILE 1

/* Define to 1 if the dba extension uses the GDBM handler. */
#cmakedefine DBA_GDBM 1

/* Define to 1 if the dba extension uses the bundled inifile handler. */
#cmakedefine DBA_INIFILE 1

Expand All @@ -68,9 +65,6 @@
/* The DBM handler version information. */
#cmakedefine DBM_VERSION "@DBM_VERSION@"

/* The GDBM handler header file. */
#cmakedefine GDBM_INCLUDE_FILE @GDBM_INCLUDE_FILE@

/* Define to 1 if the PHP extension 'dba' is available. */
#cmakedefine HAVE_DBA 1

Expand Down
1 change: 1 addition & 0 deletions docs/cmake/cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ version available on the operating system.
* 3.24
* `CMAKE_COLOR_DIAGNOSTICS`
* `CMAKE_COMPILE_WARNING_AS_ERROR`, otherwise INTERFACE library should be used
* `if(PATH_EQUAL)`
* 3.25
* `block()` command
* New `try_run` signature
Expand Down
6 changes: 3 additions & 3 deletions docs/cmake/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ A list of Autoconf `configure` command-line configuration options, Windows
<td>&emsp;--without-gdbm</td>
<td>N/A</td>
<td>EXT_DBA_GDBM=OFF</td>
<td>default</td>
<td>default, removed in CMake PHP 8.4</td>
</tr>
<tr>
<td>&emsp;--with-gdbm[=DIR]</td>
Expand All @@ -1205,7 +1205,7 @@ A list of Autoconf `configure` command-line configuration options, Windows
EXT_DBA_GDBM=ON<br>
[GDBM_ROOT=DIR]
</td>
<td></td>
<td>removed in CMake PHP 8.4</td>
</tr>
<tr>
<td>&emsp;--without-ndbm</td>
Expand Down Expand Up @@ -2860,7 +2860,7 @@ A list of Autoconf `configure` command-line configuration options, Windows
EXT_READLINE_LIBREADLINE=ON <i>(PHP &lt;= 8.3)</i><br>
[Readline_ROOT=DIR] <i>(PHP &lt;= 8.3)</i>
</td>
<td>CMake PHP 8.4 Readline library was removed</td>
<td>In CMake PHP 8.4 GNU Readline support was replaced in libedit only</td>
</tr>
<tr>
<td>&emsp;--with-readline=shared</td>
Expand Down
15 changes: 12 additions & 3 deletions docs/cmake/differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,18 @@ build system:
* The phpdbg prompt with libedit integration is colored.
See: https://github.com/php/php-src/pull/15722

* ext/readline is linked with libedit by default instead of the GPL licensed GNU
Readline.
See: https://github.com/php/php-src/issues/15882
* GPL 3 licensed dependencies are removed as they are not compatible with PHP
license. When such dependencies are linked statically or dynamically, PHP
should be relicensed as GPL 3 (which is unrealistic), or it shouldn't be
distributed (which makes it unusable in server environments or package
repositories). As this is a gray area, removal of these dependencies improves
user experience and prevents misconfiguration.

* GDBM (GNU dbm) handler removed in ext/dba.
See: https://github.com/php/php-src/issues/16826

* ext/readline is linked with libedit and GNU Readline removed.
See: https://github.com/php/php-src/issues/15882

* Build with Clang on 32-bit systems.
See: https://github.com/php/php-src/issues/14467
Expand Down
Loading
Loading