├── docs ├── images │ ├── ccmake.png │ ├── cmake-gui.png │ ├── elephpant.jpg │ ├── cmake-gui-3.png │ ├── cmake-gui-2-setup.png │ └── cmake-profiling.png ├── cmake │ ├── variables │ │ ├── PHP_IPV6.md │ │ ├── PHP_LIBGCC.md │ │ ├── PHP_BUILD_PROVIDER.md │ │ ├── PHP_BUILD_ARCH.md │ │ ├── PHP_BUILD_COMPILER.md │ │ ├── _PHP_UNDEFINED_SANITIZER.md │ │ ├── PHP_RE2C_COMPUTED_GOTOS.md │ │ ├── PHP_SIGCHILD.md │ │ ├── PHP_DEFAULT_SHORT_OPEN_TAG.md │ │ ├── PHP_GCOV.md │ │ ├── PHP_DMALLOC.md │ │ ├── PHP_VALGRIND.md │ │ ├── _PHP_ADDRESS_SANITIZER.md │ │ ├── PHP_DTRACE.md │ │ ├── PHP_ENABLE_CMAKE_EXPERIMENTAL_FEATURES.md │ │ ├── PHP_VERBOSE_LINK.md │ │ ├── _PHP_MEMORY_SANITIZER.md │ │ ├── PHP_SED_EXECUTABLE.md │ │ ├── PHP_USE_RTLD_NOW.md │ │ ├── PHP_FD_SETSIZE.md │ │ ├── PHP_CONFIG_FILE_SCAN_DIR.md │ │ ├── PHP_SYSTEM_GLOB.md │ │ ├── PHP_ZEND_GLOBAL_REGISTER_VARIABLES.md │ │ ├── PHP_CCACHE.md │ │ ├── PHP_ZEND_SIGNALS.md │ │ ├── PHP_ZEND_FIBER_ASM.md │ │ ├── PHP_CONFIG_FILE_PATH.md │ │ ├── PHP_INCLUDE_PREFIX.md │ │ ├── PHP_ZEND_MAX_EXECUTION_TIMERS.md │ │ ├── PHP_THREAD_SAFETY.md │ │ ├── PHP_EXTENSION_DIR.md │ │ └── PHP_PEAR.md │ ├── ext │ │ ├── lexbor.md │ │ ├── spl.md │ │ ├── date.md │ │ ├── json.md │ │ ├── random.md │ │ ├── reflection.md │ │ ├── libxml.md │ │ ├── hash.md │ │ ├── uri.md │ │ ├── pdo.md │ │ ├── gmp.md │ │ ├── phar.md │ │ ├── filter.md │ │ ├── curl.md │ │ ├── pgsql.md │ │ ├── soap.md │ │ ├── zip.md │ │ ├── exif.md │ │ ├── shmop.md │ │ ├── snmp.md │ │ ├── sqlite3.md │ │ ├── xsl.md │ │ ├── bz2.md │ │ ├── calendar.md │ │ ├── dl_test.md │ │ ├── sysvshm.md │ │ ├── bcmath.md │ │ ├── enchant.md │ │ ├── ffi.md │ │ ├── intl.md │ │ ├── zlib.md │ │ ├── fileinfo.md │ │ ├── xmlreader.md │ │ ├── xmlwriter.md │ │ ├── ctype.md │ │ ├── dom.md │ │ ├── iconv.md │ │ ├── pdo_pgsql.md │ │ ├── sockets.md │ │ ├── zend_test.md │ │ ├── pdo_sqlite.md │ │ ├── simplexml.md │ │ ├── tidy.md │ │ ├── gettext.md │ │ ├── sodium.md │ │ ├── pdo_firebird.md │ │ ├── tokenizer.md │ │ ├── pdo_dblib.md │ │ ├── posix.md │ │ ├── sysvsem.md │ │ ├── readline.md │ │ ├── ftp.md │ │ ├── sysvmsg.md │ │ ├── xml.md │ │ ├── ldap.md │ │ ├── mbstring.md │ │ ├── pcntl.md │ │ ├── standard.md │ │ ├── session.md │ │ ├── pcre.md │ │ ├── pdo_mysql.md │ │ ├── mysqli.md │ │ ├── opcache.md │ │ ├── mysqlnd.md │ │ ├── gd.md │ │ └── com_dotnet.md │ ├── sapi │ │ ├── cgi.md │ │ ├── litespeed.md │ │ ├── cli.md │ │ ├── embed.md │ │ ├── fuzzer.md │ │ └── phpdbg.md │ ├── modules │ │ ├── PHP │ │ │ ├── Stubs.md │ │ │ ├── VerboseLink.md │ │ │ ├── Optimization.md │ │ │ ├── Extension.md │ │ │ ├── CheckBuiltin.md │ │ │ ├── LinkWhatYouUse.md │ │ │ └── StandardLibrary.md │ │ ├── FindLibXslt.md │ │ ├── FindICU.md │ │ ├── FindIntl.md │ │ ├── FindIconv.md │ │ ├── Packages │ │ │ └── LibXml2.md │ │ ├── FindAtomic.md │ │ ├── FindRE2C.md │ │ ├── FindMM.md │ │ ├── FindFFI.md │ │ ├── FindGD.md │ │ ├── FindFreeTDS.md │ │ ├── FindCdb.md │ │ ├── FindGMP.md │ │ ├── FindXPM.md │ │ ├── FindCcache.md │ │ ├── FindLMDB.md │ │ ├── FindPCRE.md │ │ ├── FindQDBM.md │ │ ├── FindSASL.md │ │ ├── FindValgrind.md │ │ ├── FindWebP.md │ │ ├── FindArgon2.md │ │ ├── FindDmalloc.md │ │ ├── FindSodium.md │ │ ├── FindSELinux.md │ │ ├── FindEditline.md │ │ ├── FindAppArmor.md │ │ └── FindCapstone.md │ └── pear.md ├── README.md └── faq.md ├── CMakePresets.json ├── cmake ├── ext │ ├── bz2 │ │ └── cmake │ │ │ └── config.h.in │ ├── dom │ │ └── cmake │ │ │ └── config.h.in │ ├── gmp │ │ └── cmake │ │ │ └── config.h.in │ ├── ctype │ │ ├── cmake │ │ │ └── config.h.in │ │ └── CMakeLists.txt │ ├── curl │ │ └── cmake │ │ │ └── config.h.in │ ├── exif │ │ └── cmake │ │ │ └── config.h.in │ ├── shmop │ │ ├── cmake │ │ │ └── config.h.in │ │ └── CMakeLists.txt │ ├── soap │ │ └── cmake │ │ │ └── config.h.in │ ├── zlib │ │ └── cmake │ │ │ └── config.h.in │ ├── bcmath │ │ └── cmake │ │ │ └── config.h.in │ ├── libxml │ │ └── cmake │ │ │ └── config.h.in │ ├── calendar │ │ ├── cmake │ │ │ └── config.h.in │ │ └── CMakeLists.txt │ ├── sodium │ │ └── cmake │ │ │ └── config.h.in │ ├── sysvmsg │ │ └── cmake │ │ │ └── config.h.in │ ├── sysvshm │ │ ├── cmake │ │ │ └── config.h.in │ │ └── CMakeLists.txt │ ├── date │ │ └── cmake │ │ │ └── config.h.in │ ├── simplexml │ │ └── cmake │ │ │ └── config.h.in │ ├── xmlreader │ │ └── cmake │ │ │ └── config.h.in │ ├── xmlwriter │ │ └── cmake │ │ │ └── config.h.in │ ├── mysqli │ │ └── cmake │ │ │ └── config.h.in │ ├── skeleton │ │ └── cmake │ │ │ └── config.h.in.in │ ├── ftp │ │ └── cmake │ │ │ └── config.h.in │ ├── uri │ │ └── cmake │ │ │ └── config.h.in │ ├── hash │ │ └── cmake │ │ │ └── config.h.in │ ├── lexbor │ │ └── cmake │ │ │ └── config.h.in │ ├── xml │ │ └── cmake │ │ │ └── config.h.in │ ├── sysvsem │ │ └── cmake │ │ │ └── config.h.in │ ├── xsl │ │ └── cmake │ │ │ └── config.h.in │ ├── com_dotnet │ │ └── cmake │ │ │ └── config.h.in │ ├── mbstring │ │ └── cmake │ │ │ └── config.h.in │ ├── random │ │ └── cmake │ │ │ └── config.h.in │ ├── pdo │ │ └── cmake │ │ │ └── GenerateGrammar.cmake │ ├── mysqlnd │ │ └── cmake │ │ │ └── config.h.in │ ├── pdo_mysql │ │ └── cmake │ │ │ ├── GenerateGrammar.cmake │ │ │ └── config.h.in │ ├── pdo_pgsql │ │ └── cmake │ │ │ ├── GenerateGrammar.cmake │ │ │ └── config.h.in │ ├── pdo_sqlite │ │ └── cmake │ │ │ ├── GenerateGrammar.cmake │ │ │ └── config.h.in │ ├── phar │ │ └── cmake │ │ │ └── GenerateGrammar.cmake │ ├── pcre │ │ └── cmake │ │ │ └── config.h.in │ ├── enchant │ │ └── cmake │ │ │ └── config.h.in │ ├── snmp │ │ └── cmake │ │ │ └── config.h.in │ ├── gettext │ │ └── cmake │ │ │ └── config.h.in │ ├── odbc │ │ └── cmake │ │ │ └── config.h.in │ ├── session │ │ └── cmake │ │ │ └── config.h.in │ ├── standard │ │ └── cmake │ │ │ ├── GenerateGrammar.cmake │ │ │ └── CheckStrptime.cmake │ ├── iconv │ │ └── cmake │ │ │ └── config.h.in │ ├── readline │ │ └── cmake │ │ │ └── config.h.in │ ├── sqlite3 │ │ └── cmake │ │ │ └── config.h.in │ ├── openssl │ │ └── cmake │ │ │ └── config.h.in │ ├── fileinfo │ │ └── cmake │ │ │ └── config.h.in │ ├── opcache │ │ └── cmake │ │ │ └── config.h.in │ ├── tidy │ │ └── cmake │ │ │ └── config.h.in │ ├── json │ │ ├── cmake │ │ │ └── GenerateGrammar.cmake │ │ └── CMakeLists.txt │ ├── zip │ │ └── cmake │ │ │ └── config.h.in │ ├── ffi │ │ └── cmake │ │ │ └── config.h.in │ ├── pgsql │ │ └── cmake │ │ │ └── config.h.in │ ├── reflection │ │ └── CMakeLists.txt │ ├── ldap │ │ └── cmake │ │ │ └── config.h.in │ ├── sockets │ │ └── cmake │ │ │ └── config.h.in │ └── dl_test │ │ └── CMakeLists.txt ├── win32 │ └── cmake │ │ └── config.h.in ├── cmake │ ├── toolchains │ │ ├── arm.cmake │ │ └── mingw64.cmake │ ├── CPack.cmake │ ├── Platform.cmake │ ├── modules │ │ ├── FindLibXslt.cmake │ │ ├── FindICU.cmake │ │ └── PHP │ │ │ └── AddCustomCommand │ │ │ └── RunCommand.cmake │ ├── platforms │ │ ├── SunOS.cmake │ │ └── Haiku.cmake │ ├── checks │ │ ├── CheckAlignof.cmake │ │ ├── CheckGetifaddrs.cmake │ │ ├── CheckAlloca.cmake │ │ └── CheckCopyFileRange.cmake │ └── Testing.cmake ├── sapi │ ├── cgi │ │ └── cmake │ │ │ └── config.h.in │ ├── cli │ │ └── cmake │ │ │ └── config.h.in │ ├── phpdbg │ │ └── cmake │ │ │ ├── config.h.in │ │ │ └── GenerateGrammar.cmake │ ├── fpm │ │ └── cmake │ │ │ ├── CheckCompilerAtomicBuiltins.cmake │ │ │ ├── CheckKqueue.cmake │ │ │ ├── CheckSelect.cmake │ │ │ └── CheckEpoll.cmake │ └── litespeed │ │ └── CMakeLists.txt └── Zend │ └── cmake │ ├── Signals.cmake │ ├── CheckCpuidCount.cmake │ ├── CheckAsmGoto.cmake │ └── CheckStrerrorR.cmake ├── .gitignore ├── .codespellrc ├── .typos.toml ├── .editorconfig ├── patches ├── README.md ├── 8.3 │ └── dmalloc.patch ├── 8.4 │ ├── dmalloc.patch │ └── timelib.patch ├── 8.5 │ ├── dmalloc.patch │ └── timelib.patch └── 8.6 │ ├── dmalloc.patch │ ├── timelib.patch │ └── docs.patch └── CHANGELOG.md /docs/images/ccmake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petk/php-build-system/HEAD/docs/images/ccmake.png -------------------------------------------------------------------------------- /docs/images/cmake-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petk/php-build-system/HEAD/docs/images/cmake-gui.png -------------------------------------------------------------------------------- /docs/images/elephpant.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petk/php-build-system/HEAD/docs/images/elephpant.jpg -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 4, 3 | "include": [ 4 | "cmake/CMakePresets.json" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /docs/images/cmake-gui-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petk/php-build-system/HEAD/docs/images/cmake-gui-3.png -------------------------------------------------------------------------------- /cmake/ext/bz2/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'bz2' is available. */ 2 | #cmakedefine HAVE_BZ2 1 3 | -------------------------------------------------------------------------------- /cmake/ext/dom/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'dom' is available. */ 2 | #cmakedefine HAVE_DOM 1 3 | -------------------------------------------------------------------------------- /cmake/ext/gmp/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'gmp' is available. */ 2 | #cmakedefine HAVE_GMP 1 3 | -------------------------------------------------------------------------------- /docs/images/cmake-gui-2-setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petk/php-build-system/HEAD/docs/images/cmake-gui-2-setup.png -------------------------------------------------------------------------------- /docs/images/cmake-profiling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/petk/php-build-system/HEAD/docs/images/cmake-profiling.png -------------------------------------------------------------------------------- /cmake/ext/ctype/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'ctype' is available. */ 2 | #cmakedefine HAVE_CTYPE 1 3 | -------------------------------------------------------------------------------- /cmake/ext/curl/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'curl' is available. */ 2 | #cmakedefine HAVE_CURL 1 3 | -------------------------------------------------------------------------------- /cmake/ext/exif/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'exif' is available. */ 2 | #cmakedefine HAVE_EXIF 1 3 | -------------------------------------------------------------------------------- /cmake/ext/shmop/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'shmop' is available. */ 2 | #cmakedefine HAVE_SHMOP 1 3 | -------------------------------------------------------------------------------- /cmake/ext/soap/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'soap' is available. */ 2 | #cmakedefine HAVE_SOAP 1 3 | -------------------------------------------------------------------------------- /cmake/ext/zlib/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'zlib' is available. */ 2 | #cmakedefine HAVE_ZLIB 1 3 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_IPV6.md: -------------------------------------------------------------------------------- 1 | # `PHP_IPV6` 2 | 3 | * Default: `ON` 4 | * Values: `ON|OFF` 5 | 6 | Enable IPv6 support. 7 | -------------------------------------------------------------------------------- /cmake/ext/bcmath/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'bcmath' is available. */ 2 | #cmakedefine HAVE_BCMATH 1 3 | -------------------------------------------------------------------------------- /cmake/ext/libxml/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'libxml' is available. */ 2 | #cmakedefine HAVE_LIBXML 1 3 | -------------------------------------------------------------------------------- /cmake/ext/calendar/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'calendar' is available. */ 2 | #cmakedefine HAVE_CALENDAR 1 3 | -------------------------------------------------------------------------------- /cmake/ext/sodium/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'sodium' is available. */ 2 | #cmakedefine HAVE_LIBSODIUMLIB 1 3 | -------------------------------------------------------------------------------- /cmake/ext/sysvmsg/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'sysvmsg' is available. */ 2 | #cmakedefine HAVE_SYSVMSG 1 3 | -------------------------------------------------------------------------------- /cmake/ext/sysvshm/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'sysvshm' is available. */ 2 | #cmakedefine HAVE_SYSVSHM 1 3 | -------------------------------------------------------------------------------- /cmake/ext/date/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if you have the header file. */ 2 | #cmakedefine HAVE_TIMELIB_CONFIG_H 1 3 | -------------------------------------------------------------------------------- /cmake/ext/simplexml/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'simplexml' is available. */ 2 | #cmakedefine HAVE_SIMPLEXML 1 3 | -------------------------------------------------------------------------------- /cmake/ext/xmlreader/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'xmlreader' is available. */ 2 | #cmakedefine HAVE_XMLREADER 1 3 | -------------------------------------------------------------------------------- /cmake/ext/xmlwriter/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'xmlwriter' is available. */ 2 | #cmakedefine HAVE_XMLWRITER 1 3 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_LIBGCC.md: -------------------------------------------------------------------------------- 1 | # `PHP_LIBGCC` 2 | 3 | * Default: `OFF` 4 | * Values: `ON|OFF` 5 | 6 | Explicitly link against libgcc. 7 | -------------------------------------------------------------------------------- /cmake/ext/mysqli/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* The MySQL Unix socket location. */ 2 | #cmakedefine PHP_MYSQL_UNIX_SOCK_ADDR "@PHP_MYSQL_UNIX_SOCK_ADDR@" 3 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_BUILD_PROVIDER.md: -------------------------------------------------------------------------------- 1 | # `PHP_BUILD_PROVIDER` 2 | 3 | * Default: empty 4 | 5 | Build provider displayed in the phpinfo output. 6 | -------------------------------------------------------------------------------- /cmake/ext/skeleton/cmake/config.h.in.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension '%EXTNAME%' is available. */ 2 | #cmakedefine PHP_EXT_%EXTNAMECAPS%_ENABLED 1 3 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_BUILD_ARCH.md: -------------------------------------------------------------------------------- 1 | # `PHP_BUILD_ARCH` 2 | 3 | * Default: `${CMAKE_C_COMPILER_ARCHITECTURE_ID}` 4 | 5 | Build target architecture displayed in the phpinfo output. 6 | -------------------------------------------------------------------------------- /cmake/win32/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Linker major version. */ 2 | #cmakedefine PHP_LINKER_MAJOR @PHP_LINKER_MAJOR@ 3 | 4 | /* Linker minor version. */ 5 | #cmakedefine PHP_LINKER_MINOR @PHP_LINKER_MINOR@ 6 | -------------------------------------------------------------------------------- /cmake/ext/ftp/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'ftp' is available. */ 2 | #cmakedefine HAVE_FTP 1 3 | 4 | /* Define to 1 if FTP over SSL is enabled. */ 5 | #cmakedefine HAVE_FTP_SSL 1 6 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_BUILD_COMPILER.md: -------------------------------------------------------------------------------- 1 | # `PHP_BUILD_COMPILER` 2 | 3 | * Default: `${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}` 4 | 5 | Compiler used for the build and displayed in the phpinfo output. 6 | -------------------------------------------------------------------------------- /cmake/cmake/toolchains/arm.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Linux) 2 | set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) 3 | set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) 4 | set(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabihf) 5 | -------------------------------------------------------------------------------- /cmake/ext/uri/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 for enabling ANSI support of uriparser. */ 2 | #define URI_ENABLE_ANSI 1 3 | 4 | /* Define to 1 for disabling unicode support of uriparser. */ 5 | #define URI_NO_UNICODE 1 6 | -------------------------------------------------------------------------------- /cmake/ext/hash/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP hash extension uses the slow SHA3 algorithm. */ 2 | #cmakedefine HAVE_SLOW_HASH3 1 3 | 4 | /* Define to 1 if mhash support is enabled. */ 5 | #cmakedefine PHP_MHASH_BC 1 6 | -------------------------------------------------------------------------------- /cmake/ext/lexbor/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'lexbor' is available. */ 2 | #cmakedefine HAVE_LEXBOR 1 3 | 4 | /* Define the main Lexbor version. */ 5 | #cmakedefine LEXBOR_VERSION "@LEXBOR_VERSION@" 6 | -------------------------------------------------------------------------------- /cmake/ext/xml/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the system has the Expat XML parser library. */ 2 | #cmakedefine HAVE_LIBEXPAT 1 3 | 4 | /* Define to 1 if the PHP extension 'xml' is available. */ 5 | #cmakedefine HAVE_XML 1 6 | -------------------------------------------------------------------------------- /docs/cmake/variables/_PHP_UNDEFINED_SANITIZER.md: -------------------------------------------------------------------------------- 1 | # `PHP_UNDEFINED_SANITIZER` 2 | 3 | * Default: `OFF` 4 | * Values: `ON|OFF` 5 | 6 | Enable the undefined sanitizer compiler option. 7 | 8 | TODO: To be determined and refactored. 9 | -------------------------------------------------------------------------------- /cmake/cmake/toolchains/mingw64.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Windows) 2 | set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) 3 | set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) 4 | set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/sys-root/mingw) 5 | -------------------------------------------------------------------------------- /cmake/ext/sysvsem/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'sysvsem' is available. */ 2 | #cmakedefine HAVE_SYSVSEM 1 3 | 4 | /* Define to 1 if the system has the type 'union semun'. */ 5 | #cmakedefine HAVE_UNION_SEMUN 1 6 | -------------------------------------------------------------------------------- /cmake/ext/xsl/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'xsl' is available. */ 2 | #cmakedefine HAVE_XSL 1 3 | 4 | /* Define to 1 if the system has the EXSLT extension library for XSLT. */ 5 | #cmakedefine HAVE_XSL_EXSLT 1 6 | -------------------------------------------------------------------------------- /cmake/ext/com_dotnet/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'com_dotnet' is available. */ 2 | #cmakedefine HAVE_COM_DOTNET 1 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #cmakedefine HAVE_MSCOREE_H 1 6 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_RE2C_COMPUTED_GOTOS.md: -------------------------------------------------------------------------------- 1 | # `PHP_RE2C_COMPUTED_GOTOS` 2 | 3 | * Default: `OFF` 4 | * Values: `ON|OFF` 5 | 6 | Enable the goto C statements when using re2c. 7 | 8 | This variable is provided by the `PHP/Re2c` module. 9 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_SIGCHILD.md: -------------------------------------------------------------------------------- 1 | # `PHP_SIGCHILD` 2 | 3 | * Default: `OFF` 4 | * Values: `ON|OFF` 5 | 6 | Enable PHP's own `SIGCHLD` handler. 7 | 8 | > [!NOTE] 9 | > This option is not available when the target system is Windows. 10 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_DEFAULT_SHORT_OPEN_TAG.md: -------------------------------------------------------------------------------- 1 | # `PHP_DEFAULT_SHORT_OPEN_TAG` 2 | 3 | * Default: `ON` 4 | * Values: `ON|OFF` 5 | 6 | Set the default value of `short_open_tag` php.ini directive to `On` to enable 7 | short-form of opening PHP tags ` [!NOTE] 10 | > This option is not available when the target system is Windows. 11 | -------------------------------------------------------------------------------- /docs/cmake/ext/lexbor.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/lexbor/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/lexbor/CMakeLists.txt) 3 | 4 | # The lexbor extension 5 | 6 | Configure the `lexbor` extension. 7 | 8 | This extension provides support for Lexbor library. 9 | -------------------------------------------------------------------------------- /docs/cmake/ext/spl.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/spl/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/spl/CMakeLists.txt) 3 | 4 | # The spl extension 5 | 6 | Configure the `spl` extension. 7 | 8 | This extension includes Standard PHP Library (SPL) and is always enabled. 9 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_FD_SETSIZE.md: -------------------------------------------------------------------------------- 1 | # `PHP_FD_SETSIZE` 2 | 3 | * Default: empty on \*nix, `256` on Windows 4 | * Values: integer greater than 0 5 | 6 | Set the default value of `FD_SETSIZE` on the target system. This value defines 7 | the maximum number of file descriptors that an `fd_set` object can handle. The 8 | value must be an integer. 9 | -------------------------------------------------------------------------------- /cmake/cmake/CPack.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Initial project CPack configuration. 3 | #]=============================================================================] 4 | 5 | if(NOT CPACK_PACKAGE_VERSION) 6 | set(CPACK_PACKAGE_VERSION ${PHP_VERSION}) 7 | endif() 8 | 9 | include(CPack) 10 | -------------------------------------------------------------------------------- /cmake/ext/mbstring/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if mbstring has multibyte regex support enabled. */ 2 | #cmakedefine HAVE_MBREGEX 1 3 | 4 | /* Define to 1 if the PHP extension 'mbstring' is available. */ 5 | #cmakedefine HAVE_MBSTRING 1 6 | 7 | /* Define to 1 if Oniguruma has an invalid entry for KOI8 encoding. */ 8 | #cmakedefine PHP_ONIG_BAD_KOI8_ENTRY 1 9 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_CONFIG_FILE_SCAN_DIR.md: -------------------------------------------------------------------------------- 1 | # `PHP_CONFIG_FILE_SCAN_DIR` 2 | 3 | * Default: empty 4 | 5 | The path where to scan for additional INI configuration files. By default it is 6 | empty. Pass it as a relative path inside the install prefix, which will be 7 | automatically prepended. If given as an absolute path, install prefix is not 8 | prepended. 9 | -------------------------------------------------------------------------------- /cmake/ext/random/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if you have the 'arc4random_buf' function. */ 2 | #cmakedefine HAVE_ARC4RANDOM_BUF 1 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #cmakedefine HAVE_COMMONCRYPTO_COMMONRANDOM_H 1 6 | 7 | /* Define to 1 if you have the 'getrandom' function. */ 8 | #cmakedefine HAVE_GETRANDOM 1 9 | -------------------------------------------------------------------------------- /docs/cmake/ext/date.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/date/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/date/CMakeLists.txt) 3 | 4 | # The date extension 5 | 6 | Configure the `date` extension. 7 | 8 | This extension provides date and time support. 9 | 10 | This extension is always enabled. 11 | -------------------------------------------------------------------------------- /docs/cmake/ext/json.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/json/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/json/CMakeLists.txt) 3 | 4 | # The json extension 5 | 6 | Configure the `json` extension. 7 | 8 | This extension provides support for working with JavaScript Object Notation 9 | (JSON) and is always enabled. 10 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_SYSTEM_GLOB.md: -------------------------------------------------------------------------------- 1 | # `PHP_SYSTEM_GLOB` 2 | 3 | :green_circle: *New in PHP 8.5.* 4 | 5 | * Default: `OFF` 6 | * Values: `ON|OFF` 7 | 8 | When enabled, system `glob()` function will be used for PHP glob functionality 9 | instead of the PHP `php_glob()` built-in implementation. 10 | 11 | > [!NOTE] 12 | > This option is not available when the target system is Windows. 13 | -------------------------------------------------------------------------------- /docs/cmake/ext/random.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/random/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/random/CMakeLists.txt) 3 | 4 | # The random extension 5 | 6 | Configure the `random` extension. 7 | 8 | This extension provides support for random number generators and functions 9 | related to randomness. It is always enabled. 10 | -------------------------------------------------------------------------------- /docs/cmake/ext/reflection.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/reflection/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/reflection/CMakeLists.txt) 3 | 4 | # The reflection extension 5 | 6 | Configure the `reflection` extension. 7 | 8 | This extension provides support for Reflection API to introspect PHP code and is 9 | always enabled. 10 | -------------------------------------------------------------------------------- /docs/cmake/sapi/cgi.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [sapi/cgi/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/sapi/cgi/CMakeLists.txt) 3 | 4 | # The cgi SAPI 5 | 6 | Configure the `cgi` PHP SAPI. 7 | 8 | ## PHP_SAPI_CGI 9 | 10 | * Default: `ON` 11 | * Values: `ON|OFF` 12 | 13 | Enable the PHP CGI (Common Gateway Interface) SAPI executable module. 14 | -------------------------------------------------------------------------------- /cmake/sapi/cli/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if PHP uses the 'libedit' library. */ 2 | #cmakedefine HAVE_LIBEDIT 1 3 | 4 | /* Define if the PS_STRINGS exists. */ 5 | #cmakedefine HAVE_PS_STRINGS 6 | 7 | /* Define to 1 if you have the 'setproctitle' function. */ 8 | #cmakedefine HAVE_SETPROCTITLE 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #cmakedefine HAVE_SYS_PSTAT_H 1 12 | -------------------------------------------------------------------------------- /cmake/ext/pdo/cmake/GenerateGrammar.cmake: -------------------------------------------------------------------------------- 1 | # Generate lexer files. 2 | 3 | if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE) 4 | message(FATAL_ERROR "This file should be used with include().") 5 | endif() 6 | 7 | include(PHP/Re2c) 8 | 9 | php_re2c( 10 | php_ext_pdo_sql_parser 11 | pdo_sql_parser.re 12 | ${CMAKE_CURRENT_SOURCE_DIR}/pdo_sql_parser.c 13 | ADD_DEFAULT_OPTIONS 14 | CODEGEN 15 | ) 16 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_ZEND_GLOBAL_REGISTER_VARIABLES.md: -------------------------------------------------------------------------------- 1 | # `PHP_ZEND_GLOBAL_REGISTER_VARIABLES` 2 | 3 | * Default: `ON` 4 | * Values: `ON|OFF` 5 | 6 | When enabled, the 7 | [Zend/CheckGlobalRegisterVariables](/docs/cmake/modules/Zend/CheckGlobalRegisterVariables.md) 8 | module checks whether the compiler and target system support the so-called 9 | global register variables. If not supported, they will be disabled. 10 | -------------------------------------------------------------------------------- /cmake/ext/mysqlnd/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if mysqlnd has compressed protocol support. */ 2 | #cmakedefine MYSQLND_COMPRESSION_ENABLED 1 3 | 4 | /* Define to 1 if mysqlnd has extended SSL enabled through a system library 5 | OpenSSL (*nix systems), or Crypt32 (Windows systems). */ 6 | #cmakedefine MYSQLND_HAVE_SSL 1 7 | 8 | /* Define to 1 if mysqlnd core SSL is enabled. */ 9 | #cmakedefine MYSQLND_SSL_SUPPORTED 1 10 | -------------------------------------------------------------------------------- /cmake/ext/pdo_mysql/cmake/GenerateGrammar.cmake: -------------------------------------------------------------------------------- 1 | # Generate lexer files. 2 | 3 | if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE) 4 | message(FATAL_ERROR "This file should be used with include().") 5 | endif() 6 | 7 | include(PHP/Re2c) 8 | 9 | php_re2c( 10 | php_ext_pdo_mysql_sql_parser 11 | mysql_sql_parser.re 12 | ${CMAKE_CURRENT_SOURCE_DIR}/mysql_sql_parser.c 13 | ADD_DEFAULT_OPTIONS 14 | CODEGEN 15 | ) 16 | -------------------------------------------------------------------------------- /cmake/ext/pdo_mysql/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* The MySQL Unix socket location as defined by 'mysql_config' for use with 2 | the pdo_mysql extension. */ 3 | #cmakedefine PDO_MYSQL_UNIX_ADDR "@PDO_MYSQL_UNIX_ADDR@" 4 | 5 | /* Define to 1 if the pdo_mysql extension uses mysqlnd. */ 6 | #cmakedefine PDO_USE_MYSQLND 1 7 | 8 | /* The MySQL Unix socket location. */ 9 | #cmakedefine PHP_MYSQL_UNIX_SOCK_ADDR "@PHP_MYSQL_UNIX_SOCK_ADDR@" 10 | -------------------------------------------------------------------------------- /cmake/ext/pdo_pgsql/cmake/GenerateGrammar.cmake: -------------------------------------------------------------------------------- 1 | # Generate lexer files. 2 | 3 | if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE) 4 | message(FATAL_ERROR "This file should be used with include().") 5 | endif() 6 | 7 | include(PHP/Re2c) 8 | 9 | php_re2c( 10 | php_ext_pdo_pgsql_sql_parser 11 | pgsql_sql_parser.re 12 | ${CMAKE_CURRENT_SOURCE_DIR}/pgsql_sql_parser.c 13 | ADD_DEFAULT_OPTIONS 14 | CODEGEN 15 | ) 16 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_CCACHE.md: -------------------------------------------------------------------------------- 1 | # `PHP_CCACHE` 2 | 3 | * Default: `ON` 4 | * Values: `ON|OFF` 5 | 6 | Enable `ccache` for faster compilation time if it is installed and found on the 7 | system. If not found, it is not used. It can be explicitly turned off with this 8 | option or by setting environment variable `CCACHE_DISABLE=1`. A custom path to 9 | the `ccache` installation directory can be also set with the `CCACHE_ROOT`. 10 | -------------------------------------------------------------------------------- /cmake/ext/pdo_sqlite/cmake/GenerateGrammar.cmake: -------------------------------------------------------------------------------- 1 | # Generate lexer files. 2 | 3 | if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE) 4 | message(FATAL_ERROR "This file should be used with include().") 5 | endif() 6 | 7 | include(PHP/Re2c) 8 | 9 | php_re2c( 10 | php_ext_pdo_sqlite_sql_parser 11 | sqlite_sql_parser.re 12 | ${CMAKE_CURRENT_SOURCE_DIR}/sqlite_sql_parser.c 13 | ADD_DEFAULT_OPTIONS 14 | CODEGEN 15 | ) 16 | -------------------------------------------------------------------------------- /cmake/ext/phar/cmake/GenerateGrammar.cmake: -------------------------------------------------------------------------------- 1 | # Generate lexer files. 2 | 3 | if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE) 4 | message(FATAL_ERROR "This file should be used with include().") 5 | endif() 6 | 7 | include(PHP/Re2c) 8 | 9 | php_re2c( 10 | php_ext_phar_path_check 11 | phar_path_check.re 12 | ${CMAKE_CURRENT_SOURCE_DIR}/phar_path_check.c 13 | ADD_DEFAULT_OPTIONS 14 | OPTIONS --bit-vectors 15 | CODEGEN 16 | ) 17 | -------------------------------------------------------------------------------- /cmake/ext/pdo_pgsql/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'pdo_pgsql' is available. */ 2 | #cmakedefine HAVE_PDO_PGSQL 1 3 | 4 | /* Define to 1 if libpq has the 'PQresultMemorySize' function (PostgreSQL 12 5 | or later). */ 6 | #cmakedefine HAVE_PG_RESULT_MEMORY_SIZE 1 7 | 8 | /* Define to 1 if libpq has the 'PQclosePrepared', 'PQclosePortal', and other 9 | functions (PostgreSQL 17 or later). */ 10 | #cmakedefine HAVE_PQCLOSEPREPARED 1 11 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_ZEND_SIGNALS.md: -------------------------------------------------------------------------------- 1 | # `PHP_ZEND_SIGNALS` 2 | 3 | * Default: `ON` 4 | * Values: `ON|OFF` 5 | 6 | Whether to enable Zend signals handling within the Zend Engine for performance. 7 | When enabled and if the target system supports them, they will be enabled, 8 | otherwise they will be disabled. 9 | 10 | See also: https://wiki.php.net/rfc/zendsignals 11 | 12 | > [!NOTE] 13 | > This option is not available when the target system is Windows. 14 | -------------------------------------------------------------------------------- /cmake/ext/pcre/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if PHP uses the bundled PCRE library. */ 2 | #cmakedefine HAVE_BUNDLED_PCRE 1 3 | 4 | /* Define to 1 if PCRE JIT is enabled and supported. */ 5 | #cmakedefine HAVE_PCRE_JIT_SUPPORT 1 6 | 7 | /* Number of bits in non-UTF mode for PCRE library. */ 8 | #cmakedefine PCRE2_CODE_UNIT_WIDTH @PCRE2_CODE_UNIT_WIDTH@ 9 | 10 | /* Define to 1 if PCRE library is built statically on Windows. */ 11 | #cmakedefine PCRE2_STATIC 1 12 | -------------------------------------------------------------------------------- /docs/cmake/modules/PHP/Stubs.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/PHP/Stubs.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/PHP/Stubs.cmake) 3 | 4 | # PHP/Stubs 5 | 6 | Generate *_arginfo.h headers from the *.stub.php sources 7 | 8 | The build/gen_stub.php script requires the PHP tokenizer extension. 9 | 10 | ## Usage 11 | 12 | ```cmake 13 | # CMakeLists.txt 14 | include(PHP/Stubs) 15 | ``` 16 | -------------------------------------------------------------------------------- /cmake/ext/enchant/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'enchant' is available. */ 2 | #cmakedefine HAVE_ENCHANT 1 3 | 4 | /* Define to 1 if Enchant library has the 'enchant_broker_set_param' function 5 | (available since 1.5.0 and removed in 2.x). */ 6 | #cmakedefine HAVE_ENCHANT_BROKER_SET_PARAM 1 7 | 8 | /* Define to 1 if Enchant library has the 'enchant_get_version' function 9 | (available since 1.6.0). */ 10 | #cmakedefine HAVE_ENCHANT_GET_VERSION 1 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # These files are intentionally untracked to ignore by Git. For development 2 | # environment-specific files, such as editor configuration, a good practice is 3 | # to exclude them using the .git/info/exclude in the cloned repository or a 4 | # global .gitignore file. 5 | 6 | # All PHP downloaded archives and extracted directories. 7 | /php-* 8 | 9 | # CMake-related files. 10 | /cmake/CMakeUserPresets.json 11 | /CMakeCache.txt 12 | /CMakeFiles/ 13 | /CMakeUserPresets.json 14 | -------------------------------------------------------------------------------- /cmake/sapi/phpdbg/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if 'TIOCGWINSZ' requires . */ 2 | #cmakedefine GWINSZ_IN_SYS_IOCTL 1 3 | 4 | /* Define to 1 if PHP uses the 'libedit' library. */ 5 | #cmakedefine HAVE_LIBEDIT 1 6 | 7 | /* Define to 1 if the phpdbg SAPI has libedit/readline integration. */ 8 | #cmakedefine HAVE_PHPDBG_READLINE 1 9 | 10 | /* Define to 1 if faulting on write-protected memory support can be compiled 11 | for userfaultfd. */ 12 | #cmakedefine HAVE_USERFAULTFD_WRITEFAULT 1 13 | -------------------------------------------------------------------------------- /docs/cmake/sapi/litespeed.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [sapi/litespeed/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/sapi/litespeed/CMakeLists.txt) 3 | 4 | # The litespeed SAPI 5 | 6 | Configure the `litespeed` PHP SAPI. 7 | 8 | > [!NOTE] 9 | > The PHP Litespeed SAPI is not available when the target system is Windows. 10 | 11 | ## PHP_SAPI_LITESPEED 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the LiteSpeed SAPI module. 17 | -------------------------------------------------------------------------------- /cmake/ext/snmp/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if SNMP library has the 'shutdown_snmp_logging' function. */ 2 | #cmakedefine HAVE_SHUTDOWN_SNMP_LOGGING 1 3 | 4 | /* Define to 1 if the PHP extension 'snmp' is available. */ 5 | #cmakedefine HAVE_SNMP 1 6 | 7 | /* Define to 1 if SNMP library has the 'usmHMAC192SHA256AuthProtocol' array. 8 | */ 9 | #cmakedefine HAVE_SNMP_SHA256 1 10 | 11 | /* Define to 1 if SNMP library has the 'usmHMAC384SHA512AuthProtocol' array. 12 | */ 13 | #cmakedefine HAVE_SNMP_SHA512 1 14 | -------------------------------------------------------------------------------- /docs/cmake/ext/libxml.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/libxml/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/libxml/CMakeLists.txt) 3 | 4 | # The libxml extension 5 | 6 | Configure the `libxml` extension. 7 | 8 | This extension provides XML parser and toolkit support using libxml2 library. 9 | 10 | ## PHP_EXT_LIBXML 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | This extension cannot be built as shared. 18 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_ZEND_FIBER_ASM.md: -------------------------------------------------------------------------------- 1 | # `PHP_ZEND_FIBER_ASM` 2 | 3 | * Default: `ON` 4 | * Values: `ON|OFF` 5 | 6 | Enable the use of Boost fiber assembly files using the 7 | [Zend/Fibers](/docs/cmake/modules/Zend/Fibers.md) module. If disabled or system 8 | isn't supported, fiber support will be run through the legacy ucontext. 9 | 10 | > [!NOTE] 11 | > When target system is Windows, this option is always set to `ON` and option is 12 | > hidden in the CMake GUIs as there is no alternative implementation available. 13 | -------------------------------------------------------------------------------- /docs/cmake/ext/hash.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/hash/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/hash/CMakeLists.txt) 3 | 4 | # The hash extension 5 | 6 | Configure the `hash` extension. 7 | 8 | This extension provides HASH message digest framework and is always enabled in 9 | PHP. 10 | 11 | ## PHP_EXT_HASH_MHASH 12 | 13 | :orange_circle: *Deprecated as of PHP 8.1.* 14 | 15 | * Default: `OFF` 16 | * Values: `ON|OFF` 17 | 18 | Enable the mhash emulation support. 19 | -------------------------------------------------------------------------------- /.codespellrc: -------------------------------------------------------------------------------- 1 | # The codespell configuration. 2 | # https://github.com/codespell-project/codespell 3 | 4 | [codespell] 5 | builtin = clear,code,en-GB_to_en-US,informal,names,rare,usage 6 | check-filenames = 7 | check-hidden = 8 | ignore-words-list = 9 | deafults, 10 | flavour, 11 | gost, 12 | empress, 13 | master, 14 | musl, 15 | nmake, 16 | shs, 17 | stdio, 18 | thead, 19 | skip = 20 | ./php-src, 21 | ./.git, 22 | *.patch, 23 | *.svg, 24 | ./docs/autotools/configure-help/PHP-*.txt, 25 | -------------------------------------------------------------------------------- /cmake/ext/gettext/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if you have the 'bind_textdomain_codeset' function. */ 2 | #cmakedefine HAVE_BIND_TEXTDOMAIN_CODESET 1 3 | 4 | /* Define to 1 if you have the 'dcngettext' function. */ 5 | #cmakedefine HAVE_DCNGETTEXT 1 6 | 7 | /* Define to 1 if you have the 'dngettext' function. */ 8 | #cmakedefine HAVE_DNGETTEXT 1 9 | 10 | /* Define to 1 if you have the 'intl' library. */ 11 | #cmakedefine HAVE_LIBINTL 1 12 | 13 | /* Define to 1 if you have the 'ngettext' function. */ 14 | #cmakedefine HAVE_NGETTEXT 1 15 | -------------------------------------------------------------------------------- /docs/cmake/ext/uri.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/uri/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/uri/CMakeLists.txt) 3 | 4 | # The uri extension 5 | 6 | Configure the `uri` extension. 7 | 8 | This extension provides support for URI handling. 9 | 10 | ## Configuration options 11 | 12 | ### PHP_EXT_URI_EXTERNAL 13 | 14 | * Default: `OFF` 15 | * Values: `ON|OFF` 16 | 17 | Use external/system uriparser library instead of the bundled uriparser library 18 | that comes with PHP. 19 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_CONFIG_FILE_PATH.md: -------------------------------------------------------------------------------- 1 | # `PHP_CONFIG_FILE_PATH` 2 | 3 | * Default: `${CMAKE_INSTALL_SYSCONFDIR}` 4 | 5 | The path in which to look for `php.ini`. By default, it is set to the 6 | `CMAKE_INSTALL_SYSCONFDIR` (`etc` directory). Relative path gets the 7 | `CMAKE_INSTALL_PREFIX` automatically prepended. If given as an absolute path, 8 | install prefix is not appended. 9 | 10 | > [!NOTE] 11 | > This option is not available when the target system is Windows. On Windows the 12 | > C preprocessor macro isn't utilized in the C code. 13 | -------------------------------------------------------------------------------- /docs/cmake/ext/pdo.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pdo/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pdo/CMakeLists.txt) 3 | 4 | # The pdo extension 5 | 6 | Configure the `pdo` extension. 7 | 8 | This extension provides support for PHP Data Objects (PDO). 9 | 10 | ## PHP_EXT_PDO 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_PDO_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/gmp.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/gmp/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/gmp/CMakeLists.txt) 3 | 4 | # The gmp extension 5 | 6 | Configure the `gmp` extension. 7 | 8 | This extension provides GNU Multiple Precision Arithmetic support. 9 | 10 | ## PHP_EXT_GMP 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_GMP_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/phar.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/phar/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/phar/CMakeLists.txt) 3 | 4 | # The phar extension 5 | 6 | Configure the `phar` extension. 7 | 8 | This extension provides support for PHP archives (phar). 9 | 10 | ## PHP_EXT_PHAR 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_PHAR_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/filter.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/filter/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/filter/CMakeLists.txt) 3 | 4 | # The filter extension 5 | 6 | Configure the `filter` extension. 7 | 8 | This extension provides support for data filtering. 9 | 10 | ## PHP_EXT_FILTER 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_FILTER_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/curl.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/curl/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/curl/CMakeLists.txt) 3 | 4 | # The curl extension 5 | 6 | Configure the `curl` extension. 7 | 8 | This extension provides support for using CURL - Client URL Library. 9 | 10 | ## PHP_EXT_CURL 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_CURL_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/pgsql.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pgsql/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pgsql/CMakeLists.txt) 3 | 4 | # The pgsql extension 5 | 6 | Configure the `pgsql` extension. 7 | 8 | This extension provides support for using PostgreSQL database. 9 | 10 | ## PHP_EXT_PGSQL 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_PGSQL_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/soap.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/soap/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/soap/CMakeLists.txt) 3 | 4 | # The soap extension 5 | 6 | Configure the `soap` extension. 7 | 8 | This extension provides support for writing SOAP servers and clients. 9 | 10 | ## PHP_EXT_SOAP 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_SOAP_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /cmake/ext/odbc/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the odbc extension uses custom ODBC installation. */ 2 | #cmakedefine HAVE_CODBC 1 3 | 4 | /* Define to 1 if the odbc extension uses the IBM DB2. */ 5 | #cmakedefine HAVE_IBMDB2 1 6 | 7 | /* Define to 1 if the odbc extension uses the iODBC. */ 8 | #cmakedefine HAVE_IODBC 1 9 | 10 | /* Define to 1 if the odbc extension uses the unixODBC. */ 11 | #cmakedefine HAVE_UNIXODBC 1 12 | 13 | /* Define to 1 if the PHP extension 'odbc' is available. */ 14 | #cmakedefine HAVE_UODBC 1 15 | 16 | @PHP_ODBC_BUILD_DEFINITIONS_CODE@ 17 | -------------------------------------------------------------------------------- /docs/cmake/ext/zip.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/zip/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/zip/CMakeLists.txt) 3 | 4 | # The zip extension 5 | 6 | Configure the `zip` extension. 7 | 8 | This extension provides support for reading and writing ZIP compressed archives. 9 | 10 | ## PHP_EXT_ZIP 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_ZIP_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /.typos.toml: -------------------------------------------------------------------------------- 1 | # The typos-cli configuration. 2 | # https://github.com/crate-ci/typos 3 | 4 | [files] 5 | ignore-hidden = false 6 | ignore-dot = false 7 | extend-exclude = [ 8 | ".git/", 9 | "*.svg", 10 | "patches/", 11 | ] 12 | 13 | [default] 14 | binary = false 15 | check-filename = true 16 | check-file = true 17 | unicode=true 18 | locale = "en-us" 19 | extend-ignore-re = [] 20 | extend-ignore-identifiers-re = [ 21 | "PDO_DBLIB_FLAVOUR", 22 | "secur32", 23 | ] 24 | extend-ignore-words-re = [ 25 | "deafults", 26 | "flavour", 27 | "gost", 28 | "shs", 29 | ] 30 | -------------------------------------------------------------------------------- /docs/cmake/ext/exif.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/exif/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/exif/CMakeLists.txt) 3 | 4 | # The exif extension 5 | 6 | Configure the `exif` extension. 7 | 8 | This extension provides support for working with exchangeable image metadata. 9 | 10 | ## PHP_EXT_EXIF 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_EXIF_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/shmop.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/shmop/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/shmop/CMakeLists.txt) 3 | 4 | # The shmop extension 5 | 6 | Configure the `shmop` extension. 7 | 8 | This extension provides support for shared memory segments operations. 9 | 10 | ## PHP_EXT_SHMOP 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_SHMOP_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/snmp.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/snmp/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/snmp/CMakeLists.txt) 3 | 4 | # The snmp extension 5 | 6 | Configure the `snmp` extension. 7 | 8 | This extension provides support for Simple Network Management Protocol (SNMP). 9 | 10 | ## PHP_EXT_SNMP 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_SNMP_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/sqlite3.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/sqlite3/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/sqlite3/CMakeLists.txt) 3 | 4 | # The sqlite3 extension 5 | 6 | Configure the `sqlite3` extension. 7 | 8 | This extension provides support for using SQLite database. 9 | 10 | ## PHP_EXT_SQLITE3 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_SQLITE3_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/xsl.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/xsl/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/xsl/CMakeLists.txt) 3 | 4 | # The xsl extension 5 | 6 | Configure the `xsl` extension. 7 | 8 | This extension provides XSL standard support for performing XSLT 9 | transformations. 10 | 11 | ## PHP_EXT_XSL 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_XSL_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/bz2.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/bz2/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/bz2/CMakeLists.txt) 3 | 4 | # The bz2 extension 5 | 6 | Configure the `bz2` extension. 7 | 8 | This extension provides support for reading and writing BZip2 (.bz2) compressed 9 | files. 10 | 11 | ## PHP_EXT_BZ2 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_BZ2_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/calendar.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/calendar/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/calendar/CMakeLists.txt) 3 | 4 | # The calendar extension 5 | 6 | Configure the `calendar` extension. 7 | 8 | This extension provides support for calendar conversion. 9 | 10 | ## PHP_EXT_CALENDAR 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_CALENDAR_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/dl_test.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/dl_test/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/dl_test/CMakeLists.txt) 3 | 4 | # The dl_test extension 5 | 6 | Configure the `dl_test` extension. 7 | 8 | This extension provides support for testing PHP `dl()` function relevant when 9 | running PHP tests during development. 10 | 11 | ## PHP_EXT_DL_TEST 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | This extension is always built as shared when enabled. 19 | -------------------------------------------------------------------------------- /docs/cmake/ext/sysvshm.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/sysvshm/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/sysvshm/CMakeLists.txt) 3 | 4 | # The sysvshm extension 5 | 6 | Configure the `sysvshm` extension. 7 | 8 | This extension provides the System V shared memory support. 9 | 10 | ## PHP_EXT_SYSVSHM 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_SYSVSHM_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/bcmath.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/bcmath/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/bcmath/CMakeLists.txt) 3 | 4 | # The bcmath extension 5 | 6 | Configure the `bcmath` extension. 7 | 8 | This extension provides Basic Calculator (BC) style precision math support. 9 | 10 | ## PHP_EXT_BCMATH 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_BCMATH_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/enchant.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/enchant/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/enchant/CMakeLists.txt) 3 | 4 | # The enchant extension 5 | 6 | Configure the `enchant` extension. 7 | 8 | This extension provides binding for the Enchant spelling library. 9 | 10 | ## PHP_EXT_ENCHANT 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_ENCHANT_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/ffi.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/ffi/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/ffi/CMakeLists.txt) 3 | 4 | # The ffi extension 5 | 6 | Configure the `ffi` extension. 7 | 8 | This extension provides Foreign Function Interface (FFI) support to run C code 9 | through PHP. 10 | 11 | ## PHP_EXT_FFI 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_FFI_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/intl.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/intl/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/intl/CMakeLists.txt) 3 | 4 | # The intl extension 5 | 6 | Configure the `intl` extension. 7 | 8 | This extension provides support for internationalization, a wrapper for ICU 9 | library. 10 | 11 | ## PHP_EXT_INTL 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_INTL_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/zlib.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/zlib/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/zlib/CMakeLists.txt) 3 | 4 | # The zlib extension 5 | 6 | Configure the `zlib` extension. 7 | 8 | This extension provides support for reading and writing gzip (.gz) compressed 9 | files. 10 | 11 | ## PHP_EXT_ZLIB 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_ZLIB_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/fileinfo.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/fileinfo/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/fileinfo/CMakeLists.txt) 3 | 4 | # The fileinfo extension 5 | 6 | Configure the `fileinfo` extension. 7 | 8 | This extension provides support for file content type and encoding. 9 | 10 | ## PHP_EXT_FILEINFO 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_FILEINFO_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/xmlreader.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/xmlreader/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/xmlreader/CMakeLists.txt) 3 | 4 | # The xmlreader extension 5 | 6 | Configure the `xmlreader` extension. 7 | 8 | This extension provides support for for XML pull parser. 9 | 10 | ## PHP_EXT_XMLREADER 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_XMLREADER_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/xmlwriter.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/xmlwriter/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/xmlwriter/CMakeLists.txt) 3 | 4 | # The xmlwriter extension 5 | 6 | Configure the `xmlwriter` extension. 7 | 8 | This extension provides support for libxml xmlWriter API. 9 | 10 | ## PHP_EXT_XMLWRITER 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_XMLWRITER_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/ctype.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/ctype/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/ctype/CMakeLists.txt) 3 | 4 | # The ctype extension 5 | 6 | Configure the `ctype` extension. 7 | 8 | This extension provides support for character type checking according to the 9 | locale. 10 | 11 | ## PHP_EXT_CTYPE 12 | 13 | * Default: `ON` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_CTYPE_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/dom.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/dom/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/dom/CMakeLists.txt) 3 | 4 | # The dom extension 5 | 6 | Configure the `dom` extension. 7 | 8 | This extension provides support for operations on XML and HTML through Document 9 | Object Model (DOM). 10 | 11 | ## PHP_EXT_DOM 12 | 13 | * Default: `ON` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_DOM_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/iconv.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/iconv/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/iconv/CMakeLists.txt) 3 | 4 | # The iconv extension 5 | 6 | Configure the `iconv` extension. 7 | 8 | This extension provides support for interface to iconv character set conversion 9 | facility. 10 | 11 | ## PHP_EXT_ICONV 12 | 13 | * Default: `ON` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_ICONV_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/pdo_pgsql.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pdo_pgsql/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pdo_pgsql/CMakeLists.txt) 3 | 4 | # The pdo_pgsql extension 5 | 6 | Configure the `pdo_pgsql` extension. 7 | 8 | This extension provides PDO interface for using PostgreSQL database. 9 | 10 | ## PHP_EXT_PDO_PGSQL 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_PDO_PGSQL_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/sockets.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/sockets/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/sockets/CMakeLists.txt) 3 | 4 | # The sockets extension 5 | 6 | Configure the `sockets` extension. 7 | 8 | This extension provides support for a low-level socket communication interface. 9 | 10 | ## PHP_EXT_SOCKETS 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_SOCKETS_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/zend_test.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/zend_test/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/zend_test/CMakeLists.txt) 3 | 4 | # The zend_test extension 5 | 6 | Configure the `zend_test` extension. 7 | 8 | This extension provides additional support for testing PHP itself. 9 | 10 | ## PHP_EXT_ZEND_TEST 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_ZEND_TEST_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/pdo_sqlite.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pdo_sqlite/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pdo_sqlite/CMakeLists.txt) 3 | 4 | # The pdo_sqlite extension 5 | 6 | Configure the `pdo_sqlite` extension. 7 | 8 | This extension provides PDO interface for using SQLite database. 9 | 10 | ## PHP_EXT_PDO_SQLITE 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_PDO_SQLITE_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/simplexml.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/simplexml/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/simplexml/CMakeLists.txt) 3 | 4 | # The simplexml extension 5 | 6 | Configure the `simplexml` extension. 7 | 8 | This extension provides toolset for converting XML to a processable object. 9 | 10 | ## PHP_EXT_SIMPLEXML 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_SIMPLEXML_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/tidy.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/tidy/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/tidy/CMakeLists.txt) 3 | 4 | # The tidy extension 5 | 6 | Configure the `tidy` extension. 7 | 8 | This extension provides support for Tidy HTML utility support to handle HTML, 9 | XHTML and XML documents. 10 | 11 | ## PHP_EXT_TIDY 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_TIDY_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_INCLUDE_PREFIX.md: -------------------------------------------------------------------------------- 1 | # `PHP_INCLUDE_PREFIX` 2 | 3 | * Default: `php` 4 | 5 | The relative directory inside the `CMAKE_INSTALL_INCLUDEDIR`, where to install 6 | PHP headers. For example, `php/8.6` to specify version or other build-related 7 | characteristics and have multiple PHP versions installed. Absolute paths are 8 | treated as relative. Set `CMAKE_INSTALL_INCLUDEDIR` if absolute path needs to be 9 | set. 10 | 11 | With default install prefix, on *nix systems 12 | `/usr/local/include/${PHP_INCLUDE_PREFIX}/`, on Windows 13 | `C:/Program Files/PHP/include/${PHP_INCLUDE_PREFIX}/`. 14 | -------------------------------------------------------------------------------- /docs/cmake/ext/gettext.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/gettext/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/gettext/CMakeLists.txt) 3 | 4 | # The gettext extension 5 | 6 | Configure the `gettext` extension. 7 | 8 | This extension provides support for GNU gettext using NLS (Native Language 9 | Support) API. 10 | 11 | ## PHP_EXT_GETTEXT 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_GETTEXT_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/sodium.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/sodium/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/sodium/CMakeLists.txt) 3 | 4 | # The sodium extension 5 | 6 | Configure the `sodium` extension. 7 | 8 | This extension provides support for encryption, decryption, signatures and 9 | password hashing. 10 | 11 | ## PHP_EXT_SODIUM 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_SODIUM_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/pdo_firebird.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pdo_firebird/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pdo_firebird/CMakeLists.txt) 3 | 4 | # The pdo_firebird extension 5 | 6 | Configure the `pdo_firebird` extension. 7 | 8 | This extension provides PDO interface for using Firebird database. 9 | 10 | ## PHP_EXT_PDO_FIREBIRD 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_PDO_FIREBIRD_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | -------------------------------------------------------------------------------- /docs/cmake/ext/tokenizer.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/tokenizer/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/tokenizer/CMakeLists.txt) 3 | 4 | # The tokenizer extension 5 | 6 | Configure the `tokenizer` extension. 7 | 8 | This extension provides an interface to the PHP tokenizer embedded in the Zend 9 | Engine. 10 | 11 | ## PHP_EXT_TOKENIZER 12 | 13 | * Default: `ON` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_TOKENIZER_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /cmake/ext/session/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the system has the 'mm' library. */ 2 | #cmakedefine HAVE_LIBMM 1 3 | 4 | /* Define to 1 if the PHP extension 'session' is available. */ 5 | #cmakedefine HAVE_PHP_SESSION 1 6 | 7 | /* Define to 1 if you have the 'pread' function. */ 8 | #cmakedefine HAVE_PREAD 1 9 | 10 | /* Define to 1 if you have the 'pwrite' function. */ 11 | #cmakedefine HAVE_PWRITE 1 12 | 13 | /* Define to 1 if 'pread' declaration with 'off64_t' is missing. */ 14 | #cmakedefine PHP_PREAD_64 1 15 | 16 | /* Define to 1 if 'pwrite' declaration with 'off64_t' is missing. */ 17 | #cmakedefine PHP_PWRITE_64 1 18 | -------------------------------------------------------------------------------- /docs/cmake/ext/pdo_dblib.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pdo_dblib/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pdo_dblib/CMakeLists.txt) 3 | 4 | # The pdo_dblib extension 5 | 6 | Configure the `pdo_dblib` extension. 7 | 8 | This extension provides PDO interface for using Microsoft SQL Server and Sybase 9 | databases. 10 | 11 | ## PHP_EXT_PDO_DBLIB 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_PDO_DBLIB_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | -------------------------------------------------------------------------------- /docs/cmake/ext/posix.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/posix/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/posix/CMakeLists.txt) 3 | 4 | # The posix extension 5 | 6 | Configure the `posix` extension. 7 | 8 | This extension provides support for POSIX-like functions. 9 | 10 | > [!NOTE] 11 | > This extension is available only on \*nix systems. 12 | 13 | ## PHP_EXT_POSIX 14 | 15 | * Default: `ON` 16 | * Values: `ON|OFF` 17 | 18 | Enable the extension. 19 | 20 | ## PHP_EXT_POSIX_SHARED 21 | 22 | * Default: `OFF` 23 | * Values: `ON|OFF` 24 | 25 | Build extension as shared. 26 | -------------------------------------------------------------------------------- /docs/cmake/ext/sysvsem.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/sysvsem/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/sysvsem/CMakeLists.txt) 3 | 4 | # The sysvsem extension 5 | 6 | Configure the `sysvsem` extension. 7 | 8 | This extension provides the System V semaphore support. 9 | 10 | > [!NOTE] 11 | > This extension is available only on \*nix systems. 12 | 13 | ## PHP_EXT_SYSVSEM 14 | 15 | * Default: `OFF` 16 | * Values: `ON|OFF` 17 | 18 | Enable the extension. 19 | 20 | ## PHP_EXT_SYSVSEM_SHARED 21 | 22 | * Default: `OFF` 23 | * Values: `ON|OFF` 24 | 25 | Build extension as shared. 26 | -------------------------------------------------------------------------------- /cmake/ext/standard/cmake/GenerateGrammar.cmake: -------------------------------------------------------------------------------- 1 | # Generate lexer files. 2 | 3 | if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE) 4 | message(FATAL_ERROR "This file should be used with include().") 5 | endif() 6 | 7 | include(PHP/Re2c) 8 | 9 | php_re2c( 10 | php_ext_standard_url_scanner_ex 11 | url_scanner_ex.re 12 | ${CMAKE_CURRENT_SOURCE_DIR}/url_scanner_ex.c 13 | ADD_DEFAULT_OPTIONS 14 | OPTIONS --bit-vectors 15 | CODEGEN 16 | ) 17 | 18 | php_re2c( 19 | php_ext_standard_var_unserializer 20 | var_unserializer.re 21 | ${CMAKE_CURRENT_SOURCE_DIR}/var_unserializer.c 22 | ADD_DEFAULT_OPTIONS 23 | OPTIONS --bit-vectors 24 | CODEGEN 25 | ) 26 | -------------------------------------------------------------------------------- /cmake/cmake/Platform.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Platform-specific configuration. 3 | #]=============================================================================] 4 | 5 | include_guard(GLOBAL) 6 | 7 | # Platform-specific configuration. When cross-compiling, the host and target can 8 | # be different values with different configurations. 9 | if(NOT CMAKE_HOST_SYSTEM_NAME EQUAL CMAKE_SYSTEM_NAME) 10 | include( 11 | ${CMAKE_CURRENT_LIST_DIR}/platforms/${CMAKE_HOST_SYSTEM_NAME}.cmake 12 | OPTIONAL 13 | ) 14 | endif() 15 | include(${CMAKE_CURRENT_LIST_DIR}/platforms/${CMAKE_SYSTEM_NAME}.cmake OPTIONAL) 16 | -------------------------------------------------------------------------------- /docs/cmake/ext/readline.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/readline/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/readline/CMakeLists.txt) 3 | 4 | # The readline extension 5 | 6 | Configure the `readline` extension. 7 | 8 | This extension provides interface for using Editline library. 9 | 10 | > [!IMPORTANT] 11 | > This extension should be used only with CLI-based PHP SAPIs. 12 | 13 | ## PHP_EXT_READLINE 14 | 15 | * Default: `OFF` 16 | * Values: `ON|OFF` 17 | 18 | Enable the extension. 19 | 20 | ## PHP_EXT_READLINE_SHARED 21 | 22 | * Default: `OFF` 23 | * Values: `ON|OFF` 24 | 25 | Build extension as shared. 26 | -------------------------------------------------------------------------------- /docs/cmake/ext/ftp.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/ftp/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/ftp/CMakeLists.txt) 3 | 4 | # The ftp extension 5 | 6 | Configure the `ftp` extension. 7 | 8 | This extension provides support for File Transfer Protocol (FTP). 9 | 10 | ## PHP_EXT_FTP 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_FTP_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | 24 | ## PHP_EXT_FTP_SSL 25 | 26 | * Default: `ON` 27 | * Values: `ON|OFF` 28 | 29 | Explicitly enable or disable FTP over SSL support. 30 | -------------------------------------------------------------------------------- /cmake/ext/iconv/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if iconv implementation is glibc. */ 2 | #cmakedefine HAVE_GLIBC_ICONV 1 3 | 4 | /* Define to 1 if iconv implementation is IBM. */ 5 | #cmakedefine HAVE_IBM_ICONV 1 6 | 7 | /* Define to 1 if the PHP extension 'iconv' is available. */ 8 | #cmakedefine HAVE_ICONV 1 9 | 10 | /* Define to 1 if you have the 'libiconv' function. */ 11 | #cmakedefine HAVE_LIBICONV 1 12 | 13 | /* Define to 1 if 'iconv()' is aliased to 'libiconv()'. */ 14 | #cmakedefine ICONV_ALIASED_LIBICONV 1 15 | 16 | /* Define to 1 if iconv has broken IGNORE. */ 17 | #cmakedefine ICONV_BROKEN_IGNORE 1 18 | 19 | /* The iconv implementation. */ 20 | #cmakedefine PHP_ICONV_IMPL "@PHP_ICONV_IMPL@" 21 | -------------------------------------------------------------------------------- /docs/cmake/ext/sysvmsg.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/sysvmsg/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/sysvmsg/CMakeLists.txt) 3 | 4 | # The sysvmsg extension 5 | 6 | Configure the `sysvmsg` extension. 7 | 8 | This extension provides support for using System V message based IPC 9 | (Interprocess Communication Mechanisms). 10 | 11 | > [!NOTE] 12 | > This extension is available only on \*nix systems. 13 | 14 | ## PHP_EXT_SYSVMSG 15 | 16 | * Default: `OFF` 17 | * Values: `ON|OFF` 18 | 19 | Enable the extension. 20 | 21 | ## PHP_EXT_SYSVMSG_SHARED 22 | 23 | * Default: `OFF` 24 | * Values: `ON|OFF` 25 | 26 | Build extension as shared. 27 | -------------------------------------------------------------------------------- /docs/cmake/ext/xml.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/xml/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/xml/CMakeLists.txt) 3 | 4 | # The xml extension 5 | 6 | Configure the `xml` extension. 7 | 8 | This extension provides support for parsing XML. 9 | 10 | ## PHP_EXT_XML 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_XML_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | 24 | ## PHP_EXT_XML_EXPAT 25 | 26 | * Default: `OFF` 27 | * Values: `ON|OFF` 28 | 29 | Build xml extension with the Expat library support instead of the libxml2. 30 | -------------------------------------------------------------------------------- /cmake/ext/pdo_sqlite/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if SQLite library has the 'sqlite3_close_v2' function. Available 2 | since SQLite 3.7.14. */ 3 | #define HAVE_SQLITE3_CLOSE_V2 1 4 | 5 | /* Define to 1 if SQLite library was compiled with the 6 | SQLITE_ENABLE_COLUMN_METADATA and has the 'sqlite3_column_table_name' 7 | function. */ 8 | #cmakedefine HAVE_SQLITE3_COLUMN_TABLE_NAME 1 9 | 10 | /* Define to 1 if SQLite library was compiled with the 11 | SQLITE_OMIT_LOAD_EXTENSION and does not have the extension support with the 12 | 'sqlite3_load_extension' function. For usage in the pdo_sqlite. See 13 | https://www.sqlite.org/compile.html. */ 14 | #cmakedefine PDO_SQLITE_OMIT_LOAD_EXTENSION 1 15 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_ZEND_MAX_EXECUTION_TIMERS.md: -------------------------------------------------------------------------------- 1 | # `PHP_ZEND_MAX_EXECUTION_TIMERS` 2 | 3 | * Default: `auto` 4 | * Values: `auto|ON|OFF` 5 | 6 | Zend max execution timers help with timeout and signal handling issues, 7 | especially when thread safety is enabled. 8 | 9 | When set to `auto`, the Zend Max execution timers are enabled whether the thread 10 | safety (`PHP_THREAD_SAFETY`) is enabled and whether the target system supports 11 | them. When set to `ON` they get enabled whether the target system supports them 12 | regardless of the `PHP_THREAD_SAFETY` option. When set to `OFF`, they are always 13 | disabled. 14 | 15 | > [!NOTE] 16 | > This option is not available when the target system is Windows. 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org/ 2 | 3 | root = true 4 | 5 | [*] 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | indent_style = space 9 | end_of_line = lf 10 | indent_size = 4 11 | tab_width = 4 12 | charset = utf-8 13 | 14 | [*.{c,h}] 15 | indent_style = tab 16 | 17 | [*.{html,json,md,sh,toml,yaml,yml}] 18 | indent_size = 2 19 | 20 | [Makefile] 21 | indent_style = tab 22 | 23 | [*.patch] 24 | trim_trailing_whitespace = false 25 | 26 | [COMMIT_EDITMSG] 27 | max_line_length = 80 28 | 29 | [{CMakeLists.{txt,txt.in},*.{cmake,cmake.in}}] 30 | indent_size = 2 31 | -------------------------------------------------------------------------------- /docs/cmake/ext/ldap.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/ldap/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/ldap/CMakeLists.txt) 3 | 4 | # The ldap extension 5 | 6 | Configure the `ldap` extension. 7 | 8 | This extension provides support for LDAP (Lightweight Directory Access 9 | Protocol). 10 | 11 | ## PHP_EXT_LDAP 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_LDAP_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | 25 | ## PHP_EXT_LDAP_SASL 26 | 27 | * Default: `OFF` 28 | * Values: `ON|OFF` 29 | 30 | Build ldap extension with Cyrus SASL support. 31 | -------------------------------------------------------------------------------- /docs/cmake/ext/mbstring.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/mbstring/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/mbstring/CMakeLists.txt) 3 | 4 | # The mbstring extension 5 | 6 | Configure the `mbstring` extension. 7 | 8 | This extension provides the multibyte string support. 9 | 10 | ## PHP_EXT_MBSTRING 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_MBSTRING_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | 24 | ## PHP_EXT_MBSTRING_MBREGEX 25 | 26 | * Default: `ON` 27 | * Values: `ON|OFF` 28 | 29 | Enable multibyte regex support (requires Oniguruma). 30 | -------------------------------------------------------------------------------- /docs/cmake/ext/pcntl.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pcntl/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pcntl/CMakeLists.txt) 3 | 4 | # The pcntl extension 5 | 6 | Configure the `pcntl` extension. 7 | 8 | This extension provides support for process control support. 9 | 10 | > [!NOTE] 11 | > This extension is available only on \*nix systems. 12 | 13 | > [!IMPORTANT] 14 | > This extension should be used only with CLI-based PHP SAPIs. 15 | 16 | ## PHP_EXT_PCNTL 17 | 18 | * Default: `OFF` 19 | * Values: `ON|OFF` 20 | 21 | Enable the extension. 22 | 23 | ## PHP_EXT_PCNTL_SHARED 24 | 25 | * Default: `OFF` 26 | * Values: `ON|OFF` 27 | 28 | Build extension as shared. 29 | -------------------------------------------------------------------------------- /cmake/ext/readline/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if edit library has the 'rl_erase_empty_line' global 2 | variable. */ 3 | #cmakedefine HAVE_ERASE_EMPTY_LINE 1 4 | 5 | /* Define to 1 if edit library has the 'history_list' function. */ 6 | #cmakedefine HAVE_HISTORY_LIST 1 7 | 8 | /* Define to 1 if PHP uses the 'libedit' library. */ 9 | #cmakedefine HAVE_LIBEDIT 1 10 | 11 | /* Define to 1 if edit library has the 'rl_callback_read_char' function. */ 12 | #cmakedefine HAVE_RL_CALLBACK_READ_CHAR 1 13 | 14 | /* Define to 1 if edit library has the 'rl_completion_matches' function. */ 15 | #cmakedefine HAVE_RL_COMPLETION_MATCHES 1 16 | 17 | /* Define to 1 if edit library has the 'rl_on_new_line' function. */ 18 | #cmakedefine HAVE_RL_ON_NEW_LINE 1 19 | -------------------------------------------------------------------------------- /docs/cmake/ext/standard.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/standard/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/standard/CMakeLists.txt) 3 | 4 | # The standard extension 5 | 6 | Configure the `standard` extension. 7 | 8 | This is an always enabled core PHP extension that provides common functionality 9 | to PHP extensions and SAPIs. 10 | 11 | ## PHP_EXT_STANDARD_ARGON2 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Include the Argon2 support in `password_*()` functions. 17 | 18 | ## PHP_EXT_STANDARD_CRYPT_EXTERNAL 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Use external crypt library, such as libcrypt or libxcrypt, instead of the 24 | bundled PHP crypt. 25 | -------------------------------------------------------------------------------- /cmake/ext/sqlite3/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'sqlite3' is available. */ 2 | #cmakedefine HAVE_SQLITE3 1 3 | 4 | /* Define to 1 if SQLite library has the 'sqlite3_errstr' function. Available 5 | since SQLite 3.7.15. */ 6 | #define HAVE_SQLITE3_ERRSTR 1 7 | 8 | /* Define to 1 if SQLite library has the 'sqlite3_expanded_sql' function. 9 | Available since SQLite 3.14.0. */ 10 | #cmakedefine HAVE_SQLITE3_EXPANDED_SQL 1 11 | 12 | /* Define to 1 if SQLite library was compiled with the 13 | SQLITE_OMIT_LOAD_EXTENSION and does not have the extension support with the 14 | 'sqlite3_load_extension' function. For usage in the sqlite3 PHP extension. 15 | See https://www.sqlite.org/compile.html. */ 16 | #cmakedefine SQLITE_OMIT_LOAD_EXTENSION 1 17 | -------------------------------------------------------------------------------- /docs/cmake/ext/session.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/session/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/session/CMakeLists.txt) 3 | 4 | # The session extension 5 | 6 | Configure the `session` extension. 7 | 8 | This extension provides support for sessions to preserve data across subsequent 9 | accesses. 10 | 11 | ## PHP_EXT_SESSION 12 | 13 | * Default: `ON` 14 | * Values: `ON|OFF` 15 | 16 | Enable the extension. 17 | 18 | ## PHP_EXT_SESSION_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared. 24 | 25 | ## PHP_EXT_SESSION_MM 26 | 27 | * Default: `OFF` 28 | * Values: `ON|OFF` 29 | 30 | Include libmm support for session storage (only for non-ZTS build). 31 | -------------------------------------------------------------------------------- /docs/cmake/sapi/cli.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [sapi/cli/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/sapi/cli/CMakeLists.txt) 3 | 4 | # The cli SAPI 5 | 6 | Configure the `cli` PHP SAPI. 7 | 8 | ## PHP_SAPI_CLI 9 | 10 | * Default: `ON` 11 | * Values: `ON|OFF` 12 | 13 | Enable the PHP CLI (Command-Line Interpreter/Interface) SAPI executable module. 14 | 15 | ## PHP_SAPI_CLI_WIN_NO_CONSOLE 16 | 17 | * Default: `OFF` 18 | * Values: `ON|OFF` 19 | 20 | Build additional console-less CLI SAPI executable (executable name `php-win`). 21 | Same as the main CLI SAPI (`php`) but without the console (no output is given). 22 | 23 | > [!NOTE] 24 | > This option is only available when the target system is Windows. 25 | -------------------------------------------------------------------------------- /cmake/cmake/modules/FindLibXslt.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # FindLibXslt 3 | 4 | This module overrides the upstream CMake `FindLibXslt` module. 5 | 6 | See: https://cmake.org/cmake/help/latest/module/FindLibXslt.html 7 | #]=============================================================================] 8 | 9 | include(FeatureSummary) 10 | 11 | set_package_properties( 12 | LibXslt 13 | PROPERTIES 14 | URL "https://gitlab.gnome.org/GNOME/libxslt" 15 | DESCRIPTION "XSLT processor library" 16 | ) 17 | 18 | # Find package with upstream CMake find module. Absolute path prevents the 19 | # maximum nesting/recursion depth error on some systems, like macOS. 20 | include(${CMAKE_ROOT}/Modules/FindLibXslt.cmake) 21 | -------------------------------------------------------------------------------- /cmake/ext/openssl/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 to enable OpenSSL argon2 password hashing. */ 2 | #cmakedefine HAVE_OPENSSL_ARGON2 1 3 | 4 | /* Define to 1 if the PHP extension 'openssl' is available. */ 5 | #cmakedefine HAVE_OPENSSL_EXT 1 6 | 7 | /* Define to 1 if OpenSSL crypto library was built with Entropy Gathering 8 | Daemon (EGD) support (see the no-egd option of OpenSSL Configure script) 9 | and has the 'RAND_egd' function. */ 10 | #cmakedefine HAVE_RAND_EGD 1 11 | 12 | /* Define to 1 to load the OpenSSL legacy algorithm provider in addition to 13 | the default provider. */ 14 | #cmakedefine LOAD_OPENSSL_LEGACY_PROVIDER 1 15 | 16 | /* Define to 1 to use system default cipher list instead of the hardcoded 17 | value in OpenSSL. */ 18 | #cmakedefine USE_OPENSSL_SYSTEM_CIPHERS 1 19 | -------------------------------------------------------------------------------- /docs/cmake/modules/PHP/VerboseLink.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/PHP/VerboseLink.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/PHP/VerboseLink.cmake) 3 | 4 | # PHP/VerboseLink 5 | 6 | This module checks whether to enable verbose output by linker: 7 | 8 | ```cmake 9 | include(PHP/VerboseLink) 10 | ``` 11 | 12 | This module provides the `PHP_VERBOSE_LINK` option to control enabling the 13 | verbose link output. Verbose linker flag is added to the global `php_config` 14 | target. 15 | 16 | ## Examples 17 | 18 | When configuring project, enable the `PHP_VERBOSE_LINK` option to get verbose 19 | output at the link step: 20 | 21 | ```sh 22 | cmake -B php-build -D PHP_VERBOSE_LINK=ON 23 | cmake --build php-build -j 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # PHP build system documentation 2 | 3 | ![ElePHPant](images/elephpant.jpg) 4 | 5 | * CMake 6 | * [Introduction to CMake](/docs/cmake/introduction.md) 7 | * [CMake-based PHP build system](/docs/cmake/cmake.md) 8 | * [Configuration](/docs/cmake/configuration.md) 9 | * [CMake code style](/docs/cmake/cmake-code-style.md) 10 | * [PHP native and CMake-based build system differences](/docs/cmake/differences.md) 11 | * [Dependencies in C/C++ projects](/docs/dependencies.md) 12 | * [Autotools-based PHP build system](/docs/autotools/README.md) 13 | * [Windows build system for PHP](/docs/windows/README.md) 14 | * [Cross-compiling](/docs/cross-compiling.md) 15 | * [PHP build system evolution](/docs/evolution.md) 16 | * [Introduction to C](/docs/c.md) 17 | * [Frequently asked questions](/docs/faq.md) 18 | -------------------------------------------------------------------------------- /cmake/cmake/platforms/SunOS.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Configuration specific to SunOS operating systems (Solaris, illumos, etc.). 3 | #]=============================================================================] 4 | 5 | include_guard(GLOBAL) 6 | 7 | if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") 8 | # Issue a warning for Solaris 10 system on this build system due to compile 9 | # warnings and issues with outdated dependencies. 10 | if(CMAKE_SYSTEM_VERSION VERSION_LESS 5.11) 11 | message( 12 | WARNING 13 | "Solaris 10 with support from 2005 to 2027 might have a limited " 14 | "functionality. Check if you can upgrade to Solaris 11 or later, or try " 15 | "one of the illumos-based distributions." 16 | ) 17 | endif() 18 | endif() 19 | -------------------------------------------------------------------------------- /cmake/ext/fileinfo/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the system has the 'visibility' function attribute */ 2 | #cmakedefine HAVE_FUNC_ATTRIBUTE_VISIBILITY 1 3 | 4 | /* Define to 1 if you have the 'strcasestr' function. */ 5 | #cmakedefine HAVE_STRCASESTR 1 6 | 7 | /* Define to 1 if you have the 'strndup' function. */ 8 | #cmakedefine HAVE_STRNDUP 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #cmakedefine HAVE_SYS_SYSMACROS_H 1 12 | 13 | /* Define to 1 if you have the 'utimes' function. */ 14 | #cmakedefine HAVE_UTIMES 1 15 | 16 | /* Define to 1 if 'major', 'minor', and 'makedev' are declared in . 17 | */ 18 | #cmakedefine MAJOR_IN_MKDEV 1 19 | 20 | /* Define to 1 if 'major', 'minor', and 'makedev' are declared in 21 | . */ 22 | #cmakedefine MAJOR_IN_SYSMACROS 1 23 | -------------------------------------------------------------------------------- /cmake/ext/opcache/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if Capstone is available. */ 2 | #cmakedefine HAVE_CAPSTONE 1 3 | 4 | /* Define to 1 to enable copying PHP CODE pages into HUGE PAGES. */ 5 | #cmakedefine HAVE_HUGE_CODE_PAGES 1 6 | 7 | /* Define to 1 to enable JIT. */ 8 | #cmakedefine HAVE_JIT 1 9 | 10 | /* Define to 1 if you have the 'mprotect' function. */ 11 | #cmakedefine HAVE_MPROTECT 1 12 | 13 | /* Define to 1 if you have the 'shm_create_largepage' function. */ 14 | #cmakedefine HAVE_SHM_CREATE_LARGEPAGE 1 15 | 16 | /* Define to 1 if you have the SysV IPC SHM support. */ 17 | #cmakedefine HAVE_SHM_IPC 1 18 | 19 | /* Define to 1 if you have the mmap(MAP_ANON) SHM support. */ 20 | #cmakedefine HAVE_SHM_MMAP_ANON 1 21 | 22 | /* Define to 1 if you have the POSIX mmap() SHM support. */ 23 | #cmakedefine HAVE_SHM_MMAP_POSIX 1 24 | -------------------------------------------------------------------------------- /cmake/ext/tidy/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'tidy' is available. */ 2 | #cmakedefine HAVE_TIDY 1 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #cmakedefine HAVE_TIDYBUFFIO_H 1 6 | 7 | /* Define to 1 if Tidy library has the 'tidyOptGetCategory' function and 8 | supports the 'TidyInternalCategory' enumeration. */ 9 | #cmakedefine HAVE_TIDYOPTGETCATEGORY 1 10 | 11 | /* Define to 1 if Tidy library has the 'tidyOptGetDoc' function. */ 12 | #cmakedefine HAVE_TIDYOPTGETDOC 1 13 | 14 | /* Define to 1 if you have the header file. */ 15 | #cmakedefine HAVE_TIDYP_H 1 16 | 17 | /* Define to 1 if Tidy library has the 'tidyReleaseDate' function. */ 18 | #cmakedefine HAVE_TIDYRELEASEDATE 1 19 | 20 | /* Define to 1 if you have the header file. */ 21 | #cmakedefine HAVE_TIDY_H 1 22 | -------------------------------------------------------------------------------- /docs/cmake/sapi/embed.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [sapi/embed/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/sapi/embed/CMakeLists.txt) 3 | 4 | # The embed SAPI 5 | 6 | Configure the `embed` PHP SAPI. 7 | 8 | ## PHP_SAPI_EMBED 9 | 10 | * Default: `OFF` 11 | * Values: `ON|OFF` 12 | 13 | Enable the embedded PHP SAPI module for embedding PHP into application using C 14 | bindings. 15 | 16 | The embed library is after the build phase located in the `sapi/embed` 17 | directory: 18 | 19 | * as a shared library `libphp.so` (\*nix), or `libphp.dylib` (macOS), or 20 | `phpembed.dll` (Windows) 21 | * and a static library `libphp.a` (\*nix), or `phpembed.lib` (Windows) 22 | 23 | which can be further used in other applications. It exposes PHP API as C library 24 | for other programs to use PHP. 25 | -------------------------------------------------------------------------------- /patches/README.md: -------------------------------------------------------------------------------- 1 | # Patches for php-src 2 | 3 | This is a collection of patches for various PHP versions in order to use CMake 4 | or due to upstream unresolved bugs. Each patch has a description attached in its 5 | header. They are automatically applied when building PHP with CMake in this 6 | repository. 7 | 8 | To create a new patch: 9 | 10 | ```sh 11 | git --no-pager format-patch -1 HEAD --stdout > some.patch 12 | ``` 13 | 14 | To modify existing patches: 15 | 16 | ```sh 17 | cd php-src 18 | git checkout -b some-patch 19 | 20 | # Apply existing patch 21 | git am -3 some.patch 22 | 23 | # ... Make and commit changes 24 | 25 | # Update some.patch file 26 | git --no-pager format-patch -1 HEAD --stdout > some.patch 27 | ``` 28 | 29 | To update patches against the latest upstream tracking Git branches: 30 | 31 | ```sh 32 | ./bin/update-patches.sh 33 | ``` 34 | -------------------------------------------------------------------------------- /cmake/ext/json/cmake/GenerateGrammar.cmake: -------------------------------------------------------------------------------- 1 | # Generate parser and lexer files. 2 | 3 | if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE) 4 | message(FATAL_ERROR "This file should be used with include().") 5 | endif() 6 | 7 | include(PHP/Bison) 8 | 9 | if(CMAKE_SCRIPT_MODE_FILE) 10 | set(verbose "") 11 | else() 12 | set(verbose VERBOSE) 13 | endif() 14 | 15 | php_bison( 16 | php_ext_json_parser 17 | json_parser.y 18 | ${CMAKE_CURRENT_SOURCE_DIR}/json_parser.tab.c 19 | HEADER 20 | ADD_DEFAULT_OPTIONS 21 | ${verbose} 22 | CODEGEN 23 | ) 24 | 25 | include(PHP/Re2c) 26 | 27 | php_re2c( 28 | php_ext_json_scanner 29 | json_scanner.re 30 | ${CMAKE_CURRENT_SOURCE_DIR}/json_scanner.c 31 | HEADER ${CMAKE_CURRENT_SOURCE_DIR}/php_json_scanner_defs.h 32 | ADD_DEFAULT_OPTIONS 33 | OPTIONS --bit-vectors --conditions 34 | CODEGEN 35 | ) 36 | -------------------------------------------------------------------------------- /docs/cmake/ext/pcre.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pcre/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pcre/CMakeLists.txt) 3 | 4 | # The pcre extension 5 | 6 | Configure the `pcre` extension. 7 | 8 | This extension provides support for (Perl-compatible) regular expressions and is 9 | always enabled. 10 | 11 | ## PHP_EXT_PCRE_EXTERNAL 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Use external (system) PCRE library in pcre extension instead of the bundled PCRE 17 | library that comes with PHP sources. 18 | 19 | ## PHP_EXT_PCRE_JIT 20 | 21 | * Default: `ON` 22 | * Values: `ON|OFF` 23 | 24 | Enable PCRE JIT (just-in-time) compilation. When using the external PCRE 25 | library, JIT support also depends on the target processor architecture and 26 | whether the PCRE library has it enabled. 27 | -------------------------------------------------------------------------------- /cmake/sapi/phpdbg/cmake/GenerateGrammar.cmake: -------------------------------------------------------------------------------- 1 | # Generate parser and lexer files. 2 | 3 | if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE) 4 | message(FATAL_ERROR "This file should be used with include().") 5 | endif() 6 | 7 | include(PHP/Bison) 8 | 9 | if(CMAKE_SCRIPT_MODE_FILE) 10 | set(verbose "") 11 | else() 12 | set(verbose VERBOSE) 13 | endif() 14 | 15 | php_bison( 16 | php_sapi_phpdbg_parser 17 | phpdbg_parser.y 18 | ${CMAKE_CURRENT_SOURCE_DIR}/phpdbg_parser.c 19 | HEADER 20 | ADD_DEFAULT_OPTIONS 21 | ${verbose} 22 | CODEGEN 23 | ) 24 | 25 | include(PHP/Re2c) 26 | 27 | php_re2c( 28 | php_sapi_phpdbg_lexer 29 | phpdbg_lexer.l 30 | ${CMAKE_CURRENT_SOURCE_DIR}/phpdbg_lexer.c 31 | ADD_DEFAULT_OPTIONS 32 | OPTIONS 33 | --bit-vectors 34 | --conditions 35 | --debug-output 36 | --flex-syntax 37 | CODEGEN 38 | ) 39 | -------------------------------------------------------------------------------- /docs/cmake/sapi/fuzzer.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [sapi/fuzzer/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/sapi/fuzzer/CMakeLists.txt) 3 | 4 | # The fuzzer SAPI 5 | 6 | Configure the `fuzzer` PHP SAPI. 7 | 8 | > [!NOTE] 9 | > This SAPI is not available when the target system is Windows. 10 | 11 | ## PHP_SAPI_FUZZER 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the fuzzer SAPI module - PHP as Clang fuzzing test module (for 17 | developers). For relevant flags on newer Clang versions see 18 | https://llvm.org/docs/LibFuzzer.html#fuzzer-usage 19 | 20 | ## LIB_FUZZING_ENGINE 21 | 22 | * Default: empty 23 | 24 | OSS-Fuzz: C++ compiler argument to link fuzz target against the prebuilt engine 25 | library (e.g. libFuzzer). Can be also environment variable. See 26 | https://google.github.io/oss-fuzz 27 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_THREAD_SAFETY.md: -------------------------------------------------------------------------------- 1 | # `PHP_THREAD_SAFETY` 2 | 3 | * Default: `OFF` 4 | * Values: `ON|OFF` 5 | 6 | Better known as Zend Thread Safety (ZTS), this feature allows PHP to handle 7 | multiple threads safely in web server environments that require thread-safe 8 | execution. 9 | 10 | For instance, if Apache uses PHP with a threaded Multi-Processing Module (MPM) 11 | or on Windows, PHP must be configured and built with `PHP_THREAD_SAFETY` set to 12 | `ON`. Thread safety is also enabled automatically during configuration if a 13 | threaded Apache is detected on the system. 14 | 15 | Since enabling thread safety adds complexity to PHP usage and installation due 16 | to separate builds of PHP SAPIs and extensions, it is recommended to enable it 17 | only when necessary. At the time of writing, the non-thread-safe (NTS) PHP build 18 | may be a better choice for most environments. 19 | -------------------------------------------------------------------------------- /patches/8.3/dmalloc.patch: -------------------------------------------------------------------------------- 1 | From: Peter Kokot 2 | Subject: Fix Dmalloc build 3 | 4 | Header php.h needs to be included ahead when building with 5 | --enable-dmalloc. 6 | 7 | See: https://github.com/php/php-src/pull/8465 8 | --- 9 | sapi/cli/php_cli_server.c | 3 ++- 10 | 1 file changed, 2 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c 13 | index df01d3df911..d197a7d779a 100644 14 | --- a/sapi/cli/php_cli_server.c 15 | +++ b/sapi/cli/php_cli_server.c 16 | @@ -15,6 +15,8 @@ 17 | +----------------------------------------------------------------------+ 18 | */ 19 | 20 | +#include "php.h" 21 | + 22 | #include 23 | #include 24 | #include 25 | @@ -59,7 +61,6 @@ 26 | #endif 27 | 28 | #include "SAPI.h" 29 | -#include "php.h" 30 | #include "php_ini.h" 31 | #include "php_main.h" 32 | #include "php_globals.h" 33 | -------------------------------------------------------------------------------- /patches/8.4/dmalloc.patch: -------------------------------------------------------------------------------- 1 | From: Peter Kokot 2 | Subject: Fix Dmalloc build 3 | 4 | Header php.h needs to be included ahead when building with 5 | --enable-dmalloc. 6 | 7 | See: https://github.com/php/php-src/pull/8465 8 | --- 9 | sapi/cli/php_cli_server.c | 3 ++- 10 | 1 file changed, 2 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c 13 | index ebac47d6864..d237d4d479a 100644 14 | --- a/sapi/cli/php_cli_server.c 15 | +++ b/sapi/cli/php_cli_server.c 16 | @@ -15,6 +15,8 @@ 17 | +----------------------------------------------------------------------+ 18 | */ 19 | 20 | +#include "php.h" 21 | + 22 | #include 23 | #include 24 | #include 25 | @@ -60,7 +62,6 @@ 26 | #endif 27 | 28 | #include "SAPI.h" 29 | -#include "php.h" 30 | #include "php_ini.h" 31 | #include "php_main.h" 32 | #include "php_globals.h" 33 | -------------------------------------------------------------------------------- /patches/8.5/dmalloc.patch: -------------------------------------------------------------------------------- 1 | From: Peter Kokot 2 | Subject: Fix Dmalloc build 3 | 4 | Header php.h needs to be included ahead when building with 5 | --enable-dmalloc. 6 | 7 | See: https://github.com/php/php-src/pull/8465 8 | --- 9 | sapi/cli/php_cli_server.c | 3 ++- 10 | 1 file changed, 2 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c 13 | index ae56d143c90..b3ca86bb05d 100644 14 | --- a/sapi/cli/php_cli_server.c 15 | +++ b/sapi/cli/php_cli_server.c 16 | @@ -15,6 +15,8 @@ 17 | +----------------------------------------------------------------------+ 18 | */ 19 | 20 | +#include "php.h" 21 | + 22 | #include 23 | #include 24 | #include 25 | @@ -60,7 +62,6 @@ 26 | #endif 27 | 28 | #include "SAPI.h" 29 | -#include "php.h" 30 | #include "php_ini.h" 31 | #include "php_main.h" 32 | #include "php_globals.h" 33 | -------------------------------------------------------------------------------- /patches/8.6/dmalloc.patch: -------------------------------------------------------------------------------- 1 | From: Peter Kokot 2 | Subject: Fix Dmalloc build 3 | 4 | Header php.h needs to be included ahead when building with 5 | --enable-dmalloc. 6 | 7 | See: https://github.com/php/php-src/pull/8465 8 | --- 9 | sapi/cli/php_cli_server.c | 3 ++- 10 | 1 file changed, 2 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c 13 | index ae56d143c90..b3ca86bb05d 100644 14 | --- a/sapi/cli/php_cli_server.c 15 | +++ b/sapi/cli/php_cli_server.c 16 | @@ -15,6 +15,8 @@ 17 | +----------------------------------------------------------------------+ 18 | */ 19 | 20 | +#include "php.h" 21 | + 22 | #include 23 | #include 24 | #include 25 | @@ -60,7 +62,6 @@ 26 | #endif 27 | 28 | #include "SAPI.h" 29 | -#include "php.h" 30 | #include "php_ini.h" 31 | #include "php_main.h" 32 | #include "php_globals.h" 33 | -------------------------------------------------------------------------------- /docs/cmake/modules/PHP/Optimization.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/PHP/Optimization.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/PHP/Optimization.cmake) 3 | 4 | # PHP/Optimization 5 | 6 | Enable interprocedural optimization (IPO/LTO) on all targets, if supported. 7 | 8 | This adds linker flag `-flto` if it is supported by the compiler to run standard 9 | link-time optimizer. 10 | 11 | It can be also controlled more granular with the 12 | `CMAKE_INTERPROCEDURAL_OPTIMIZATION_` variables based on the build type. 13 | 14 | This module also checks whether IPO/LTO can be enabled based on the PHP 15 | configuration (due to global register variables) and compiler/platform. 16 | 17 | https://cmake.org/cmake/help/latest/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html 18 | 19 | ## Usage 20 | 21 | ```cmake 22 | # CMakeLists.txt 23 | include(PHP/Optimization) 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_EXTENSION_DIR.md: -------------------------------------------------------------------------------- 1 | # `PHP_EXTENSION_DIR` 2 | 3 | * Default: `${CMAKE_INSTALL_LIBDIR}/php/(-zts)-` 4 | 5 | Default directory for dynamically loadable PHP extensions. If left empty, it is 6 | determined automatically. Can be overridden at runtime using the PHP 7 | `extension_dir` INI directive. By default, it is a relative path inside the 8 | installation prefix (`CMAKE_INSTALL_PREFIX`) path. The `ZEND_MODULE_API_NO` is a 9 | value from the `Zend/zend_modules.h`. The `CONFIG` is CMake build type (`Debug`, 10 | `Release`, `DebugAssertions`, `RelWithDebInfo`, `MinSizeRel`). 11 | 12 | For example, default value for the `Release` build type with thread safety 13 | enabled would be `lib/php/20230901-zts-Release`. After the default installation 14 | prefix is prepended, it is `/usr/local/lib/php/202309-zts-Release` on \*nix 15 | systems and `C:/Program Files/PHP/lib/php/202309-zts-Release` on Windows. 16 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | This document lists all notable changes across the main Git branches of this 4 | repository. 5 | 6 | ## PHP 8.6 7 | 8 | * ... 9 | 10 | ## PHP 8.5 11 | 12 | * C11 standard 13 | 14 | New configuration options: 15 | 16 | * PHP_SYSTEM_GLOB 17 | 18 | Removed configuration options: 19 | 20 | * PHP_EXT_ODBC_VERSION 21 | * PHP_EXT_OPCACHE 22 | 23 | ## PHP 8.4 24 | 25 | New configuration variables: 26 | 27 | * PHP_EXT_OPENSSL_ARGON2 28 | * PHP_EXT_OPENSSL_LEGACY_PROVIDER 29 | 30 | Removed configuration variables: 31 | 32 | * ASPELL_ROOT 33 | * CCLIENT_ROOT 34 | * KERBEROS_ROOT 35 | * PHP_EXT_IMAP 36 | * PHP_EXT_IMAP_KERBEROS 37 | * PHP_EXT_IMAP_SHARED 38 | * PHP_EXT_IMAP_SSL 39 | * PHP_EXT_OCI8 40 | * PHP_EXT_OPENSSL_KERBEROS 41 | * PHP_EXT_PDO_OCI 42 | * PHP_EXT_PDO_OCI_SHARED 43 | * PHP_EXT_PSPELL 44 | * PHP_EXT_PSPELL_SHARED 45 | 46 | ## PHP 8.3 47 | 48 | * Added initial build system based on the upstream PHP 8.3 49 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindLibXslt.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindLibXslt.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindLibXslt.cmake) 3 | 4 | # FindLibXslt 5 | 6 | This module overrides the upstream CMake `FindLibXslt` module. 7 | 8 | See: https://cmake.org/cmake/help/latest/module/FindLibXslt.html 9 | 10 | ## Customizing search locations 11 | 12 | To customize where to look for the LibXslt package base 13 | installation directory, a common `CMAKE_PREFIX_PATH` or 14 | package-specific `LIBXSLT_ROOT` variable can be set at 15 | the configuration phase. For example: 16 | 17 | ```sh 18 | cmake -S \ 19 | -B \ 20 | -DCMAKE_PREFIX_PATH="/opt/LibXslt;/opt/some-other-package" 21 | # or 22 | cmake -S \ 23 | -B \ 24 | -DLIBXSLT_ROOT=/opt/LibXslt \ 25 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindICU.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindICU.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindICU.cmake) 3 | 4 | # FindICU 5 | 6 | This module overrides the upstream CMake `FindICU` module with few 7 | customizations: 8 | 9 | * Added pkg-config. 10 | 11 | See: https://cmake.org/cmake/help/latest/module/FindICU.html 12 | 13 | ## Customizing search locations 14 | 15 | To customize where to look for the ICU package base 16 | installation directory, a common `CMAKE_PREFIX_PATH` or 17 | package-specific `ICU_ROOT` variable can be set at 18 | the configuration phase. For example: 19 | 20 | ```sh 21 | cmake -S \ 22 | -B \ 23 | -DCMAKE_PREFIX_PATH="/opt/ICU;/opt/some-other-package" 24 | # or 25 | cmake -S \ 26 | -B \ 27 | -DICU_ROOT=/opt/ICU \ 28 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 29 | ``` 30 | -------------------------------------------------------------------------------- /docs/cmake/ext/pdo_mysql.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/pdo_mysql/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/pdo_mysql/CMakeLists.txt) 3 | 4 | # The pdo_mysql extension 5 | 6 | Configure the `pdo_mysql` extension. 7 | 8 | This extension provides PDO interface for using MySQL-compatible databases. 9 | 10 | ## PHP_EXT_PDO_MYSQL 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the PHP `pdo_mysql` extension. 16 | 17 | ## PHP_EXT_PDO_MYSQL_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared library. 23 | 24 | ## PHP_EXT_PDO_MYSQL_DRIVER 25 | 26 | * Default: `mysqlnd` 27 | * Values: `mysqlnd|mysql` 28 | 29 | Select the MySQL driver for the `pdo_mysql` extension. 30 | 31 | The `mysql` driver uses system MySQL library. Where to find the MySQL library 32 | installation on the system, can be customized with the `MYSQL_ROOT` and 33 | `MySQL_CONFIG_EXECUTABLE` variables. 34 | -------------------------------------------------------------------------------- /docs/cmake/modules/PHP/Extension.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/PHP/Extension.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/PHP/Extension.cmake) 3 | 4 | # PHP/Extension 5 | 6 | This module provides commands to configure PHP extensions. 7 | 8 | Load this module in PHP extension's project: 9 | 10 | ```cmake 11 | include(PHP/Extension) 12 | ``` 13 | 14 | ## Commands 15 | 16 | ### `php_extension()` 17 | 18 | Configures PHP extension: 19 | 20 | ```cmake 21 | php_extension() 22 | ``` 23 | 24 | The arguments are: 25 | 26 | * `` - lowercase name of the PHP extension being configured. 27 | 28 | This command adjusts configuration in the current directory for building PHP 29 | extension and prepares its target for using it with PHP. 30 | 31 | ## Examples 32 | 33 | Configuring PHP extension: 34 | 35 | ```cmake 36 | # ext/foo/CMakeLists.txt 37 | 38 | include(PHP/Extension) 39 | php_extension(foo) 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindIntl.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindIntl.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindIntl.cmake) 3 | 4 | # FindIntl 5 | 6 | This module overrides the upstream CMake `FindIntl` module with few 7 | customizations: 8 | 9 | * Enabled finding Intl library with `CMAKE_PREFIX_PATH`, `Intl_ROOT`, or 10 | `INTL_ROOT` hint variable. 11 | 12 | See: https://cmake.org/cmake/help/latest/module/FindIntl.html 13 | 14 | ## Customizing search locations 15 | 16 | To customize where to look for the Intl package base 17 | installation directory, a common `CMAKE_PREFIX_PATH` or 18 | package-specific `INTL_ROOT` variable can be set at 19 | the configuration phase. For example: 20 | 21 | ```sh 22 | cmake -S \ 23 | -B \ 24 | -DCMAKE_PREFIX_PATH="/opt/Intl;/opt/some-other-package" 25 | # or 26 | cmake -S \ 27 | -B \ 28 | -DINTL_ROOT=/opt/Intl \ 29 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 30 | ``` 31 | -------------------------------------------------------------------------------- /cmake/ext/zip/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if libzip library has the 2 | 'zip_register_cancel_callback_with_state' function (available since 1.6.0). 3 | */ 4 | #cmakedefine HAVE_CANCEL_CALLBACK 1 5 | 6 | /* Define to 1 if libzip library has encryption support (available since 7 | 1.2.0). */ 8 | #cmakedefine HAVE_ENCRYPTION 1 9 | 10 | /* Define to 1 if libzip library has the 'zip_libzip_version' function 11 | (available since 1.3.1). */ 12 | #cmakedefine HAVE_LIBZIP_VERSION 1 13 | 14 | /* Define to 1 if libzip library has 'zip_*_method_supported' functions 15 | (available since 1.7.0). */ 16 | #cmakedefine HAVE_METHOD_SUPPORTED 1 17 | 18 | /* Define to 1 if libzip library has the 19 | 'zip_register_progress_callback_with_state' function (available since 20 | 1.3.0). */ 21 | #cmakedefine HAVE_PROGRESS_CALLBACK 1 22 | 23 | /* Define to 1 if the PHP extension 'zip' is available. */ 24 | #cmakedefine HAVE_ZIP 1 25 | 26 | /* Define to 1 if libzip is built statically on Windows. Required for static 27 | libzip since version 1.0 to 1.3.2. */ 28 | #cmakedefine ZIP_STATIC 1 29 | -------------------------------------------------------------------------------- /docs/cmake/ext/mysqli.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/mysqli/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/mysqli/CMakeLists.txt) 3 | 4 | # The mysqli extension 5 | 6 | Configure the `mysqli` extension. 7 | 8 | This extension provides MySQL-compatible databases support. 9 | 10 | ## PHP_EXT_MYSQLI 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_MYSQLI_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | 24 | ## PHP_EXT_MYSQL_SOCKET 25 | 26 | * Default: `OFF` 27 | * Values: `ON|OFF` 28 | 29 | mysqli/pdo_mysql: Use MySQL Unix socket pointer from default locations. 30 | 31 | > [!NOTE] 32 | > This option is not available when the target system is Windows. 33 | 34 | ## PHP_EXT_MYSQL_SOCKET_PATH 35 | 36 | * Default: empty 37 | 38 | mysqli/pdo_mysql: Path to the MySQL Unix socket pointer location. If 39 | unspecified, default locations are searched. 40 | 41 | > [!NOTE] 42 | > This option is not available when the target system is Windows. 43 | -------------------------------------------------------------------------------- /docs/cmake/ext/opcache.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/opcache/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/opcache/CMakeLists.txt) 3 | 4 | # The Zend OPcache extension 5 | 6 | This extension enables the PHP OPcode caching engine. 7 | 8 | ## PHP_EXT_OPCACHE 9 | 10 | :red_circle: *Removed as of PHP 8.5.* 11 | 12 | * Default: `ON` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. This extension is always built as shared when enabled. As 16 | of PHP 8.5, this extension is always enabled and cannot be disabled. 17 | 18 | ## PHP_EXT_OPCACHE_HUGE_CODE_PAGES 19 | 20 | * Default: `ON` 21 | * Values: `ON|OFF` 22 | 23 | Enable copying PHP CODE pages into HUGE PAGES. 24 | 25 | > [!NOTE] 26 | > This option is not available when the target system is Windows. 27 | 28 | ## PHP_EXT_OPCACHE_JIT 29 | 30 | * Default: `ON` 31 | * Values: `ON|OFF` 32 | 33 | Enable JIT (just-in-time) compilation. 34 | 35 | ## PHP_EXT_OPCACHE_CAPSTONE 36 | 37 | * Default: `OFF` 38 | * Values: `ON|OFF` 39 | 40 | Enable OPcache JIT disassembly through Capstone engine. 41 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindIconv.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindIconv.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindIconv.cmake) 3 | 4 | # FindIconv 5 | 6 | This module overrides the upstream CMake `FindIconv` module with few 7 | customizations. 8 | 9 | * Added adjustment when the iconv library installation path is manually set, 10 | otherwise Iconv is first searched in the C library. 11 | 12 | See: https://cmake.org/cmake/help/latest/module/FindIconv.html 13 | 14 | ## Customizing search locations 15 | 16 | To customize where to look for the Iconv package base 17 | installation directory, a common `CMAKE_PREFIX_PATH` or 18 | package-specific `ICONV_ROOT` variable can be set at 19 | the configuration phase. For example: 20 | 21 | ```sh 22 | cmake -S \ 23 | -B \ 24 | -DCMAKE_PREFIX_PATH="/opt/Iconv;/opt/some-other-package" 25 | # or 26 | cmake -S \ 27 | -B \ 28 | -DICONV_ROOT=/opt/Iconv \ 29 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 30 | ``` 31 | -------------------------------------------------------------------------------- /cmake/Zend/cmake/Signals.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check whether to enable Zend signals. 3 | #]=============================================================================] 4 | 5 | include(CheckSymbolExists) 6 | include(FeatureSummary) 7 | 8 | set(ZEND_SIGNALS FALSE) 9 | 10 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 11 | return() 12 | endif() 13 | 14 | message(CHECK_START "Checking whether to enable Zend signal handling") 15 | 16 | check_symbol_exists(sigaction signal.h PHP_HAVE_SIGACTION) 17 | set(HAVE_SIGACTION ${PHP_HAVE_SIGACTION}) 18 | 19 | if(PHP_HAVE_SIGACTION AND PHP_ZEND_SIGNALS) 20 | message(CHECK_PASS "yes") 21 | set(ZEND_SIGNALS TRUE) 22 | 23 | # zend_config.h (or its wrapper php_config.h) isn't included in some zend_* 24 | # files, therefore also compilation definition is added. 25 | target_compile_definitions(php_zend PUBLIC ZEND_SIGNALS) 26 | else() 27 | message(CHECK_FAIL "no") 28 | set(ZEND_SIGNALS FALSE) 29 | endif() 30 | 31 | add_feature_info( 32 | "Zend signals" 33 | ZEND_SIGNALS 34 | "signal handling for performance" 35 | ) 36 | -------------------------------------------------------------------------------- /cmake/cmake/checks/CheckAlignof.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | This check determines whether the compiler supports __alignof__. 3 | 4 | Result variables: 5 | 6 | * HAVE_ALIGNOF 7 | #]=============================================================================] 8 | 9 | include(CheckSourceCompiles) 10 | include(CMakePushCheckState) 11 | 12 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 13 | set(HAVE_ALIGNOF FALSE) 14 | return() 15 | endif() 16 | 17 | # Skip in consecutive configuration phases. 18 | if(NOT DEFINED PHP_HAVE_ALIGNOF) 19 | message(CHECK_START "Checking whether the compiler supports __alignof__") 20 | cmake_push_check_state(RESET) 21 | set(CMAKE_REQUIRED_QUIET TRUE) 22 | check_source_compiles(C [[ 23 | int main(void) 24 | { 25 | int align = __alignof__(int); 26 | (void)align; 27 | return 0; 28 | } 29 | ]] PHP_HAVE_ALIGNOF) 30 | cmake_pop_check_state() 31 | if(PHP_HAVE_ALIGNOF) 32 | message(CHECK_PASS "yes") 33 | else() 34 | message(CHECK_FAIL "no") 35 | endif() 36 | endif() 37 | 38 | set(HAVE_ALIGNOF ${PHP_HAVE_ALIGNOF}) 39 | -------------------------------------------------------------------------------- /cmake/ext/ffi/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'ffi' is available. */ 2 | #cmakedefine HAVE_FFI 1 3 | 4 | /* Define to 1 if libffi supports the 'FFI_FASTCALL' calling convention. */ 5 | #cmakedefine HAVE_FFI_FASTCALL 1 6 | 7 | /* Define to 1 if libffi supports the 'FFI_MS_CDECL' calling convention. */ 8 | #cmakedefine HAVE_FFI_MS_CDECL 1 9 | 10 | /* Define to 1 if libffi supports the 'FFI_PASCAL' calling convention. */ 11 | #cmakedefine HAVE_FFI_PASCAL 1 12 | 13 | /* Define to 1 if libffi supports the 'FFI_REGISTER' calling convention. */ 14 | #cmakedefine HAVE_FFI_REGISTER 1 15 | 16 | /* Define to 1 if libffi supports the 'FFI_STDCALL' calling convention. */ 17 | #cmakedefine HAVE_FFI_STDCALL 1 18 | 19 | /* Define to 1 if libffi supports the 'FFI_SYSV' calling convention. */ 20 | #cmakedefine HAVE_FFI_SYSV 1 21 | 22 | /* Define to 1 if libffi supports the 'FFI_THISCALL' calling convention. */ 23 | #cmakedefine HAVE_FFI_THISCALL 1 24 | 25 | /* Define to 1 if libffi supports the 'FFI_VECTORCALL' calling convention. */ 26 | #cmakedefine HAVE_FFI_VECTORCALL_PARTIAL 1 27 | 28 | /* Define to 1 if the system has the type 'long double'. */ 29 | #cmakedefine HAVE_LONG_DOUBLE 1 30 | -------------------------------------------------------------------------------- /cmake/ext/pgsql/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if the PHP extension 'pgsql' is available. */ 2 | #cmakedefine HAVE_PGSQL 1 3 | 4 | /* Define to 1 if libpq has the 'PQchangePassword' function (PostgreSQL 17 or 5 | later). */ 6 | #cmakedefine HAVE_PG_CHANGE_PASSWORD 1 7 | 8 | /* Define to 1 if libpq has the 'PQclosePrepared', 'PQclosePortal', and other 9 | functions (PostgreSQL 17 or later). */ 10 | #cmakedefine HAVE_PG_CLOSE_STMT 1 11 | 12 | /* Define to 1 if libpq has the 'PQresultMemorySize' function (PostgreSQL 12 13 | or later). */ 14 | #cmakedefine HAVE_PG_RESULT_MEMORY_SIZE 1 15 | 16 | /* Define to 1 if libpq has the 'PQservice' function (PostgreSQL 18 or 17 | later). */ 18 | #cmakedefine HAVE_PG_SERVICE 1 19 | 20 | /* Define to 1 if libpq has the 'PQsetChunkedRowsMode' function and 21 | PGRES_TUPLES_CHUNK struct member (PostgreSQL 17 or later). */ 22 | #cmakedefine HAVE_PG_SET_CHUNKED_ROWS_SIZE 1 23 | 24 | /* Define to 1 if libpq has the 'PQsocketPoll' and 'PQgetCurrentTimeUSec' 25 | functions (PostgreSQL 17 or later). */ 26 | #cmakedefine HAVE_PG_SOCKET_POLL 1 27 | 28 | /* Define to 1 if PGVerbosity enum has PQERRORS_SQLSTATE. */ 29 | #cmakedefine HAVE_PQERRORS_SQLSTATE 1 30 | -------------------------------------------------------------------------------- /cmake/sapi/fpm/cmake/CheckCompilerAtomicBuiltins.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check for compiler atomic builtins. 3 | 4 | Result variables: 5 | 6 | * HAVE_BUILTIN_ATOMIC 7 | #]=============================================================================] 8 | 9 | include(CheckSourceCompiles) 10 | include(CMakePushCheckState) 11 | 12 | # Skip in consecutive configuration phases. 13 | if(NOT DEFINED PHP_SAPI_FPM_HAVE_BUILTIN_ATOMIC) 14 | message(CHECK_START "Checking if compiler has __sync_bool_compare_and_swap") 15 | 16 | cmake_push_check_state(RESET) 17 | set(CMAKE_REQUIRED_QUIET TRUE) 18 | check_source_compiles(C [[ 19 | int main(void) 20 | { 21 | int variable = 1; 22 | return (__sync_bool_compare_and_swap(&variable, 1, 2) 23 | && __sync_add_and_fetch(&variable, 1)) ? 1 : 0; 24 | } 25 | ]] PHP_SAPI_FPM_HAVE_BUILTIN_ATOMIC) 26 | cmake_pop_check_state() 27 | 28 | if(PHP_SAPI_FPM_HAVE_BUILTIN_ATOMIC) 29 | message(CHECK_PASS "yes") 30 | else() 31 | message(CHECK_FAIL "no") 32 | endif() 33 | endif() 34 | 35 | set(HAVE_BUILTIN_ATOMIC ${PHP_SAPI_FPM_HAVE_BUILTIN_ATOMIC}) 36 | -------------------------------------------------------------------------------- /docs/cmake/modules/Packages/LibXml2.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/Packages/LibXml2.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/Packages/LibXml2.cmake) 3 | 4 | # Packages/LibXml2 5 | 6 | Wrapper for finding the `libxml2` library. 7 | 8 | Module first tries to find the `libxml2` library on the system. If not 9 | successful it tries to download it from the upstream source with `FetchContent` 10 | module and build it together with the PHP build. 11 | 12 | See: https://cmake.org/cmake/help/latest/module/FindLibXml2.html 13 | 14 | The `FetchContent` CMake module does things differently compared to the 15 | `find_package()` flow: 16 | * By default, it uses `QUIET` in its `find_package()` call when calling the 17 | `FetchContent_MakeAvailable()`; 18 | * When using `FeatureSummary`, dependencies must be moved manually to 19 | `PACKAGES_FOUND` from the `PACKAGES_NOT_FOUND` global property; 20 | 21 | TODO: Improve this. This is for now only initial `FetchContent` integration for 22 | testing purposes and will be changed in the future. 23 | 24 | ## Usage 25 | 26 | ```cmake 27 | # CMakeLists.txt 28 | include(Packages/LibXml2) 29 | ``` 30 | -------------------------------------------------------------------------------- /cmake/cmake/platforms/Haiku.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Configuration specific to Haiku operating system. 3 | #]=============================================================================] 4 | 5 | include_guard(GLOBAL) 6 | 7 | include(CheckLinkerFlag) 8 | 9 | if(CMAKE_SYSTEM_NAME STREQUAL "Haiku") 10 | # Explicitly add linker flag to disable executable stack. Zend/asm files 11 | # already contain the '.note.GNU-stack' directives where needed, but linker on 12 | # Haiku at time of this writing emits warnings without this flag as it seems 13 | # to handle PT_GNU_STACK differently to other Unix-like platforms. 14 | check_linker_flag(C "LINKER:-z,noexecstack" PHP_HAS_NOEXECSTACK_FLAG_C) 15 | if(PHP_HAS_NOEXECSTACK_FLAG_C) 16 | target_link_options( 17 | php_config 18 | INTERFACE $<$:LINKER:-z,noexecstack> 19 | ) 20 | endif() 21 | 22 | check_linker_flag(CXX "LINKER:-z,noexecstack" PHP_HAS_NOEXECSTACK_FLAG_CXX) 23 | if(PHP_HAS_NOEXECSTACK_FLAG_CXX) 24 | target_link_options( 25 | php_config 26 | INTERFACE $<$:LINKER:-z,noexecstack> 27 | ) 28 | endif() 29 | endif() 30 | -------------------------------------------------------------------------------- /cmake/Zend/cmake/CheckCpuidCount.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check for the __cpuid_count support. 3 | 4 | Result variables: 5 | 6 | * HAVE_CPUID_COUNT 7 | #]=============================================================================] 8 | 9 | include(CheckSourceCompiles) 10 | include(CMakePushCheckState) 11 | 12 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 13 | set(HAVE_CPUID_COUNT FALSE) 14 | return() 15 | endif() 16 | 17 | # Skip in consecutive configuration phases. 18 | if(NOT DEFINED PHP_ZEND_HAVE_CPUID_COUNT) 19 | message(CHECK_START "Checking whether __cpuid_count is available") 20 | 21 | cmake_push_check_state(RESET) 22 | set(CMAKE_REQUIRED_QUIET TRUE) 23 | check_source_compiles(C [[ 24 | #include 25 | int main(void) 26 | { 27 | unsigned eax, ebx, ecx, edx; 28 | __cpuid_count(0, 0, eax, ebx, ecx, edx); 29 | return 0; 30 | } 31 | ]] PHP_ZEND_HAVE_CPUID_COUNT) 32 | cmake_pop_check_state() 33 | 34 | if(PHP_ZEND_HAVE_CPUID_COUNT) 35 | message(CHECK_PASS "yes") 36 | else() 37 | message(CHECK_FAIL "no") 38 | endif() 39 | endif() 40 | 41 | set(HAVE_CPUID_COUNT ${PHP_ZEND_HAVE_CPUID_COUNT}) 42 | -------------------------------------------------------------------------------- /docs/cmake/modules/PHP/CheckBuiltin.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/PHP/CheckBuiltin.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/PHP/CheckBuiltin.cmake) 3 | 4 | # PHP/CheckBuiltin 5 | 6 | This module provides a command to check whether the C compiler supports the 7 | given built-in function `__builtin_*()`. 8 | 9 | Load this module in a CMake project with: 10 | 11 | ```cmake 12 | include(PHP/CheckBuiltin) 13 | ``` 14 | 15 | ## Commands 16 | 17 | This module provides the following command: 18 | 19 | ### `php_check_builtin()` 20 | 21 | Checks whether the C compiler supports the given built-in function: 22 | 23 | ```cmake 24 | php_check_builtin( ) 25 | ``` 26 | 27 | #### The arguments are: 28 | 29 | * `` 30 | 31 | Name of the builtin to be checked. 32 | 33 | * `` 34 | 35 | Name of an internal cache variable to store the boolean result of the check. 36 | 37 | When C compiler is `MSVC`, all builtins are reported as not supported. 38 | 39 | ## Examples 40 | 41 | Basic usage: 42 | 43 | ```cmake 44 | # CMakeLists.txt 45 | 46 | include(PHP/CheckBuiltin) 47 | 48 | php_check_builtin(__builtin_clz PHP_HAVE_BUILTIN_CLZ) 49 | ``` 50 | -------------------------------------------------------------------------------- /cmake/sapi/fpm/cmake/CheckKqueue.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check for kqueue. 3 | 4 | Result variables: 5 | 6 | * HAVE_KQUEUE 7 | #]=============================================================================] 8 | 9 | include(CheckSourceCompiles) 10 | include(CMakePushCheckState) 11 | 12 | # Skip in consecutive configuration phases. 13 | if(NOT DEFINED PHP_SAPI_FPM_HAVE_KQUEUE) 14 | message(CHECK_START "Checking for kqueue") 15 | 16 | cmake_push_check_state(RESET) 17 | set(CMAKE_REQUIRED_QUIET TRUE) 18 | check_source_compiles(C [[ 19 | #include 20 | #include 21 | #include 22 | 23 | int main(void) 24 | { 25 | int kfd; 26 | struct kevent k; 27 | kfd = kqueue(); 28 | /* 0 -> STDIN_FILENO */ 29 | EV_SET(&k, 0, EVFILT_READ , EV_ADD | EV_CLEAR, 0, 0, NULL); 30 | (void)kfd; 31 | 32 | return 0; 33 | } 34 | ]] PHP_SAPI_FPM_HAVE_KQUEUE) 35 | cmake_pop_check_state() 36 | 37 | if(PHP_SAPI_FPM_HAVE_KQUEUE) 38 | message(CHECK_PASS "yes") 39 | else() 40 | message(CHECK_FAIL "no") 41 | endif() 42 | endif() 43 | 44 | set(HAVE_KQUEUE ${PHP_SAPI_FPM_HAVE_KQUEUE}) 45 | -------------------------------------------------------------------------------- /patches/8.4/timelib.patch: -------------------------------------------------------------------------------- 1 | From: Peter Kokot 2 | Subject: Fix -Wundef/C4668 warnings in ext/date 3 | 4 | --- 5 | ext/date/lib/timelib.h | 2 ++ 6 | ext/date/lib/timelib_private.h | 6 +++--- 7 | 2 files changed, 5 insertions(+), 3 deletions(-) 8 | 9 | diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h 10 | index ef57a7ee783..fbb9efd58a7 100644 11 | --- a/ext/date/lib/timelib.h 12 | +++ b/ext/date/lib/timelib.h 13 | @@ -373,6 +373,8 @@ typedef struct _timelib_tzdb { 14 | # define TIMELIB_USE_BUILTIN_STRNDUP 0 15 | # define timelib_strndup strndup 16 | # endif 17 | +#else 18 | +# define TIMELIB_USE_BUILTIN_STRNDUP 0 19 | #endif 20 | 21 | #define TIMELIB_NONE 0x00 22 | diff --git a/ext/date/lib/timelib_private.h b/ext/date/lib/timelib_private.h 23 | index 3c5f9b22147..7e7fcc84401 100644 24 | --- a/ext/date/lib/timelib_private.h 25 | +++ b/ext/date/lib/timelib_private.h 26 | @@ -49,15 +49,15 @@ 27 | # include 28 | #endif 29 | 30 | -#if HAVE_UNISTD_H 31 | +#ifdef HAVE_UNISTD_H 32 | # include 33 | #endif 34 | 35 | -#if HAVE_IO_H 36 | +#ifdef HAVE_IO_H 37 | # include 38 | #endif 39 | 40 | -#if HAVE_DIRENT_H 41 | +#ifdef HAVE_DIRENT_H 42 | # include 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /patches/8.5/timelib.patch: -------------------------------------------------------------------------------- 1 | From: Peter Kokot 2 | Subject: Fix -Wundef/C4668 warnings in ext/date 3 | 4 | --- 5 | ext/date/lib/timelib.h | 2 ++ 6 | ext/date/lib/timelib_private.h | 6 +++--- 7 | 2 files changed, 5 insertions(+), 3 deletions(-) 8 | 9 | diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h 10 | index ef57a7ee783..fbb9efd58a7 100644 11 | --- a/ext/date/lib/timelib.h 12 | +++ b/ext/date/lib/timelib.h 13 | @@ -373,6 +373,8 @@ typedef struct _timelib_tzdb { 14 | # define TIMELIB_USE_BUILTIN_STRNDUP 0 15 | # define timelib_strndup strndup 16 | # endif 17 | +#else 18 | +# define TIMELIB_USE_BUILTIN_STRNDUP 0 19 | #endif 20 | 21 | #define TIMELIB_NONE 0x00 22 | diff --git a/ext/date/lib/timelib_private.h b/ext/date/lib/timelib_private.h 23 | index 3c5f9b22147..7e7fcc84401 100644 24 | --- a/ext/date/lib/timelib_private.h 25 | +++ b/ext/date/lib/timelib_private.h 26 | @@ -49,15 +49,15 @@ 27 | # include 28 | #endif 29 | 30 | -#if HAVE_UNISTD_H 31 | +#ifdef HAVE_UNISTD_H 32 | # include 33 | #endif 34 | 35 | -#if HAVE_IO_H 36 | +#ifdef HAVE_IO_H 37 | # include 38 | #endif 39 | 40 | -#if HAVE_DIRENT_H 41 | +#ifdef HAVE_DIRENT_H 42 | # include 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /patches/8.6/timelib.patch: -------------------------------------------------------------------------------- 1 | From: Peter Kokot 2 | Subject: Fix -Wundef/C4668 warnings in ext/date 3 | 4 | --- 5 | ext/date/lib/timelib.h | 2 ++ 6 | ext/date/lib/timelib_private.h | 6 +++--- 7 | 2 files changed, 5 insertions(+), 3 deletions(-) 8 | 9 | diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h 10 | index ef57a7ee783..fbb9efd58a7 100644 11 | --- a/ext/date/lib/timelib.h 12 | +++ b/ext/date/lib/timelib.h 13 | @@ -373,6 +373,8 @@ typedef struct _timelib_tzdb { 14 | # define TIMELIB_USE_BUILTIN_STRNDUP 0 15 | # define timelib_strndup strndup 16 | # endif 17 | +#else 18 | +# define TIMELIB_USE_BUILTIN_STRNDUP 0 19 | #endif 20 | 21 | #define TIMELIB_NONE 0x00 22 | diff --git a/ext/date/lib/timelib_private.h b/ext/date/lib/timelib_private.h 23 | index 3c5f9b22147..7e7fcc84401 100644 24 | --- a/ext/date/lib/timelib_private.h 25 | +++ b/ext/date/lib/timelib_private.h 26 | @@ -49,15 +49,15 @@ 27 | # include 28 | #endif 29 | 30 | -#if HAVE_UNISTD_H 31 | +#ifdef HAVE_UNISTD_H 32 | # include 33 | #endif 34 | 35 | -#if HAVE_IO_H 36 | +#ifdef HAVE_IO_H 37 | # include 38 | #endif 39 | 40 | -#if HAVE_DIRENT_H 41 | +#ifdef HAVE_DIRENT_H 42 | # include 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /cmake/cmake/checks/CheckGetifaddrs.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check for usable getifaddrs(). Instead of only checking for symbol, this check 3 | also ensures that struct ifaddrs is available and the entire usage is declared 4 | in belonging headers. On modern systems, only checking for getifaddrs symbol and 5 | library should be sufficient. 6 | 7 | The getifaddrs() is mostly available in C library (Linux, Solaris 11.4...) with 8 | few noted exceptions below. Some systems also need header 9 | (NetBSD, OpenBSD, and older FreeBSD). 10 | #]=============================================================================] 11 | 12 | include(PHP/SearchLibraries) 13 | 14 | php_search_libraries( 15 | SOURCE_COMPILES [[ 16 | #include 17 | #include 18 | 19 | int main(void) 20 | { 21 | struct ifaddrs *interfaces; 22 | if (!getifaddrs(&interfaces)) { 23 | freeifaddrs(interfaces); 24 | } 25 | 26 | return 0; 27 | } 28 | ]] 29 | LIBRARIES 30 | socket # Solaris 11..11.3, illumos 31 | network # Haiku 32 | RESULT_VARIABLE PHP_HAVE_GETIFADDRS 33 | TARGET php_config INTERFACE 34 | ) 35 | set(HAVE_GETIFADDRS "${PHP_HAVE_GETIFADDRS}") 36 | -------------------------------------------------------------------------------- /cmake/ext/reflection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # The reflection extension 3 | 4 | Configure the `reflection` extension. 5 | 6 | This extension provides support for Reflection API to introspect PHP code and is 7 | always enabled. 8 | #]=============================================================================] 9 | 10 | cmake_minimum_required(VERSION 4.2...4.3) 11 | 12 | project( 13 | PHP_EXT_REFLECTION 14 | LANGUAGES C 15 | ) 16 | 17 | if(PROJECT_IS_TOP_LEVEL) 18 | message( 19 | FATAL_ERROR 20 | "The PHP reflection extension is intended to be built only within the " 21 | "top-level PHP source tree (php-src)." 22 | ) 23 | endif() 24 | 25 | include(FeatureSummary) 26 | 27 | add_feature_info( 28 | "ext/reflection" 29 | TRUE 30 | "PHP code introspection API" 31 | ) 32 | 33 | include(PHP/Extension) 34 | php_extension(reflection) 35 | 36 | add_library(php_ext_reflection OBJECT) 37 | target_sources( 38 | php_ext_reflection 39 | PRIVATE 40 | php_reflection.c 41 | php_reflection.stub.php 42 | ) 43 | 44 | target_compile_definitions( 45 | php_ext_reflection 46 | PRIVATE 47 | ZEND_ENABLE_STATIC_TSRMLS_CACHE 48 | ) 49 | 50 | add_dependencies(php_ext_reflection php_ext_random) 51 | -------------------------------------------------------------------------------- /patches/8.6/docs.patch: -------------------------------------------------------------------------------- 1 | From: Peter Kokot 2 | Subject: Add docs related to CMake 3 | 4 | These are only quick README adjustments and fixes on how to use CMake 5 | with PHP. 6 | --- 7 | README.md | 22 ++++++++++++++++++++++ 8 | 1 file changed, 22 insertions(+) 9 | 10 | diff --git a/README.md b/README.md 11 | index 5b8ec6f0d7d..cb4955e2cf3 100644 12 | --- a/README.md 13 | +++ b/README.md 14 | @@ -35,8 +35,30 @@ For other systems, see the [installation chapter](https://www.php.net/install). 15 | 16 | ### Building PHP source code 17 | 18 | +#### CMake 19 | + 20 | +On Debian-based systems: 21 | + 22 | + sudo apt install -y cmake gcc g++ bison libsqlite3-dev 23 | + 24 | +On Fedora-based systems: 25 | + 26 | + sudo dnf install cmake gcc gcc-c++ bison sqlite-devel 27 | + 28 | +Generate build system: 29 | + 30 | + cmake -S . -B php-build 31 | + 32 | +Build PHP: 33 | + 34 | + cmake --build php-build -j 35 | + 36 | +#### Windows using JScript 37 | + 38 | *For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).* 39 | 40 | +#### Autotools 41 | + 42 | For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For 43 | a default build, you will additionally need libxml2 and libsqlite3. 44 | 45 | -------------------------------------------------------------------------------- /docs/cmake/variables/PHP_PEAR.md: -------------------------------------------------------------------------------- 1 | # `PHP_PEAR` 2 | 3 | :orange_circle: *Deprecated as of PHP 7.4.* 4 | 5 | * Default: `OFF` 6 | * Values: `ON|OFF` 7 | 8 | > [!WARNING] 9 | > PEAR installation as part of the PHP installation is deprecated as of PHP 7.4 10 | > and will be removed in future PHP versions. PEAR can also be installed 11 | > manually from the pear.php.net website. 12 | 13 | Install PEAR, PHP Extension and Application Repository package manager. 14 | 15 | ## `PHP_PEAR_DIR` 16 | 17 | * Default: `DATADIR/pear` 18 | 19 | The path where PEAR will be installed to. CMAKE_INSTALL_PREFIX is automatically 20 | prepended when given as a relative path. 21 | 22 | ## `PHP_PEAR_TEMP_DIR` 23 | 24 | * Default: `tmp/pear` on \*nix and `temp/pear` on Windows 25 | 26 | The PEAR temporary directory where PEAR writes temporary files, such as cache, 27 | downloaded packages artifacts and similar. Pass it as a relative path inside the 28 | top level system directory, which will be automatically prepended. If given as 29 | an absolute path, top level directory is not prepended. Relative path is added 30 | to the top root system directory (`/` on \*nix, or `C:/` on Windows). 31 | 32 | For example, default PEAR temporary directory after the top level system 33 | directory is prepended becomes `/tmp/pear` on \*nix and `C:/temp/pear` on 34 | Windows. 35 | -------------------------------------------------------------------------------- /cmake/cmake/modules/FindICU.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # FindICU 3 | 4 | This module overrides the upstream CMake `FindICU` module with few 5 | customizations: 6 | 7 | * Added pkg-config. 8 | 9 | See: https://cmake.org/cmake/help/latest/module/FindICU.html 10 | #]=============================================================================] 11 | 12 | include(FeatureSummary) 13 | 14 | set_package_properties( 15 | ICU 16 | PROPERTIES 17 | URL "https://icu.unicode.org/" 18 | DESCRIPTION "International Components for Unicode" 19 | ) 20 | 21 | # Try pkg-config and append paths to the internal icu_roots variable. 22 | find_package(PkgConfig QUIET) 23 | if(PkgConfig_FOUND) 24 | foreach(component ${ICU_FIND_COMPONENTS}) 25 | string(TOUPPER ${component} component_upper) 26 | pkg_check_modules(PC_ICU_${component_upper} QUIET icu-${component}) 27 | 28 | list(APPEND icu_roots ${PC_ICU_${component_upper}_INCLUDE_DIRS}) 29 | list(APPEND icu_roots ${PC_ICU_${component_upper}_LIBRARY_DIRS}) 30 | endforeach() 31 | 32 | if(icu_roots) 33 | list(REMOVE_DUPLICATES icu_roots) 34 | endif() 35 | endif() 36 | 37 | # Find package with upstream CMake find module. Absolute path prevents the 38 | # maximum nesting/recursion depth error on some systems, like macOS. 39 | include(${CMAKE_ROOT}/Modules/FindICU.cmake) 40 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindAtomic.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindAtomic.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindAtomic.cmake) 3 | 4 | # FindAtomic 5 | 6 | Finds the atomic instructions: 7 | 8 | ```cmake 9 | find_package(Atomic) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `Atomic::Atomic` - The Atomic library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `Atomic_FOUND` - Whether atomic instructions are available. 23 | 24 | ## Examples 25 | 26 | Basic usage: 27 | 28 | ```cmake 29 | # CMakeLists.txt 30 | find_package(Atomic) 31 | target_link_libraries(example PRIVATE Atomic::Atomic) 32 | ``` 33 | 34 | ## Customizing search locations 35 | 36 | To customize where to look for the Atomic package base 37 | installation directory, a common `CMAKE_PREFIX_PATH` or 38 | package-specific `ATOMIC_ROOT` variable can be set at 39 | the configuration phase. For example: 40 | 41 | ```sh 42 | cmake -S \ 43 | -B \ 44 | -DCMAKE_PREFIX_PATH="/opt/Atomic;/opt/some-other-package" 45 | # or 46 | cmake -S \ 47 | -B \ 48 | -DATOMIC_ROOT=/opt/Atomic \ 49 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 50 | ``` 51 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindRE2C.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindRE2C.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindRE2C.cmake) 3 | 4 | # FindRE2C 5 | 6 | Finds the `re2c` command-line lexer generator: 7 | 8 | ```cmake 9 | find_package(RE2C [] [...]) 10 | ``` 11 | 12 | ## Result variables 13 | 14 | This module defines the following variables: 15 | 16 | * `RE2C_FOUND` - Boolean indicating whether (the requested version of) `re2c` 17 | was found. 18 | * `RE2C_VERSION` - The version of `re2c` found. 19 | 20 | ## Cache variables 21 | 22 | The following cache variables may also be set: 23 | 24 | * `RE2C_EXECUTABLE` - Path to the `re2c` executable. 25 | 26 | ## Examples 27 | 28 | Basic usage: 29 | 30 | ```cmake 31 | # CMakeLists.txt 32 | find_package(RE2C) 33 | ``` 34 | 35 | ## Customizing search locations 36 | 37 | To customize where to look for the RE2C package base 38 | installation directory, a common `CMAKE_PREFIX_PATH` or 39 | package-specific `RE2C_ROOT` variable can be set at 40 | the configuration phase. For example: 41 | 42 | ```sh 43 | cmake -S \ 44 | -B \ 45 | -DCMAKE_PREFIX_PATH="/opt/RE2C;/opt/some-other-package" 46 | # or 47 | cmake -S \ 48 | -B \ 49 | -DRE2C_ROOT=/opt/RE2C \ 50 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 51 | ``` 52 | -------------------------------------------------------------------------------- /cmake/sapi/fpm/cmake/CheckSelect.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check select. 3 | 4 | Result variables: 5 | 6 | * HAVE_SELECT 7 | #]=============================================================================] 8 | 9 | include(CheckSourceCompiles) 10 | include(CMakePushCheckState) 11 | 12 | # Skip in consecutive configuration phases. 13 | if(NOT DEFINED PHP_SAPI_FPM_HAVE_SELECT) 14 | message(CHECK_START "Checking for select") 15 | 16 | cmake_push_check_state(RESET) 17 | set(CMAKE_REQUIRED_QUIET TRUE) 18 | 19 | check_source_compiles(C [[ 20 | /* According to POSIX.1-2001 */ 21 | #include 22 | 23 | /* According to earlier standards */ 24 | #include 25 | #include 26 | #include 27 | 28 | int main(void) 29 | { 30 | fd_set fds; 31 | struct timeval t; 32 | t.tv_sec = 0; 33 | t.tv_usec = 42; 34 | FD_ZERO(&fds); 35 | /* 0 -> STDIN_FILENO */ 36 | FD_SET(0, &fds); 37 | select(FD_SETSIZE, &fds, NULL, NULL, &t); 38 | 39 | return 0; 40 | } 41 | ]] PHP_SAPI_FPM_HAVE_SELECT) 42 | cmake_pop_check_state() 43 | 44 | if(PHP_SAPI_FPM_HAVE_SELECT) 45 | message(CHECK_PASS "yes") 46 | else() 47 | message(CHECK_FAIL "no") 48 | endif() 49 | endif() 50 | 51 | set(HAVE_SELECT ${PHP_SAPI_FPM_HAVE_SELECT}) 52 | -------------------------------------------------------------------------------- /cmake/Zend/cmake/CheckAsmGoto.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check whether the C compiler supports the inline assembly __asm__ goto. 3 | 4 | Result variables: 5 | 6 | * HAVE_ASM_GOTO 7 | #]=============================================================================] 8 | 9 | include(CheckSourceCompiles) 10 | include(CMakePushCheckState) 11 | 12 | # The check below otherwise passes on Windows but it is disabled in PHP. 13 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 14 | set(HAVE_ASM_GOTO FALSE) 15 | return() 16 | endif() 17 | 18 | # Skip in consecutive configuration phases. 19 | if(NOT DEFINED PHP_ZEND_HAVE_ASM_GOTO) 20 | message(CHECK_START "Checking for the inline assembly __asm__ goto support") 21 | 22 | cmake_push_check_state(RESET) 23 | set(CMAKE_REQUIRED_QUIET TRUE) 24 | check_source_compiles(C [[ 25 | int main(void) 26 | { 27 | #if defined(__x86_64__) || defined(__i386__) 28 | __asm__ goto("jmp %l0\n" :::: end); 29 | #elif defined(__aarch64__) 30 | __asm__ goto("b %l0\n" :::: end); 31 | #endif 32 | end: 33 | return 0; 34 | } 35 | ]] PHP_ZEND_HAVE_ASM_GOTO) 36 | cmake_pop_check_state() 37 | 38 | if(PHP_ZEND_HAVE_ASM_GOTO) 39 | message(CHECK_PASS "yes") 40 | else() 41 | message(CHECK_FAIL "no") 42 | endif() 43 | endif() 44 | 45 | set(HAVE_ASM_GOTO ${PHP_ZEND_HAVE_ASM_GOTO}) 46 | -------------------------------------------------------------------------------- /cmake/sapi/fpm/cmake/CheckEpoll.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check epoll. 3 | 4 | Result variables: 5 | 6 | * HAVE_EPOLL 7 | #]=============================================================================] 8 | 9 | include(CheckSourceCompiles) 10 | include(CMakePushCheckState) 11 | 12 | # Skip in consecutive configuration phases. 13 | if(NOT DEFINED PHP_SAPI_FPM_HAVE_EPOLL) 14 | message(CHECK_START "Checking for epoll") 15 | cmake_push_check_state(RESET) 16 | set(CMAKE_REQUIRED_QUIET TRUE) 17 | check_source_compiles(C [[ 18 | #include 19 | 20 | int main(void) 21 | { 22 | int epollfd; 23 | struct epoll_event e; 24 | 25 | epollfd = epoll_create(1); 26 | if (epollfd < 0) { 27 | return 1; 28 | } 29 | 30 | e.events = EPOLLIN | EPOLLET; 31 | e.data.fd = 0; 32 | 33 | if (epoll_ctl(epollfd, EPOLL_CTL_ADD, 0, &e) == -1) { 34 | return 1; 35 | } 36 | 37 | e.events = 0; 38 | if (epoll_wait(epollfd, &e, 1, 1) < 0) { 39 | return 1; 40 | } 41 | 42 | return 0; 43 | } 44 | ]] PHP_SAPI_FPM_HAVE_EPOLL) 45 | cmake_pop_check_state() 46 | 47 | if(PHP_SAPI_FPM_HAVE_EPOLL) 48 | message(CHECK_PASS "yes") 49 | else() 50 | message(CHECK_FAIL "no") 51 | endif() 52 | endif() 53 | 54 | set(HAVE_EPOLL ${PHP_SAPI_FPM_HAVE_EPOLL}) 55 | -------------------------------------------------------------------------------- /cmake/cmake/modules/PHP/AddCustomCommand/RunCommand.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Script for PHP/AddCustomCommand module that loops over output files and their 3 | dependent input source files and runs the command inside the execute_process(). 4 | 5 | Expected variables: 6 | 7 | * PHP_EXECUTABLE 8 | * PHP_COMMAND 9 | * DEPENDS 10 | * OUTPUT 11 | * COMMENT 12 | #]=============================================================================] 13 | 14 | cmake_minimum_required(VERSION 4.2...4.3) 15 | 16 | if(NOT CMAKE_SCRIPT_MODE_FILE OR NOT PHP_EXECUTABLE OR NOT PHP_COMMAND) 17 | return() 18 | endif() 19 | 20 | set(needs_update FALSE) 21 | 22 | foreach(input ${DEPENDS}) 23 | if(NOT EXISTS ${input}) 24 | continue() 25 | endif() 26 | 27 | foreach(output ${OUTPUT}) 28 | if("${input}" IS_NEWER_THAN "${output}") 29 | set(needs_update TRUE) 30 | break() 31 | endif() 32 | endforeach() 33 | 34 | if(needs_update) 35 | break() 36 | endif() 37 | endforeach() 38 | 39 | if(NOT needs_update) 40 | return() 41 | endif() 42 | 43 | if(COMMENT) 44 | execute_process( 45 | COMMAND 46 | ${CMAKE_COMMAND} -E cmake_echo_color --blue --bold " ${COMMENT}" 47 | ) 48 | endif() 49 | 50 | execute_process(COMMAND ${PHP_EXECUTABLE} ${PHP_COMMAND}) 51 | 52 | # Update modification times of output files to not re-run the command on the 53 | # consecutive build runs. 54 | file(TOUCH_NOCREATE ${OUTPUT}) 55 | -------------------------------------------------------------------------------- /cmake/ext/ldap/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if 'ldap_set_rebind_proc' has 3 arguments. */ 2 | #cmakedefine HAVE_3ARG_SETREBINDPROC 1 3 | 4 | /* Define to 1 if the PHP extension 'ldap' is available. */ 5 | #cmakedefine HAVE_LDAP 1 6 | 7 | /* Define to 1 if you have the 'ldap_control_find' function. */ 8 | #cmakedefine HAVE_LDAP_CONTROL_FIND 1 9 | 10 | /* Define to 1 if you have the 'ldap_extended_operation' function. */ 11 | #cmakedefine HAVE_LDAP_EXTENDED_OPERATION 1 12 | 13 | /* Define to 1 if you have the 'ldap_extended_operation_s' function. */ 14 | #cmakedefine HAVE_LDAP_EXTENDED_OPERATION_S 1 15 | 16 | /* Define to 1 if you have the 'ldap_parse_extended_result' function. */ 17 | #cmakedefine HAVE_LDAP_PARSE_EXTENDED_RESULT 1 18 | 19 | /* Define to 1 if you have the 'ldap_parse_reference' function. */ 20 | #cmakedefine HAVE_LDAP_PARSE_REFERENCE 1 21 | 22 | /* Define to 1 if you have the 'ldap_parse_result' function. */ 23 | #cmakedefine HAVE_LDAP_PARSE_RESULT 1 24 | 25 | /* Define to 1 if you have the 'ldap_passwd' function. */ 26 | #cmakedefine HAVE_LDAP_PASSWD 1 27 | 28 | /* Define to 1 if you have the 'ldap_refresh_s' function. */ 29 | #cmakedefine HAVE_LDAP_REFRESH_S 1 30 | 31 | /* Define to 1 if the ldap extension has SASL support enabled. */ 32 | #cmakedefine HAVE_LDAP_SASL 1 33 | 34 | /* Define to 1 if you have the 'ldap_start_tls_s' function. */ 35 | #cmakedefine HAVE_LDAP_START_TLS_S 1 36 | 37 | /* Define to 1 if you have the 'ldap_whoami_s' function. */ 38 | #cmakedefine HAVE_LDAP_WHOAMI_S 1 39 | -------------------------------------------------------------------------------- /docs/cmake/pear.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [pear/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/pear/CMakeLists.txt) 3 | 4 | # PEAR 5 | 6 | Configure PEAR as part of the PHP installation. 7 | 8 | > [!WARNING] 9 | > PEAR installation as part of PHP is deprecated as of PHP 7.4 and will be 10 | > removed in future PHP versions. PEAR can also be installed manually from the 11 | > pear.php.net website. 12 | 13 | ## PHP_PEAR 14 | 15 | :orange_circle: *Deprecated as of PHP 7.4.* 16 | 17 | * Default: `OFF` 18 | * Values: `ON|OFF` 19 | 20 | Install PEAR, PHP Extension and Application Repository package manager. 21 | 22 | ## PHP_PEAR_INSTALL_DIR 23 | 24 | :orange_circle: *Deprecated as of PHP 7.4.* 25 | 26 | * Default: `DATADIR/pear` 27 | 28 | The path where PEAR will be installed to. Relative path is interpreted as being 29 | relative to the `CMAKE_INSTALL_PREFIX`. 30 | 31 | ## PHP_PEAR_TEMP_DIR 32 | 33 | :orange_circle: *Deprecated as of PHP 7.4.* 34 | 35 | * Default: `tmp/pear` on \*nix and `temp/pear` on Windows 36 | 37 | The PEAR temporary directory where PEAR writes temporary files, such as cache, 38 | downloaded packages artifacts and similar. Relative path is interpreted as being 39 | relative to the top root system directory (`/` on \*nix, or `C:/` on Windows). 40 | 41 | For example, default PEAR temporary directory after the top level system 42 | directory is prepended becomes `/tmp/pear` on Unix-like systems and 43 | `C:/temp/pear` on Windows. 44 | -------------------------------------------------------------------------------- /docs/cmake/sapi/phpdbg.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [sapi/phpdbg/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/sapi/phpdbg/CMakeLists.txt) 3 | 4 | # The phpdbg SAPI 5 | 6 | Configure the `phpdbg` (interactive PHP debugger) PHP SAPI. 7 | 8 | ## PHP_SAPI_PHPDBG 9 | 10 | * Default: `ON` 11 | * Values: `ON|OFF` 12 | 13 | Enable the phpdbg SAPI module as an executable. 14 | 15 | ## PHP_SAPI_PHPDBG_SHARED 16 | 17 | * Default: `OFF` 18 | * Values: `ON|OFF` 19 | 20 | Build phpdbg SAPI also as a shared module together with an executable. 21 | 22 | The phpdbg shared library is after the build phase located in the `sapi/phpdbg` 23 | directory: 24 | 25 | * `libphpdbg.so` (\*nix), or `libphpdbg.dylib` (macOS), or `libphpdbg.dll` 26 | (Windows) 27 | 28 | ## PHP_SAPI_PHPDBG_DEBUG 29 | 30 | * Default: `OFF` 31 | * Values: `ON|OFF` 32 | 33 | Build phpdbg in debug mode to enable additional diagnostic output for developing 34 | and troubleshooting phpdbg itself. 35 | 36 | ## PHP_SAPI_PHPDBG_READLINE 37 | 38 | * Default: `OFF` 39 | * Values: `ON|OFF` 40 | 41 | Explicitly enable readline support in phpdbg for command history accessible 42 | through arrow keys. Requires the Editline library. If the PHP extension 43 | `readline` is enabled during the build process, the phpdbg readline support is 44 | automatically enabled regardless of this option. 45 | 46 | Where to find the Editline installation on the system, can be customized with 47 | the `EDITLINE_ROOT` variable. 48 | -------------------------------------------------------------------------------- /docs/cmake/ext/mysqlnd.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/mysqlnd/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/mysqlnd/CMakeLists.txt) 3 | 4 | # The mysqlnd extension 5 | 6 | Configure the `mysqlnd` extension. 7 | 8 | This extension contains MySQL Native Driver for using MySQL-compatible databases 9 | in PHP extensions. 10 | 11 | ## PHP_EXT_MYSQLND 12 | 13 | * Default: `OFF` 14 | * Values: `ON|OFF` 15 | 16 | Enable the PHP `mysqlnd` extension. 17 | 18 | ## PHP_EXT_MYSQLND_SHARED 19 | 20 | * Default: `OFF` 21 | * Values: `ON|OFF` 22 | 23 | Build extension as shared library. 24 | 25 | ## PHP_EXT_MYSQLND_COMPRESSION 26 | 27 | * Default: `ON` 28 | * Values: `ON|OFF` 29 | 30 | Enable compressed protocol support in mysqlnd. 31 | 32 | ## PHP_EXT_MYSQLND_SSL 33 | 34 | * Default: `ON` 35 | * Values: `ON|OFF` 36 | 37 | Explicitly enable or disable extended SSL support in the `mysqlnd` extension. On 38 | \*nix systems, the extended SSL works through the OpenSSL library and on Windows 39 | through the Windows Crypt32 library. 40 | 41 | For example, `mysqlnd` extension with disabled extended SSL support, would 42 | require in MySQL Server 8.0 and later versions to have the 43 | `default_authentication_plugin` configuration set to `mysql_native_password` in 44 | `my.cnf` (`caching_sha2_password` therefore wouldn't be supported). 45 | 46 | This option is only provided to explicitly avoid requiring the OpenSSL 47 | dependency, otherwise recommended setting is `ON`. 48 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindMM.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindMM.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindMM.cmake) 3 | 4 | # FindMM 5 | 6 | Finds the mm library: 7 | 8 | ```cmake 9 | find_package(MM) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `MM::MM` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `MM_FOUND` - Boolean indicating whether the package is found. 23 | 24 | ## Cache variables 25 | 26 | The following cache variables may also be set: 27 | 28 | * `MM_INCLUDE_DIR` - Directory containing package library headers. 29 | * `MM_LIBRARY` - The path to the package library. 30 | 31 | ## Examples 32 | 33 | Basic usage: 34 | 35 | ```cmake 36 | # CMakeLists.txt 37 | find_package(MM) 38 | target_link_libraries(example PRIVATE MM::MM) 39 | ``` 40 | 41 | ## Customizing search locations 42 | 43 | To customize where to look for the MM package base 44 | installation directory, a common `CMAKE_PREFIX_PATH` or 45 | package-specific `MM_ROOT` variable can be set at 46 | the configuration phase. For example: 47 | 48 | ```sh 49 | cmake -S \ 50 | -B \ 51 | -DCMAKE_PREFIX_PATH="/opt/MM;/opt/some-other-package" 52 | # or 53 | cmake -S \ 54 | -B \ 55 | -DMM_ROOT=/opt/MM \ 56 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 57 | ``` 58 | -------------------------------------------------------------------------------- /cmake/ext/sockets/cmake/config.h.in: -------------------------------------------------------------------------------- 1 | /* Define to 1 if you have the 'accept4' function. */ 2 | #cmakedefine HAVE_ACCEPT4 1 3 | 4 | /* Define to 1 if you have the 'hstrerror' function. */ 5 | #cmakedefine HAVE_HSTRERROR 1 6 | 7 | /* Define to 1 if you have the 'if_indextoname' function. */ 8 | #cmakedefine HAVE_IF_INDEXTONAME 1 9 | 10 | /* Define to 1 if you have the 'if_nametoindex' function. */ 11 | #cmakedefine HAVE_IF_NAMETOINDEX 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #cmakedefine HAVE_LINUX_FILTER_H 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #cmakedefine HAVE_LINUX_IF_ETHER_H 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #cmakedefine HAVE_LINUX_IF_PACKET_H 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #cmakedefine HAVE_LINUX_UDP_H 1 24 | 25 | /* Define to 1 if you have the 'sockatmark' function. */ 26 | #cmakedefine HAVE_SOCKATMARK 1 27 | 28 | /* Define to 1 if the PHP extension 'sockets' is available. */ 29 | #cmakedefine HAVE_SOCKETS 1 30 | 31 | /* Define to 1 if the system has the type 'struct cmsgcred'. */ 32 | #cmakedefine HAVE_STRUCT_CMSGCRED 1 33 | 34 | /* Define to 1 if 'ss_family' is a member of 'struct sockaddr_storage'. */ 35 | #cmakedefine HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 36 | 37 | /* Define to 1 if the system has the type 'struct ucred'. */ 38 | #cmakedefine HAVE_STRUCT_UCRED 1 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #cmakedefine HAVE_SYS_SOCKIO_H 1 42 | -------------------------------------------------------------------------------- /cmake/ext/standard/cmake/CheckStrptime.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check strptime() and its declaration. 3 | 4 | This check is obsolete. The PHP strptime() function is deprecated as of PHP 5 | 8.1.0 and strptime(), where available, simply needs the _GNU_SOURCE defined or 6 | compiler flag -std=gnuXX appended to be declared in . 7 | 8 | Result variables: 9 | 10 | * HAVE_STRPTIME 11 | * HAVE_DECL_STRPTIME 12 | #]=============================================================================] 13 | 14 | include(CheckFunctionExists) 15 | include(CheckSymbolExists) 16 | include(CMakePushCheckState) 17 | 18 | if(PHP_VERSION VERSION_GREATER_EQUAL 9.0) 19 | message( 20 | DEPRECATION 21 | "${CMAKE_CURRENT_LIST_FILE} is obsolete and should be removed. The PHP " 22 | "strptime() function is deprecated as of PHP 8.1.0." 23 | ) 24 | endif() 25 | 26 | set(HAVE_STRPTIME FALSE) 27 | set(HAVE_DECL_STRPTIME FALSE) 28 | 29 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 30 | return() 31 | endif() 32 | 33 | cmake_push_check_state(RESET) 34 | set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) 35 | check_symbol_exists(strptime time.h PHP_HAVE_STRPTIME) 36 | cmake_pop_check_state() 37 | 38 | if(PHP_HAVE_STRPTIME) 39 | set(HAVE_STRPTIME TRUE) 40 | set(HAVE_DECL_STRPTIME TRUE) 41 | return() 42 | endif() 43 | 44 | # Check if linker sees the function. 45 | check_function_exists(strptime PHP_HAVE_STRPTIME_FUNCTION) 46 | 47 | if(PHP_HAVE_STRPTIME_FUNCTION) 48 | set(HAVE_STRPTIME TRUE) 49 | endif() 50 | -------------------------------------------------------------------------------- /cmake/sapi/litespeed/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # The litespeed SAPI 3 | 4 | Configure the `litespeed` PHP SAPI. 5 | 6 | > [!NOTE] 7 | > The PHP Litespeed SAPI is not available when the target system is Windows. 8 | 9 | ## PHP_SAPI_LITESPEED 10 | 11 | * Default: `OFF` 12 | * Values: `ON|OFF` 13 | 14 | Enable the LiteSpeed SAPI module. 15 | #]=============================================================================] 16 | 17 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 18 | return() 19 | endif() 20 | 21 | include(FeatureSummary) 22 | 23 | option(PHP_SAPI_LITESPEED "Enable the LiteSpeed SAPI module") 24 | 25 | add_feature_info( 26 | "sapi/litespeed" 27 | PHP_SAPI_LITESPEED 28 | "LiteSpeed web server module" 29 | ) 30 | 31 | if(NOT PHP_SAPI_LITESPEED) 32 | return() 33 | endif() 34 | 35 | add_executable(php_sapi_litespeed) 36 | add_executable(PHP::sapi::litespeed ALIAS php_sapi_litespeed) 37 | 38 | target_sources( 39 | php_sapi_litespeed 40 | PRIVATE 41 | lsapi_main.c 42 | lsapi_main.stub.php 43 | lsapilib.c 44 | ) 45 | 46 | target_link_libraries( 47 | php_sapi_litespeed 48 | PRIVATE 49 | $ 50 | ) 51 | 52 | set_target_properties( 53 | php_sapi_litespeed 54 | PROPERTIES 55 | EXPORT_NAME Sapi::Litespeed 56 | OUTPUT_NAME ${PHP_PROGRAM_PREFIX}lsphp${PHP_PROGRAM_SUFFIX} 57 | ) 58 | 59 | install( 60 | TARGETS php_sapi_litespeed 61 | RUNTIME 62 | DESTINATION ${CMAKE_INSTALL_BINDIR} 63 | COMPONENT php-sapi-litespeed 64 | ) 65 | -------------------------------------------------------------------------------- /cmake/ext/dl_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # The dl_test extension 3 | 4 | Configure the `dl_test` extension. 5 | 6 | This extension provides support for testing PHP `dl()` function relevant when 7 | running PHP tests during development. 8 | 9 | ## PHP_EXT_DL_TEST 10 | 11 | * Default: `OFF` 12 | * Values: `ON|OFF` 13 | 14 | Enable the extension. 15 | 16 | This extension is always built as shared when enabled. 17 | #]=============================================================================] 18 | 19 | cmake_minimum_required(VERSION 4.2...4.3) 20 | 21 | project( 22 | PHP_EXT_DL_TEST 23 | LANGUAGES C 24 | ) 25 | 26 | include(FeatureSummary) 27 | 28 | option(PHP_EXT_DL_TEST "Enable the dl_test extension") 29 | 30 | add_feature_info( 31 | "ext/dl_test" 32 | PHP_EXT_DL_TEST 33 | "dl() function testing" 34 | ) 35 | 36 | if(NOT PHP_EXT_DL_TEST) 37 | return() 38 | endif() 39 | 40 | find_package(PHP REQUIRED) 41 | 42 | include(PHP/Extension) 43 | php_extension(dl_test) 44 | 45 | # The dl_test extension can be built only as a shared library. 46 | add_library(php_ext_dl_test MODULE) 47 | target_sources( 48 | php_ext_dl_test 49 | PRIVATE 50 | dl_test.c 51 | dl_test.stub.php 52 | ) 53 | 54 | target_compile_definitions( 55 | php_ext_dl_test 56 | PRIVATE 57 | ZEND_ENABLE_STATIC_TSRMLS_CACHE 58 | # TODO: PHP_DL_TEST_EXPORTS is currently unused. 59 | $<$,$,MODULE_LIBRARY;SHARED_LIBRARY>>:PHP_DL_TEST_EXPORTS> 60 | ) 61 | -------------------------------------------------------------------------------- /cmake/ext/shmop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # The shmop extension 3 | 4 | Configure the `shmop` extension. 5 | 6 | This extension provides support for shared memory segments operations. 7 | 8 | ## PHP_EXT_SHMOP 9 | 10 | * Default: `OFF` 11 | * Values: `ON|OFF` 12 | 13 | Enable the extension. 14 | 15 | ## PHP_EXT_SHMOP_SHARED 16 | 17 | * Default: `OFF` 18 | * Values: `ON|OFF` 19 | 20 | Build extension as shared. 21 | #]=============================================================================] 22 | 23 | cmake_minimum_required(VERSION 4.2...4.3) 24 | 25 | project( 26 | PHP_EXT_SHMOP 27 | LANGUAGES C 28 | ) 29 | 30 | include(CMakeDependentOption) 31 | include(FeatureSummary) 32 | 33 | option(PHP_EXT_SHMOP "Enable the shmop extension") 34 | 35 | add_feature_info( 36 | "ext/shmop" 37 | PHP_EXT_SHMOP 38 | "shared memory segments operations support" 39 | ) 40 | 41 | cmake_dependent_option( 42 | PHP_EXT_SHMOP_SHARED 43 | "Build the shmop extension as a shared library" 44 | OFF 45 | PHP_EXT_SHMOP 46 | OFF 47 | ) 48 | 49 | if(NOT PHP_EXT_SHMOP) 50 | return() 51 | endif() 52 | 53 | find_package(PHP REQUIRED) 54 | 55 | include(PHP/Extension) 56 | php_extension(shmop) 57 | 58 | if(PHP_EXT_SHMOP_SHARED) 59 | add_library(php_ext_shmop MODULE) 60 | else() 61 | add_library(php_ext_shmop OBJECT) 62 | endif() 63 | 64 | target_sources( 65 | php_ext_shmop 66 | PRIVATE 67 | shmop.c 68 | shmop.stub.php 69 | ) 70 | 71 | set(HAVE_SHMOP TRUE) 72 | 73 | configure_file(cmake/config.h.in config.h) 74 | -------------------------------------------------------------------------------- /docs/cmake/ext/gd.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/gd/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/gd/CMakeLists.txt) 3 | 4 | # The gd extension 5 | 6 | Configure the `gd` extension. 7 | 8 | This extension provides image processing and graphics draw (GD) support. 9 | 10 | ## PHP_EXT_GD 11 | 12 | * Default: `OFF` 13 | * Values: `ON|OFF` 14 | 15 | Enable the extension. 16 | 17 | ## PHP_EXT_GD_SHARED 18 | 19 | * Default: `OFF` 20 | * Values: `ON|OFF` 21 | 22 | Build extension as shared. 23 | 24 | ## PHP_EXT_GD_EXTERNAL 25 | 26 | * Default: `OFF` 27 | * Values: `ON|OFF` 28 | 29 | Use external (system) GD library instead of the bundled libgd from PHP sources. 30 | 31 | ## PHP_EXT_GD_AVIF 32 | 33 | * Default: `OFF` 34 | * Values: `ON|OFF` 35 | 36 | Enable AVIF support (only for bundled libgd). 37 | 38 | ## PHP_EXT_GD_WEBP 39 | 40 | * Default: `OFF` 41 | * Values: `ON|OFF` 42 | 43 | Enable WebP support (only for bundled libgd). 44 | 45 | ## PHP_EXT_GD_JPEG 46 | 47 | * Default: `OFF` 48 | * Values: `ON|OFF` 49 | 50 | Enable JPEG support (only for bundled libgd). 51 | 52 | ## PHP_EXT_GD_XPM 53 | 54 | * Default: `OFF` 55 | * Values: `ON|OFF` 56 | 57 | Enable XPM support (only for bundled libgd). 58 | 59 | ## PHP_EXT_GD_FREETYPE 60 | 61 | * Default: `OFF` 62 | * Values: `ON|OFF` 63 | 64 | Enable FreeType 2 support (only for bundled libgd). 65 | 66 | ## PHP_EXT_GD_JIS 67 | 68 | * Default: `OFF` 69 | * Values: `ON|OFF` 70 | 71 | Enable JIS-mapped (Japanese Industrial Standards) Japanese font support (only 72 | for bundled libgd). 73 | -------------------------------------------------------------------------------- /cmake/cmake/checks/CheckAlloca.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | This check determines whether the system supports alloca() and follows the 3 | behavior of Autoconf's AC_FUNC_ALLOCA macro, with some adjustments for obsolete 4 | systems: 5 | 6 | * Autoconf also checks whether works on certain obsolete systems. 7 | * Autoconf provides variable substitution to integrate a custom alloca.c 8 | implementation if alloca() is not available on the system. However, PHP 9 | doesn't use this feature. 10 | 11 | Result variables: 12 | 13 | * HAVE_ALLOCA 14 | * HAVE_ALLOCA_H 15 | #]=============================================================================] 16 | 17 | include(CheckIncludeFiles) 18 | include(CheckSymbolExists) 19 | 20 | # On Windows, alloca is defined in malloc.h as _alloca. Cache variables are 21 | # overridden to speed up the check and commands used for documentation purposes. 22 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 23 | set(PHP_HAVE_ALLOCA_H FALSE) 24 | set(PHP_HAVE_ALLOCA TRUE) 25 | endif() 26 | 27 | check_include_files(alloca.h PHP_HAVE_ALLOCA_H) 28 | 29 | if(PHP_HAVE_ALLOCA_H) 30 | # Most *.nix systems (Linux, macOS, Solaris/illumos, Haiku). 31 | check_symbol_exists(alloca alloca.h PHP_HAVE_ALLOCA) 32 | elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") 33 | check_symbol_exists(alloca malloc.h PHP_HAVE_ALLOCA) 34 | else() 35 | # BSD-based systems, old Linux. 36 | check_symbol_exists(alloca stdlib.h PHP_HAVE_ALLOCA) 37 | endif() 38 | 39 | set(HAVE_ALLOCA ${PHP_HAVE_ALLOCA}) 40 | set(HAVE_ALLOCA_H ${PHP_HAVE_ALLOCA_H}) 41 | -------------------------------------------------------------------------------- /cmake/ext/json/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # The json extension 3 | 4 | Configure the `json` extension. 5 | 6 | This extension provides support for working with JavaScript Object Notation 7 | (JSON) and is always enabled. 8 | #]=============================================================================] 9 | 10 | cmake_minimum_required(VERSION 4.2...4.3) 11 | 12 | project( 13 | PHP_EXT_JSON 14 | LANGUAGES C 15 | ) 16 | 17 | if(PROJECT_IS_TOP_LEVEL) 18 | message( 19 | FATAL_ERROR 20 | "The PHP json extension is intended to be built only within the " 21 | "top-level PHP source tree (php-src)." 22 | ) 23 | endif() 24 | 25 | include(FeatureSummary) 26 | 27 | add_feature_info( 28 | "ext/json" 29 | TRUE 30 | "JavaScript Object Notation" 31 | ) 32 | 33 | include(PHP/Extension) 34 | php_extension(json) 35 | 36 | add_library(php_ext_json OBJECT) 37 | 38 | target_sources( 39 | php_ext_json 40 | PRIVATE 41 | json_encoder.c 42 | json_parser.tab.c 43 | json_scanner.c 44 | json.c 45 | json.stub.php 46 | PUBLIC 47 | FILE_SET HEADERS 48 | FILES 49 | php_json_parser.h 50 | php_json_scanner.h 51 | php_json.h 52 | ) 53 | 54 | target_compile_definitions(php_ext_json PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE) 55 | 56 | ################################################################################ 57 | # Generate parser and lexer files. 58 | ################################################################################ 59 | 60 | include(cmake/GenerateGrammar.cmake) 61 | -------------------------------------------------------------------------------- /cmake/cmake/Testing.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Enable and configure tests. 3 | #]=============================================================================] 4 | 5 | if(NOT TARGET PHP::sapi::cli) 6 | return() 7 | endif() 8 | 9 | enable_testing() 10 | 11 | block() 12 | cmake_host_system_information(RESULT processors QUERY NUMBER_OF_LOGICAL_CORES) 13 | 14 | set(parallel "") 15 | if(processors) 16 | set(parallel -j${processors}) 17 | endif() 18 | 19 | get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS) 20 | foreach(extension IN LISTS extensions) 21 | get_target_property(type PHP::ext::${extension} TYPE) 22 | if(type MATCHES "^(MODULE|SHARED)_LIBRARY$") 23 | get_target_property( 24 | is_zend_extension 25 | PHP::ext::${extension} 26 | PHP_ZEND_EXTENSION 27 | ) 28 | if(is_zend_extension) 29 | list(APPEND options -d zend_extension=${extension}) 30 | elseif(NOT extension STREQUAL "dl_test") 31 | list(APPEND options -d extension=${extension}) 32 | endif() 33 | endif() 34 | endforeach() 35 | 36 | add_test( 37 | NAME PHP 38 | COMMAND 39 | PHP::sapi::cli 40 | -n 41 | -d open_basedir= 42 | -d output_buffering=0 43 | -d memory_limit=-1 44 | run-tests.php 45 | -n 46 | -d extension_dir=${PHP_BINARY_DIR}/modules/$ 47 | --show-diff 48 | ${options} 49 | ${parallel} 50 | -q 51 | WORKING_DIRECTORY ${PHP_SOURCE_DIR} 52 | ) 53 | endblock() 54 | -------------------------------------------------------------------------------- /cmake/ext/sysvshm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # The sysvshm extension 3 | 4 | Configure the `sysvshm` extension. 5 | 6 | This extension provides the System V shared memory support. 7 | 8 | ## PHP_EXT_SYSVSHM 9 | 10 | * Default: `OFF` 11 | * Values: `ON|OFF` 12 | 13 | Enable the extension. 14 | 15 | ## PHP_EXT_SYSVSHM_SHARED 16 | 17 | * Default: `OFF` 18 | * Values: `ON|OFF` 19 | 20 | Build extension as shared. 21 | #]=============================================================================] 22 | 23 | cmake_minimum_required(VERSION 4.2...4.3) 24 | 25 | project( 26 | PHP_EXT_SYSVSHM 27 | LANGUAGES C 28 | ) 29 | 30 | include(CMakeDependentOption) 31 | include(FeatureSummary) 32 | 33 | option(PHP_EXT_SYSVSHM "Enable the sysvshm extension") 34 | 35 | add_feature_info( 36 | "ext/sysvshm" 37 | PHP_EXT_SYSVSHM 38 | "System V shared memory support" 39 | ) 40 | 41 | cmake_dependent_option( 42 | PHP_EXT_SYSVSHM_SHARED 43 | "Build the sysvshm extension as a shared library" 44 | OFF 45 | PHP_EXT_SYSVSHM 46 | OFF 47 | ) 48 | 49 | if(NOT PHP_EXT_SYSVSHM) 50 | return() 51 | endif() 52 | 53 | find_package(PHP REQUIRED) 54 | 55 | include(PHP/Extension) 56 | php_extension(sysvshm) 57 | 58 | if(PHP_EXT_SYSVSHM_SHARED) 59 | add_library(php_ext_sysvshm MODULE) 60 | else() 61 | add_library(php_ext_sysvshm OBJECT) 62 | endif() 63 | 64 | target_sources( 65 | php_ext_sysvshm 66 | PRIVATE 67 | sysvshm.c 68 | sysvshm.stub.php 69 | ) 70 | 71 | set(HAVE_SYSVSHM TRUE) 72 | 73 | configure_file(cmake/config.h.in config.h) 74 | -------------------------------------------------------------------------------- /docs/faq.md: -------------------------------------------------------------------------------- 1 | # Frequently asked questions 2 | 3 | This is a collection of some explanations discovered during making the build 4 | system. 5 | 6 | ## Preprocessor macros in configuration header file 7 | 8 | The configuration header (`main/php_config.h` on *nix systems and 9 | `main/config.w32.h` on Windows) is generated during the configuration step 10 | based on the tests for particular system. The style might be on the first glance 11 | very inconsistent due to history reasons. 12 | 13 | For example, 14 | 15 | some macros have two states like *undefined/defined*, some have 16 | *undefined/defined to 1*, and some have *defined to 0 or 1*. In modern code the 17 | preprocessor macros are in theory considered a bad practice due to making the C 18 | code unreadable. However, in practice they are unavoidable to ensure the 19 | portability of the code on a variety of systems. 20 | 21 | The *undefined/defined to 1* style is there mostly due to the Autotools historic 22 | reasons where in the early C days it was easier to write C like this: 23 | 24 | ```c 25 | #if HAVE_SOMETHING 26 | /* ... */ 27 | #endif 28 | ``` 29 | 30 | When `HAVE_SOMETHING` is not defined, compiler automatically resolves it to 31 | value `0`. However, in today's C code the `-Wundef` warnings appear in such code 32 | if `HAVE_SOMETHING` is undefined, so the code should be written as: 33 | 34 | ```c 35 | #ifdef HAVE_SOMETHING 36 | /* ... */ 37 | #endif 38 | ``` 39 | 40 | The *undefined/defined to 1* is in these configuration headers only a relic from 41 | the past. New code can use the *undefined/defined* states or 42 | *defined to 0 or 1*. 43 | -------------------------------------------------------------------------------- /cmake/ext/ctype/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # The ctype extension 3 | 4 | Configure the `ctype` extension. 5 | 6 | This extension provides support for character type checking according to the 7 | locale. 8 | 9 | ## PHP_EXT_CTYPE 10 | 11 | * Default: `ON` 12 | * Values: `ON|OFF` 13 | 14 | Enable the extension. 15 | 16 | ## PHP_EXT_CTYPE_SHARED 17 | 18 | * Default: `OFF` 19 | * Values: `ON|OFF` 20 | 21 | Build extension as shared. 22 | #]=============================================================================] 23 | 24 | cmake_minimum_required(VERSION 4.2...4.3) 25 | 26 | project( 27 | PHP_EXT_CTYPE 28 | LANGUAGES C 29 | ) 30 | 31 | include(CMakeDependentOption) 32 | include(FeatureSummary) 33 | 34 | option(PHP_EXT_CTYPE "Enable the ctype extension" ON) 35 | 36 | add_feature_info( 37 | "ext/ctype" 38 | PHP_EXT_CTYPE 39 | "character type checking according to the locale" 40 | ) 41 | 42 | cmake_dependent_option( 43 | PHP_EXT_CTYPE_SHARED 44 | "Build the ctype extension as a shared library" 45 | OFF 46 | PHP_EXT_CTYPE 47 | OFF 48 | ) 49 | 50 | if(NOT PHP_EXT_CTYPE) 51 | return() 52 | endif() 53 | 54 | find_package(PHP REQUIRED) 55 | 56 | include(PHP/Extension) 57 | php_extension(ctype) 58 | 59 | if(PHP_EXT_CTYPE_SHARED) 60 | add_library(php_ext_ctype MODULE) 61 | else() 62 | add_library(php_ext_ctype OBJECT) 63 | endif() 64 | 65 | target_sources( 66 | php_ext_ctype 67 | PRIVATE 68 | ctype.c 69 | ctype.stub.php 70 | ) 71 | 72 | set(HAVE_CTYPE TRUE) 73 | 74 | configure_file(cmake/config.h.in config.h) 75 | -------------------------------------------------------------------------------- /docs/cmake/ext/com_dotnet.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [ext/com_dotnet/CMakeLists.txt](https://github.com/petk/php-build-system/blob/master/cmake/ext/com_dotnet/CMakeLists.txt) 3 | 4 | # The com_dotnet extension 5 | 6 | Configure the `com_dotnet` extension. 7 | 8 | This extension provides the Component Object Model (COM) and .NET support. 9 | 10 | > [!NOTE] 11 | > This extension is available only when the target system is Windows. 12 | 13 | ## Requirements 14 | 15 | To build this extension, Windows SDK needs to be installed, which includes 16 | the COM support. 17 | 18 | To enable also the .NET support in this extension (e.g., the `dotnet` PHP 19 | class), the .NET framework needs to be installed, which provides the 20 | `` header. This can be done in several ways: 21 | 22 | * in Visual Studio by installing the .NET desktop development workload 23 | * in Visual Studio by installing the .NET framework 4.x component only 24 | * Download and install 25 | [.NET framework](https://dotnet.microsoft.com/en-us/download/dotnet-framework) 26 | manually. 27 | 28 | The .NET version 5 and later are not supported as they have removed the 29 | `` API. 30 | 31 | ## Configuration options 32 | 33 | ### PHP_EXT_COM_DOTNET 34 | 35 | * Default: `ON` 36 | * Values: `ON|OFF` 37 | 38 | Enables the extension. 39 | 40 | ### PHP_EXT_COM_DOTNET_SHARED 41 | 42 | * Default: `OFF` 43 | * Values: `ON|OFF` 44 | 45 | Builds extension as shared. 46 | 47 | ### PHP_EXT_COM_DOTNET_ENABLE_DOTNET 48 | 49 | * Default: `ON` 50 | * Values: `ON|OFF` 51 | 52 | Enables the .NET Framework support. 53 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindFFI.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindFFI.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindFFI.cmake) 3 | 4 | # FindFFI 5 | 6 | Finds the FFI library: 7 | 8 | ```cmake 9 | find_package(FFI) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `FFI::FFI` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `FFI_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `FFI_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `FFI_INCLUDE_DIR` - Directory containing package library headers. 31 | * `FFI_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(FFI) 40 | target_link_libraries(example PRIVATE FFI::FFI) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the FFI package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `FFI_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/FFI;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DFFI_ROOT=/opt/FFI \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindGD.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindGD.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindGD.cmake) 3 | 4 | # FindGD 5 | 6 | Finds the GD library: 7 | 8 | ```cmake 9 | find_package(GD [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `GD::GD` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `GD_FOUND` - Boolean indicating whether (the requested version of) package was 23 | found. 24 | * `GD_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `GD_INCLUDE_DIR` - Directory containing package library headers. 31 | * `GD_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(GD) 40 | target_link_libraries(example PRIVATE GD::GD) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the GD package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `GD_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/GD;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DGD_ROOT=/opt/GD \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindFreeTDS.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindFreeTDS.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindFreeTDS.cmake) 3 | 4 | # FindFreeTDS 5 | 6 | Finds the FreeTDS set of libraries: 7 | 8 | ```cmake 9 | find_package(FreeTDS) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `FreeTDS::FreeTDS` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `FreeTDS_FOUND` - Boolean indicating whether the package was found. 23 | 24 | ## Cache variables 25 | 26 | The following cache variables may also be set: 27 | 28 | * `FreeTDS_INCLUDE_DIR` - Directory containing package library headers. 29 | * `FreeTDS_LIBRARY` - The path to the package library. 30 | 31 | ## Examples 32 | 33 | Basic usage: 34 | 35 | ```cmake 36 | # CMakeLists.txt 37 | find_package(FreeTDS) 38 | target_link_libraries(example PRIVATE FreeTDS::FreeTDS) 39 | ``` 40 | 41 | ## Customizing search locations 42 | 43 | To customize where to look for the FreeTDS package base 44 | installation directory, a common `CMAKE_PREFIX_PATH` or 45 | package-specific `FREETDS_ROOT` variable can be set at 46 | the configuration phase. For example: 47 | 48 | ```sh 49 | cmake -S \ 50 | -B \ 51 | -DCMAKE_PREFIX_PATH="/opt/FreeTDS;/opt/some-other-package" 52 | # or 53 | cmake -S \ 54 | -B \ 55 | -DFREETDS_ROOT=/opt/FreeTDS \ 56 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 57 | ``` 58 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindCdb.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindCdb.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindCdb.cmake) 3 | 4 | # FindCdb 5 | 6 | Finds the cdb library: 7 | 8 | ```cmake 9 | find_package(Cdb [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `Cdb::Cdb` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `Cdb_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `Cdb_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `Cdb_INCLUDE_DIR` - Directory containing package library headers. 31 | * `Cdb_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(Cdb) 40 | target_link_libraries(example PRIVATE Cdb::Cdb) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the Cdb package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `CDB_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/Cdb;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DCDB_ROOT=/opt/Cdb \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindGMP.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindGMP.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindGMP.cmake) 3 | 4 | # FindGMP 5 | 6 | Finds the GMP library: 7 | 8 | ```cmake 9 | find_package(GMP [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `GMP::GMP` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `GMP_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `GMP_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `GMP_INCLUDE_DIR` - Directory containing package library headers. 31 | * `GMP_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(GMP) 40 | target_link_libraries(example PRIVATE GMP::GMP) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the GMP package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `GMP_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/GMP;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DGMP_ROOT=/opt/GMP \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindXPM.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindXPM.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindXPM.cmake) 3 | 4 | # FindXPM 5 | 6 | Finds the libXpm library: 7 | 8 | ```cmake 9 | find_package(XPM [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `XPM::XPM` - The libXpm library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `XPM_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `XPM_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `XPM_INCLUDE_DIR` - Directory containing package library headers. 31 | * `XPM_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(XPM) 40 | target_link_libraries(example PRIVATE XPM::XPM) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the XPM package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `XPM_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/XPM;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DXPM_ROOT=/opt/XPM \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/PHP/LinkWhatYouUse.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/PHP/LinkWhatYouUse.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/PHP/LinkWhatYouUse.cmake) 3 | 4 | # PHP/LinkWhatYouUse 5 | 6 | Check whether to enable `CMAKE_LINK_WHAT_YOU_USE`. 7 | 8 | When enabled, warnings are emitted during the build phase for diagnostic 9 | purposes if any unused libraries are linked to executables and shared or module 10 | libraries. The CMake versions at the time of writing use `ldd -u -r` on ELF 11 | platforms to determine unused linked libraries 12 | (`CMAKE_LINK_WHAT_YOU_USE_CHECK`). This module also checks whether `ldd` is 13 | available on the host platform and has required options. For example, on Haiku, 14 | where `ldd` is not available, or on Solaris with different `ldd` implementation. 15 | 16 | Caveats: 17 | 18 | When `CMAKE_LINK_WHAT_YOU_USE` is enabled, CMake will add the `--no-as-needed` 19 | linker flag to executables and shared or module libraries to be able to 20 | determine the redundant libraries on targets. However, this shouldn't be done 21 | for release builds and `CMAKE_LINK_WHAT_YOU_USE` should be disabled for the 22 | `Release` build type to rely on system's default linker flag `--as-needed`, if 23 | set. In ideal case scenario, the linked libraries should be added to targets 24 | only if they are actually needed at the configuration time in the first place. 25 | 26 | TODO: Fix unused direct dependencies warnings and add `option()` for 27 | `CMAKE_LINK_WHAT_YOU_USE`. 28 | 29 | ## Usage 30 | 31 | ```cmake 32 | # CMakeLists.txt 33 | include(PHP/LinkWhatYouUse) 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindCcache.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindCcache.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindCcache.cmake) 3 | 4 | # FindCcache 5 | 6 | Finds the Ccache compiler cache tool for faster compilation times: 7 | 8 | ```cmake 9 | find_package(Ccache [] [...]) 10 | ``` 11 | 12 | ## Result variables 13 | 14 | This module defines the following variables: 15 | 16 | * `Ccache_FOUND` - Boolean indicating whether (the requested version of) package 17 | was found. 18 | * `Ccache_VERSION` - The version of package found. 19 | 20 | ## Cache variables 21 | 22 | The following cache variables may also be set: 23 | 24 | * `Ccache_EXECUTABLE` - The path to the ccache executable. 25 | 26 | ## Hints 27 | 28 | * The `CCACHE_DISABLE` regular or environment variable which disables ccache and 29 | doesn't adjust the C and CXX launcher. For more info see Ccache documentation. 30 | 31 | ## Examples 32 | 33 | Basic usage: 34 | 35 | ```cmake 36 | # CMakeLists.txt 37 | find_package(Ccache) 38 | ``` 39 | 40 | ## Customizing search locations 41 | 42 | To customize where to look for the Ccache package base 43 | installation directory, a common `CMAKE_PREFIX_PATH` or 44 | package-specific `CCACHE_ROOT` variable can be set at 45 | the configuration phase. For example: 46 | 47 | ```sh 48 | cmake -S \ 49 | -B \ 50 | -DCMAKE_PREFIX_PATH="/opt/Ccache;/opt/some-other-package" 51 | # or 52 | cmake -S \ 53 | -B \ 54 | -DCCACHE_ROOT=/opt/Ccache \ 55 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 56 | ``` 57 | -------------------------------------------------------------------------------- /cmake/Zend/cmake/CheckStrerrorR.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check whether strerror_r() implementation is POSIX-compatible or GNU-specific. 3 | 4 | Result variables: 5 | 6 | * HAVE_STRERROR_R 7 | * STRERROR_R_CHAR_P 8 | #]=============================================================================] 9 | 10 | include(CheckSourceCompiles) 11 | include(CheckSymbolExists) 12 | include(CMakePushCheckState) 13 | 14 | set(HAVE_STRERROR_R FALSE) 15 | set(STRERROR_R_CHAR_P FALSE) 16 | 17 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 18 | return() 19 | endif() 20 | 21 | check_symbol_exists(strerror_r string.h PHP_ZEND_HAVE_STRERROR_R) 22 | 23 | if(NOT PHP_ZEND_HAVE_STRERROR_R) 24 | return() 25 | endif() 26 | 27 | set(HAVE_STRERROR_R TRUE) 28 | 29 | # Skip in consecutive configuration phases. 30 | if(NOT DEFINED PHP_ZEND_STRERROR_R_CHAR_P) 31 | message(CHECK_START "Checking strerror_r() return type") 32 | 33 | cmake_push_check_state(RESET) 34 | set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) 35 | set(CMAKE_REQUIRED_QUIET TRUE) 36 | 37 | check_source_compiles(C [[ 38 | #include 39 | 40 | int main(void) 41 | { 42 | char buf[100]; 43 | char x = *strerror_r (0, buf, sizeof buf); 44 | char *p = strerror_r (0, buf, sizeof buf); 45 | return !p || x; 46 | } 47 | ]] PHP_ZEND_STRERROR_R_CHAR_P) 48 | cmake_pop_check_state() 49 | 50 | if(PHP_ZEND_STRERROR_R_CHAR_P) 51 | message(CHECK_PASS "char *") 52 | else() 53 | message(CHECK_PASS "int") 54 | endif() 55 | endif() 56 | 57 | set(STRERROR_R_CHAR_P ${PHP_ZEND_STRERROR_R_CHAR_P}) 58 | -------------------------------------------------------------------------------- /cmake/cmake/checks/CheckCopyFileRange.cmake: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | Check copy_file_range(). On FreeBSD, copy_file_range() works only with the 3 | undocumented flag '0x01000000'. Until the problem is fixed properly, 4 | copy_file_range() is used only on Linux. 5 | 6 | Result variables: 7 | 8 | * HAVE_COPY_FILE_RANGE 9 | #]=============================================================================] 10 | 11 | include(CheckSourceCompiles) 12 | include(CMakePushCheckState) 13 | 14 | if(CMAKE_SYSTEM_NAME STREQUAL "Windows") 15 | set(HAVE_COPY_FILE_RANGE FALSE) 16 | return() 17 | endif() 18 | 19 | # Skip in consecutive configuration phases. 20 | if(NOT DEFINED PHP_HAVE_COPY_FILE_RANGE) 21 | message(CHECK_START "Checking for copy_file_range") 22 | 23 | cmake_push_check_state(RESET) 24 | set(CMAKE_REQUIRED_QUIET TRUE) 25 | set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) 26 | 27 | check_source_compiles(C [[ 28 | #ifndef __linux__ 29 | # error "unsupported platform" 30 | #endif 31 | 32 | #include 33 | 34 | #if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0) 35 | # error "kernel too old" 36 | #endif 37 | 38 | #include 39 | 40 | int main(void) 41 | { 42 | (void)copy_file_range(-1, 0, -1, 0, 0, 0); 43 | return 0; 44 | } 45 | ]] PHP_HAVE_COPY_FILE_RANGE) 46 | cmake_pop_check_state() 47 | 48 | if(PHP_HAVE_COPY_FILE_RANGE) 49 | message(CHECK_PASS "yes") 50 | else() 51 | message(CHECK_FAIL "no") 52 | endif() 53 | endif() 54 | 55 | set(HAVE_COPY_FILE_RANGE ${PHP_HAVE_COPY_FILE_RANGE}) 56 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindLMDB.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindLMDB.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindLMDB.cmake) 3 | 4 | # FindLMDB 5 | 6 | Finds the LMDB library: 7 | 8 | ```cmake 9 | find_package(LMDB [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `LMDB::LMDB` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `LMDB_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `LMDB_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `LMDB_INCLUDE_DIR` - Directory containing package library headers. 31 | * `LMDB_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(LMDB) 40 | target_link_libraries(example PRIVATE LMDB::LMDB) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the LMDB package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `LMDB_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/LMDB;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DLMDB_ROOT=/opt/LMDB \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindPCRE.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindPCRE.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindPCRE.cmake) 3 | 4 | # FindPCRE 5 | 6 | Finds the PCRE library: 7 | 8 | ```cmake 9 | find_package(PCRE [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `PCRE::PCRE` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `PCRE_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `PCRE_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `PCRE_INCLUDE_DIR` - Directory containing package library headers. 31 | * `PCRE_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(PCRE) 40 | target_link_libraries(example PRIVATE PCRE::PCRE) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the PCRE package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `PCRE_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/PCRE;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DPCRE_ROOT=/opt/PCRE \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindQDBM.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindQDBM.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindQDBM.cmake) 3 | 4 | # FindQDBM 5 | 6 | Finds the QDBM library: 7 | 8 | ```cmake 9 | find_package(QDBM [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `QDBM::QDBM` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `QDBM_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `QDBM_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `QDBM_INCLUDE_DIR` - Directory containing package library headers. 31 | * `QDBM_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(QDBM) 40 | target_link_libraries(example PRIVATE QDBM::QDBM) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the QDBM package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `QDBM_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/QDBM;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DQDBM_ROOT=/opt/QDBM \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindSASL.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindSASL.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindSASL.cmake) 3 | 4 | # FindSASL 5 | 6 | Finds the SASL library: 7 | 8 | ```cmake 9 | find_package(SASL [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `SASL::SASL` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `SASL_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `SASL_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `SASL_INCLUDE_DIR` - Directory containing package library headers. 31 | * `SASL_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(SASL) 40 | target_link_libraries(example PRIVATE SASL::SASL) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the SASL package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `SASL_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/SASL;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DSASL_ROOT=/opt/SASL \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindValgrind.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindValgrind.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindValgrind.cmake) 3 | 4 | # FindValgrind 5 | 6 | Finds Valgrind: 7 | 8 | ```cmake 9 | find_package(Valgrind [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `Valgrind::Valgrind` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `Valgrind_FOUND` - Boolean indicating whether (the requested version of) 23 | package was found. 24 | * `Valgrind_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `Valgrind_INCLUDE_DIR` - Directory containing package library headers. 31 | 32 | ## Examples 33 | 34 | Basic usage: 35 | 36 | ```cmake 37 | # CMakeLists.txt 38 | find_package(Valgrind) 39 | target_link_libraries(example PRIVATE Valgrind::Valgrind) 40 | ``` 41 | 42 | ## Customizing search locations 43 | 44 | To customize where to look for the Valgrind package base 45 | installation directory, a common `CMAKE_PREFIX_PATH` or 46 | package-specific `VALGRIND_ROOT` variable can be set at 47 | the configuration phase. For example: 48 | 49 | ```sh 50 | cmake -S \ 51 | -B \ 52 | -DCMAKE_PREFIX_PATH="/opt/Valgrind;/opt/some-other-package" 53 | # or 54 | cmake -S \ 55 | -B \ 56 | -DVALGRIND_ROOT=/opt/Valgrind \ 57 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 58 | ``` 59 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindWebP.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindWebP.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindWebP.cmake) 3 | 4 | # FindWebP 5 | 6 | Finds the libwebp library: 7 | 8 | ```cmake 9 | find_package(WebP [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `WebP::WebP` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `WebP_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `WebP_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `WebP_INCLUDE_DIR` - Directory containing package library headers. 31 | * `WebP_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(WebP) 40 | target_link_libraries(example PRIVATE WebP::WebP) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the WebP package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `WEBP_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/WebP;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DWEBP_ROOT=/opt/WebP \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/PHP/StandardLibrary.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/PHP/StandardLibrary.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/PHP/StandardLibrary.cmake) 3 | 4 | # PHP/StandardLibrary 5 | 6 | This module determines the C standard library used for the build. 7 | 8 | Load this module in a CMake project with: 9 | 10 | ```cmake 11 | include(PHP/StandardLibrary) 12 | ``` 13 | 14 | ## Variables 15 | 16 | Including this module will define the following variables: 17 | 18 | ### Cache variables 19 | 20 | * `PHP_C_STANDARD_LIBRARY` 21 | 22 | Lowercase name of the C standard library. This internal cache variable will be 23 | set to one of the following values: 24 | 25 | * `cosmopolitan` 26 | * `dietlibc` 27 | * `glibc` 28 | * `llvm` 29 | * `mscrt` 30 | * `musl` 31 | * `uclibc` 32 | * "" (empty string) 33 | 34 | If C standard library cannot be determined, it is set to empty string. 35 | 36 | ### Result variables: 37 | 38 | * `PHP_C_STANDARD_LIBRARY_CODE` 39 | 40 | CMake variable containing some helper code for use in the C configuration 41 | header. 42 | 43 | For example, when C standard library implementation is musl, the value of this 44 | variable will contain: 45 | 46 | ```c 47 | /* Define to 1 when using musl libc. */ 48 | #define __MUSL__ 1 49 | ``` 50 | 51 | ## Examples 52 | 53 | Basic usage: 54 | 55 | ```cmake 56 | # CMakeLists.txt 57 | 58 | include(PHP/StandardLibrary) 59 | 60 | message(STATUS "PHP_C_STANDARD_LIBRARY=${PHP_C_STANDARD_LIBRARY}") 61 | 62 | file(CONFIGURE OUTPUT config.h CONTENT [[ 63 | @PHP_C_STANDARD_LIBRARY_CODE@ 64 | ]]) 65 | ``` 66 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindArgon2.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindArgon2.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindArgon2.cmake) 3 | 4 | # FindArgon2 5 | 6 | Finds the Argon2 library: 7 | 8 | ```cmake 9 | find_package(Argon2 [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `Argon2::Argon2` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `Argon2_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `Argon2_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `Argon2_INCLUDE_DIR` - Directory containing package library headers. 31 | * `Argon2_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(Argon2) 40 | target_link_libraries(example PRIVATE Argon2::Argon2) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the Argon2 package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `ARGON2_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/Argon2;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DARGON2_ROOT=/opt/Argon2 \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindDmalloc.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindDmalloc.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindDmalloc.cmake) 3 | 4 | # FindDmalloc 5 | 6 | Finds the Dmalloc library: 7 | 8 | ```cmake 9 | find_package(Dmalloc) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `Dmalloc::Dmalloc` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `Dmalloc_FOUND` - Boolean indicating whether (the requested version of) 23 | package was found. 24 | * `Dmalloc_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `Dmalloc_INCLUDE_DIR` - Directory containing package library headers. 31 | * `Dmalloc_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(Dmalloc) 40 | target_link_libraries(example PRIVATE Dmalloc::Dmalloc) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the Dmalloc package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `DMALLOC_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/Dmalloc;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DDMALLOC_ROOT=/opt/Dmalloc \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindSodium.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindSodium.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindSodium.cmake) 3 | 4 | # FindSodium 5 | 6 | Finds the Sodium library (libsodium): 7 | 8 | ```cmake 9 | find_package(Sodium [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `Sodium::Sodium` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `Sodium_FOUND` - Boolean indicating whether (the requested version of) package 23 | was found. 24 | * `Sodium_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `Sodium_INCLUDE_DIR` - Directory containing package library headers. 31 | * `Sodium_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(Sodium) 40 | target_link_libraries(example PRIVATE Sodium::Sodium) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the Sodium package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `SODIUM_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/Sodium;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DSODIUM_ROOT=/opt/Sodium \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindSELinux.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindSELinux.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindSELinux.cmake) 3 | 4 | # FindSELinux 5 | 6 | Finds the SELinux library: 7 | 8 | ```cmake 9 | find_package(SELinux [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `SELinux::SELinux` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `SELinux_FOUND` - Boolean indicating whether (the requested version of) 23 | package was found. 24 | * `SELinux_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `SELinux_INCLUDE_DIR` - Directory containing package library headers. 31 | * `SELinux_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(SELinux) 40 | target_link_libraries(example PRIVATE SELinux::SELinux) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the SELinux package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `SELINUX_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/SELinux;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DSELINUX_ROOT=/opt/SELinux \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindEditline.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindEditline.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindEditline.cmake) 3 | 4 | # FindEditline 5 | 6 | Finds the Editline library: 7 | 8 | ```cmake 9 | find_package(Editline) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `Editline::Editline` - The Editline library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `Editline_FOUND` - Boolean indicating whether (the requested version of) 23 | package was found. 24 | * `Editline_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `Editline_INCLUDE_DIR` - Directory containing package library headers. 31 | * `Editline_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(Editline) 40 | target_link_libraries(example PRIVATE Editline::Editline) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the Editline package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `EDITLINE_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/Editline;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DEDITLINE_ROOT=/opt/Editline \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /cmake/ext/calendar/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[=============================================================================[ 2 | # The calendar extension 3 | 4 | Configure the `calendar` extension. 5 | 6 | This extension provides support for calendar conversion. 7 | 8 | ## PHP_EXT_CALENDAR 9 | 10 | * Default: `OFF` 11 | * Values: `ON|OFF` 12 | 13 | Enable the extension. 14 | 15 | ## PHP_EXT_CALENDAR_SHARED 16 | 17 | * Default: `OFF` 18 | * Values: `ON|OFF` 19 | 20 | Build extension as shared. 21 | #]=============================================================================] 22 | 23 | cmake_minimum_required(VERSION 4.2...4.3) 24 | 25 | project( 26 | PHP_EXT_CALENDAR 27 | LANGUAGES C 28 | ) 29 | 30 | include(CMakeDependentOption) 31 | include(FeatureSummary) 32 | 33 | option(PHP_EXT_CALENDAR "Enable the calendar extension") 34 | 35 | add_feature_info( 36 | "ext/calendar" 37 | PHP_EXT_CALENDAR 38 | "calendar conversion support" 39 | ) 40 | 41 | cmake_dependent_option( 42 | PHP_EXT_CALENDAR_SHARED 43 | "Build the calendar extension as a shared library" 44 | OFF 45 | PHP_EXT_CALENDAR 46 | OFF 47 | ) 48 | 49 | if(NOT PHP_EXT_CALENDAR) 50 | return() 51 | endif() 52 | 53 | find_package(PHP REQUIRED) 54 | 55 | include(PHP/Extension) 56 | php_extension(calendar) 57 | 58 | if(PHP_EXT_CALENDAR_SHARED) 59 | add_library(php_ext_calendar MODULE) 60 | else() 61 | add_library(php_ext_calendar OBJECT) 62 | endif() 63 | 64 | target_sources( 65 | php_ext_calendar 66 | PRIVATE 67 | cal_unix.c 68 | calendar.c 69 | calendar.stub.php 70 | dow.c 71 | easter.c 72 | french.c 73 | gregor.c 74 | jewish.c 75 | julian.c 76 | ) 77 | 78 | set(HAVE_CALENDAR TRUE) 79 | 80 | configure_file(cmake/config.h.in config.h) 81 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindAppArmor.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindAppArmor.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindAppArmor.cmake) 3 | 4 | # FindAppArmor 5 | 6 | Finds the AppArmor library: 7 | 8 | ```cmake 9 | find_package(AppArmor [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `AppArmor::AppArmor` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `AppArmor_FOUND` - Boolean indicating whether (the requested version of) 23 | package was found. 24 | * `AppArmor_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `AppArmor_INCLUDE_DIR` - Directory containing package library headers. 31 | * `AppArmor_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(AppArmor) 40 | target_link_libraries(example PRIVATE AppArmor::AppArmor) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the AppArmor package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `APPARMOR_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/AppArmor;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DAPPARMOR_ROOT=/opt/AppArmor \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/cmake/modules/FindCapstone.md: -------------------------------------------------------------------------------- 1 | 2 | * Source code: [cmake/modules/FindCapstone.cmake](https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindCapstone.cmake) 3 | 4 | # FindCapstone 5 | 6 | Finds the Capstone library: 7 | 8 | ```cmake 9 | find_package(Capstone [] [...]) 10 | ``` 11 | 12 | ## Imported targets 13 | 14 | This module provides the following imported targets: 15 | 16 | * `Capstone::Capstone` - The package library, if found. 17 | 18 | ## Result variables 19 | 20 | This module defines the following variables: 21 | 22 | * `Capstone_FOUND` - Boolean indicating whether (the requested version of) 23 | package was found. 24 | * `Capstone_VERSION` - The version of package found. 25 | 26 | ## Cache variables 27 | 28 | The following cache variables may also be set: 29 | 30 | * `Capstone_INCLUDE_DIR` - Directory containing package library headers. 31 | * `Capstone_LIBRARY` - The path to the package library. 32 | 33 | ## Examples 34 | 35 | Basic usage: 36 | 37 | ```cmake 38 | # CMakeLists.txt 39 | find_package(Capstone) 40 | target_link_libraries(example PRIVATE Capstone::Capstone) 41 | ``` 42 | 43 | ## Customizing search locations 44 | 45 | To customize where to look for the Capstone package base 46 | installation directory, a common `CMAKE_PREFIX_PATH` or 47 | package-specific `CAPSTONE_ROOT` variable can be set at 48 | the configuration phase. For example: 49 | 50 | ```sh 51 | cmake -S \ 52 | -B \ 53 | -DCMAKE_PREFIX_PATH="/opt/Capstone;/opt/some-other-package" 54 | # or 55 | cmake -S \ 56 | -B \ 57 | -DCAPSTONE_ROOT=/opt/Capstone \ 58 | -DSOMEOTHERPACKAGE_ROOT=/opt/some-other-package 59 | ``` 60 | --------------------------------------------------------------------------------