mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Merge remote-tracking branch 'origin/main' into henderkes-patch-1
This commit is contained in:
commit
6cf4c40cd2
@ -146,6 +146,8 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-
|
||||
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
||||
; EXTRA_CFLAGS for `configure` and `make` php
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"
|
||||
; minimum compatible macOS version (LLVM vars, availability not guaranteed)
|
||||
MACOSX_DEPLOYMENT_TARGET=12.0
|
||||
|
||||
[freebsd]
|
||||
; compiler environments
|
||||
|
||||
@ -127,6 +127,14 @@
|
||||
"sockets"
|
||||
]
|
||||
},
|
||||
"excimer": {
|
||||
"support": {
|
||||
"Windows": "wip",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"type": "external",
|
||||
"source": "ext-excimer"
|
||||
},
|
||||
"exif": {
|
||||
"type": "builtin"
|
||||
},
|
||||
|
||||
@ -126,13 +126,23 @@
|
||||
},
|
||||
"ext-event": {
|
||||
"type": "url",
|
||||
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz",
|
||||
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.1.4.tar.gz",
|
||||
"path": "php-src/ext/event",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-excimer": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/excimer",
|
||||
"path": "php-src/ext/excimer",
|
||||
"filename": "excimer.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-glfw": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mario-deluna/php-glfw",
|
||||
|
||||
19
src/SPC/builder/extension/excimer.php
Normal file
19
src/SPC/builder/extension/excimer.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('excimer')]
|
||||
class excimer extends Extension
|
||||
{
|
||||
public function getSharedExtensionEnv(): array
|
||||
{
|
||||
$env = parent::getSharedExtensionEnv();
|
||||
$env['LIBS'] = clean_spaces(str_replace('-lphp', '', $env['LIBS']));
|
||||
return $env;
|
||||
}
|
||||
}
|
||||
@ -72,12 +72,8 @@ trait UnixSystemUtilTrait
|
||||
if (!is_file($symbol_file)) {
|
||||
throw new SPCInternalException("The symbol file {$symbol_file} does not exist, please check if nm command is available.");
|
||||
}
|
||||
// https://github.com/ziglang/zig/issues/24662
|
||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||
return '-Wl,--export-dynamic';
|
||||
}
|
||||
// macOS
|
||||
if (SPCTarget::getTargetOS() !== 'Linux') {
|
||||
// macOS/zig
|
||||
if (SPCTarget::getTargetOS() !== 'Linux' || ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||
return "-Wl,-exported_symbols_list,{$symbol_file}";
|
||||
}
|
||||
return "-Wl,--dynamic-list={$symbol_file}";
|
||||
|
||||
@ -30,7 +30,6 @@ class curl extends WindowsLibraryBase
|
||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DBUILD_STATIC_LIBS=ON ' .
|
||||
'-DCURL_STATICLIB=ON ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
|
||||
'-DBUILD_CURL_EXE=OFF ' . // disable curl.exe
|
||||
'-DBUILD_TESTING=OFF ' . // disable tests
|
||||
@ -42,9 +41,9 @@ class curl extends WindowsLibraryBase
|
||||
'-DCURL_USE_OPENSSL=OFF ' . // disable openssl due to certificate issue
|
||||
'-DCURL_ENABLE_SSL=ON ' .
|
||||
'-DUSE_NGHTTP2=ON ' . // enable nghttp2
|
||||
'-DSHARE_LIB_OBJECT=OFF ' . // disable shared lib object
|
||||
'-DCURL_USE_LIBSSH2=ON ' . // enable libssh2
|
||||
'-DENABLE_IPV6=ON ' . // enable ipv6
|
||||
'-DNGHTTP2_CFLAGS="/DNGHTTP2_STATICLIB" ' .
|
||||
$alt
|
||||
)
|
||||
->execWithWrapper(
|
||||
@ -53,5 +52,7 @@ class curl extends WindowsLibraryBase
|
||||
);
|
||||
// move libcurl.lib to libcurl_a.lib
|
||||
rename(BUILD_LIB_PATH . '\libcurl.lib', BUILD_LIB_PATH . '\libcurl_a.lib');
|
||||
|
||||
FileSystem::replaceFileStr(BUILD_INCLUDE_PATH . '\curl\curl.h', '#ifdef CURL_STATICLIB', '#if 1');
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,11 +29,16 @@ class nghttp2 extends WindowsLibraryBase
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DENABLE_STATIC_CRT=ON ' .
|
||||
'-DENABLE_LIB_ONLY=ON ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
|
||||
'-DENABLE_STATIC_CRT=ON ' .
|
||||
'-DENABLE_DOC=OFF ' .
|
||||
'-DBUILD_TESTING=OFF '
|
||||
)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper('cmake'),
|
||||
"--build build --config Release --target install -j{$this->builder->concurrency}"
|
||||
);
|
||||
|
||||
FileSystem::replaceFileStr(BUILD_INCLUDE_PATH . '\nghttp2\nghttp2.h', '#ifdef NGHTTP2_STATICLIB', '#if 1');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user