diff --git a/CHANGELOG.md b/CHANGELOG.md index e9f5a9d74..07a2b9b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Removed configuration variables: * Aspell_ROOT * Cclient_ROOT +* EXT_DBA_GDBM * EXT_IMAP * EXT_IMAP_KERBEROS * EXT_IMAP_SHARED diff --git a/README.md b/README.md index ba6cc54ef..53891a01f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cmake/cmake/modules/FindDbm.cmake b/cmake/cmake/modules/FindDbm.cmake index cf5751710..b831eb07b 100644 --- a/cmake/cmake/modules/FindDbm.cmake +++ b/cmake/cmake/modules/FindDbm.cmake @@ -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 @@ -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 @@ -72,7 +71,6 @@ else() find_path( Dbm_INCLUDE_DIR NAMES dbm.h - PATH_SUFFIXES gdbm DOC "Directory containing dbm library headers" ) @@ -82,9 +80,7 @@ else() find_library( Dbm_LIBRARY - NAMES - gdbm_compat - dbm + NAMES dbm DOC "The path to the dbm library" ) @@ -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 diff --git a/cmake/cmake/modules/FindGDBM.cmake b/cmake/cmake/modules/FindGDBM.cmake deleted file mode 100644 index 0320817d7..000000000 --- a/cmake/cmake/modules/FindGDBM.cmake +++ /dev/null @@ -1,95 +0,0 @@ -#[=============================================================================[ -Find the GDBM library. - -Module defines the following `IMPORTED` target(s): - -* `GDBM::GDBM` - The package library, if found. - -## Result variables - -* `GDBM_FOUND` - Whether the package has been found. -* `GDBM_INCLUDE_DIRS` - Include directories needed to use this package. -* `GDBM_LIBRARIES` - Libraries needed to link to the package library. - -## Cache variables - -* `GDBM_INCLUDE_DIR` - Directory containing package library headers. -* `GDBM_LIBRARY` - The path to the package library. - -## Hints - -* The `GDBM_ROOT` variable adds custom search path. -#]=============================================================================] - -include(CheckLibraryExists) -include(FeatureSummary) -include(FindPackageHandleStandardArgs) - -set_package_properties( - Dbm - PROPERTIES - URL "https://www.gnu.org.ua/software/gdbm/" - DESCRIPTION "GNU dbm key-value database library" -) - -set(_reason "") - -find_path( - GDBM_INCLUDE_DIR - NAMES gdbm.h - DOC "Directory containing GDBM library headers" -) - -if(NOT GDBM_INCLUDE_DIR) - string(APPEND _reason "gdbm.h not found. ") -endif() - -find_library( - GDBM_LIBRARY - NAMES gdbm - DOC "The path to the GDBM library" -) - -if(NOT GDBM_LIBRARY) - string(APPEND _reason "GDBM library not found. ") -endif() - -# Sanity check. -if(GDBM_LIBRARY) - check_library_exists("${GDBM_LIBRARY}" gdbm_open "" _gdbm_sanity_check) - - if(NOT _gdbm_sanity_check) - string(APPEND _reason "Sanity check failed: gdbm_open not found. ") - endif() -endif() - -mark_as_advanced(GDBM_INCLUDE_DIR GDBM_LIBRARY) - -find_package_handle_standard_args( - GDBM - REQUIRED_VARS - GDBM_LIBRARY - GDBM_INCLUDE_DIR - _gdbm_sanity_check - REASON_FAILURE_MESSAGE "${_reason}" -) - -unset(_reason) - -if(NOT GDBM_FOUND) - return() -endif() - -set(GDBM_INCLUDE_DIRS ${GDBM_INCLUDE_DIR}) -set(GDBM_LIBRARIES ${GDBM_LIBRARY}) - -if(NOT TARGET GDBM::GDBM) - add_library(GDBM::GDBM UNKNOWN IMPORTED) - - set_target_properties( - GDBM::GDBM - PROPERTIES - IMPORTED_LOCATION "${GDBM_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${GDBM_INCLUDE_DIR}" - ) -endif() diff --git a/cmake/cmake/modules/FindNdbm.cmake b/cmake/cmake/modules/FindNdbm.cmake index 48125524d..fb3a44e05 100644 --- a/cmake/cmake/modules/FindNdbm.cmake +++ b/cmake/cmake/modules/FindNdbm.cmake @@ -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): @@ -78,7 +79,6 @@ else() Ndbm_LIBRARY NAMES ndbm - gdbm_compat db1 DOC "The path to the ndbm library" ) diff --git a/cmake/ext/dba/CMakeLists.txt b/cmake/ext/dba/CMakeLists.txt index 05845ed22..ef69a03c7 100644 --- a/cmake/ext/dba/CMakeLists.txt +++ b/cmake/ext/dba/CMakeLists.txt @@ -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" @@ -164,7 +150,7 @@ 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( @@ -172,13 +158,7 @@ add_feature_info( 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 " @@ -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 "") set(DBA_DBM 1) - set(DBM_VERSION "${Dbm_IMPLEMENTATION}") + set(DBM_VERSION "DBM") endif() ################################################################################ @@ -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 "") - set(DBA_GDBM 1) -endif() - ################################################################################ # INI-file support. ################################################################################ @@ -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) @@ -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 diff --git a/cmake/ext/dba/config.cmake.h.in b/cmake/ext/dba/config.cmake.h.in index a0a0619b5..0d97ae2ad 100644 --- a/cmake/ext/dba/config.cmake.h.in +++ b/cmake/ext/dba/config.cmake.h.in @@ -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 @@ -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 diff --git a/docs/cmake/cmake.md b/docs/cmake/cmake.md index c21c160a6..cd0b6c8df 100644 --- a/docs/cmake/cmake.md +++ b/docs/cmake/cmake.md @@ -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 diff --git a/docs/cmake/configuration.md b/docs/cmake/configuration.md index e6c965354..7eb4aca80 100644 --- a/docs/cmake/configuration.md +++ b/docs/cmake/configuration.md @@ -1196,7 +1196,7 @@ A list of Autoconf `configure` command-line configuration options, Windows  --without-gdbm N/A EXT_DBA_GDBM=OFF - default + default, removed in CMake PHP 8.4  --with-gdbm[=DIR] @@ -1205,7 +1205,7 @@ A list of Autoconf `configure` command-line configuration options, Windows EXT_DBA_GDBM=ON
[GDBM_ROOT=DIR] - + removed in CMake PHP 8.4  --without-ndbm @@ -2860,7 +2860,7 @@ A list of Autoconf `configure` command-line configuration options, Windows EXT_READLINE_LIBREADLINE=ON (PHP <= 8.3)
[Readline_ROOT=DIR] (PHP <= 8.3) - CMake PHP 8.4 Readline library was removed + In CMake PHP 8.4 GNU Readline support was replaced in libedit only  --with-readline=shared diff --git a/docs/cmake/differences.md b/docs/cmake/differences.md index 58e821a75..b01b51a30 100644 --- a/docs/cmake/differences.md +++ b/docs/cmake/differences.md @@ -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 diff --git a/docs/cmake/modules/FindDbm.md b/docs/cmake/modules/FindDbm.md index da0a4278e..73ca9f284 100644 --- a/docs/cmake/modules/FindDbm.md +++ b/docs/cmake/modules/FindDbm.md @@ -13,7 +13,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 @@ -31,8 +32,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 diff --git a/docs/cmake/modules/FindGDBM.md b/docs/cmake/modules/FindGDBM.md deleted file mode 100644 index 057dfa039..000000000 --- a/docs/cmake/modules/FindGDBM.md +++ /dev/null @@ -1,30 +0,0 @@ -# FindGDBM - -See: [FindGDBM.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindGDBM.cmake) - -## Basic usage - -```cmake -find_package(GDBM) -``` - -Find the GDBM library. - -Module defines the following `IMPORTED` target(s): - -* `GDBM::GDBM` - The package library, if found. - -## Result variables - -* `GDBM_FOUND` - Whether the package has been found. -* `GDBM_INCLUDE_DIRS` - Include directories needed to use this package. -* `GDBM_LIBRARIES` - Libraries needed to link to the package library. - -## Cache variables - -* `GDBM_INCLUDE_DIR` - Directory containing package library headers. -* `GDBM_LIBRARY` - The path to the package library. - -## Hints - -* The `GDBM_ROOT` variable adds custom search path. diff --git a/docs/cmake/modules/FindNdbm.md b/docs/cmake/modules/FindNdbm.md index 09178873d..23ae5dc1f 100644 --- a/docs/cmake/modules/FindNdbm.md +++ b/docs/cmake/modules/FindNdbm.md @@ -13,8 +13,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): diff --git a/docs/cmake/variables/EXT_DBA.md b/docs/cmake/variables/EXT_DBA.md new file mode 100644 index 000000000..dfc0311c4 --- /dev/null +++ b/docs/cmake/variables/EXT_DBA.md @@ -0,0 +1,99 @@ +# `EXT_DBA` + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the PHP `dba` extension. + +## `EXT_DBA_SHARED` + +* Default: `OFF` +* Values: `ON|OFF` + +Build extension as shared library. + +## `EXT_DBA_CDB` + +* Default: `ON` +* Values: `ON|OFF` + +Enable the bundled constant databases (cdb) support. + +## `EXT_DBA_CDB_EXTERNAL` + +* Default: `OFF` +* Values: `ON|OFF` + +Use external (system) cdb library instead of the bundled sources. + +## `EXT_DBA_DB` + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the Oracle Berkeley DB support. + +## `EXT_DBA_DB1` + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the Oracle Berkeley DB 1.x support/emulation. + +## `EXT_DBA_DBM` + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the legacy (original) Berkeley DB style support. + +## `EXT_DBA_FLATFILE` + +* Default: `ON` +* Values: `ON|OFF` + +Enable the bundled flat-file DBA handler support. + +## `EXT_DBA_GDBM` + +:red_circle: *Removed as of PHP 8.4.* + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the GNU dbm (GDBM) support. + +## `EXT_DBA_INIFILE` + +* Default: `ON` +* Values: `ON|OFF` + +Enable the bundled INI-file DBA handler support. + +## `EXT_DBA_LMDB` + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the Lightning Memory-Mapped Database (LMDB) support. + +## `EXT_DBA_NDBM` + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the ndbm support. + +## `EXT_DBA_QDBM` + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the QDBM support. + +## `EXT_DBA_TCADB` + +* Default: `OFF` +* Values: `ON|OFF` + +Enable the Tokyo Cabinet abstract DB support. diff --git a/docs/dependencies.md b/docs/dependencies.md index f4337c288..5bce101d0 100644 --- a/docs/dependencies.md +++ b/docs/dependencies.md @@ -486,8 +486,6 @@ A list of various dependencies needed to build PHP from source: * when using `--with-password-argon2` * libedit * when using `--with-libedit` -* libreadline - * when using `--with-readline` * libsnmp * when using `--with-snmp` * libexpat1 @@ -518,11 +516,9 @@ A list of various dependencies needed to build PHP from source: * when using the `--with-lmdb` * libtokyocabinet * when using the `--with-tcadb` -* libgdbm - * when using the `--with-gdbm` * libqdbm * when using the `--with-qdbm` -* libgdbm or library implementing the ndbm or dbm compatibility interface +* library implementing the ndbm or dbm compatibility interface * when using the `--with-dbm` or `--with-ndbm` * libdb * when using the `--with-db4`, `--with-db3`, `--with-db2`, or `--with-db1`