mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 18:35:35 +08:00
Compare commits
32 Commits
2.0-rc8
...
3bd5a05725
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bd5a05725 | ||
|
|
a6fbcc954e | ||
|
|
66cebb5fe4 | ||
|
|
e3671387fc | ||
|
|
f7c73c00af | ||
|
|
74536bd2e1 | ||
|
|
a8f2b0096b | ||
|
|
2d192fc390 | ||
|
|
031da802f3 | ||
|
|
5fdeb33031 | ||
|
|
347da67b71 | ||
|
|
65ef9ab20c | ||
|
|
3d64c6349e | ||
|
|
31cf9bb5b7 | ||
|
|
7c4a991c0e | ||
|
|
07f943af7e | ||
|
|
ff74f0cdaf | ||
|
|
dccfde9f39 | ||
|
|
5db23e1db7 | ||
|
|
b1ae48a209 | ||
|
|
ac7a236763 | ||
|
|
1bf39c1f06 | ||
|
|
678283cd98 | ||
|
|
97a76aba8a | ||
|
|
af464e7b3d | ||
|
|
5ee7dd9200 | ||
|
|
9e1c2c6dd5 | ||
|
|
d29ba16cbc | ||
|
|
7bef45eb32 | ||
|
|
772ab77d2e | ||
|
|
58897c6941 | ||
|
|
8230e1bcec |
4
.github/workflows/build-linux-arm.yml
vendored
4
.github/workflows/build-linux-arm.yml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: downloads
|
||||
key: php-${{ inputs.version }}-dependencies
|
||||
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
||||
|
||||
# With or without debug
|
||||
- if: inputs.debug == true
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
|
||||
# If there's no dependencies cache, fetch sources, with or without debug
|
||||
- if: steps.cache-download.outputs.cache-hit != 'true'
|
||||
run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }}
|
||||
run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
|
||||
|
||||
# Run build command
|
||||
- run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
|
||||
|
||||
4
.github/workflows/build-linux-x86_64.yml
vendored
4
.github/workflows/build-linux-x86_64.yml
vendored
@@ -56,7 +56,7 @@ jobs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: downloads
|
||||
key: php-${{ inputs.version }}-dependencies
|
||||
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
||||
|
||||
# With or without debug
|
||||
- if: inputs.debug == true
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
|
||||
# If there's no dependencies cache, fetch sources, with or without debug
|
||||
- if: steps.cache-download.outputs.cache-hit != 'true'
|
||||
run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }}
|
||||
run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
|
||||
|
||||
# Run build command
|
||||
- run: ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
|
||||
|
||||
4
.github/workflows/build-macos-x86_64.yml
vendored
4
.github/workflows/build-macos-x86_64.yml
vendored
@@ -61,7 +61,7 @@ jobs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: downloads
|
||||
key: php-${{ inputs.version }}-dependencies
|
||||
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
||||
|
||||
# With or without debug
|
||||
- if: inputs.debug == true
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
|
||||
# If there's no dependencies cache, fetch sources, with or without debug
|
||||
- if: steps.cache-download.outputs.cache-hit != 'true'
|
||||
run: ./bin/spc download --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }}
|
||||
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
|
||||
|
||||
# Run build command
|
||||
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
|
||||
|
||||
2
.github/workflows/release-build.yml
vendored
2
.github/workflows/release-build.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
- name: Reuse static-php-cli-hosted artifacts
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
with:
|
||||
repo: crazywhalecc/static-php-cli-hosted
|
||||
repo: static-php/static-php-cli-hosted
|
||||
branch: master
|
||||
workflow: build-spc-release.yml
|
||||
name: "spc-${{ matrix.operating-system }}"
|
||||
|
||||
11
README-zh.md
11
README-zh.md
@@ -12,13 +12,12 @@ Build single static PHP binary, with PHP project together, with popular extensio
|
||||
|
||||
<img width="600" alt="截屏2023-05-02 15 52 33" src="https://user-images.githubusercontent.com/20330940/235610318-2ef4e3f1-278b-4ca4-99f4-b38120efc395.png">
|
||||
|
||||
> 该 SAPI 源自 [dixyes/phpmicro](https://github.com/dixyes/phpmicro) 的 [Fork 仓库](https://github.com/crazywhalecc/phpmicro)。
|
||||
> 该 SAPI 源自 [dixyes/phpmicro](https://github.com/dixyes/phpmicro) 的 [Fork 仓库](https://github.com/static-php/phpmicro)。
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/build.yml)
|
||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/build.yml)
|
||||
[]()
|
||||
[](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml)
|
||||
[]()
|
||||
[]()
|
||||
|
||||
> 项目名称是 static-php-cli,但其实支持 cli、fpm、micro 和 embed SAPI 😎
|
||||
@@ -232,7 +231,7 @@ bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=sys
|
||||
|
||||
另外,添加新扩展的贡献方式,可以参考下方 `进阶`。
|
||||
|
||||
如果你想贡献文档内容,请到项目仓库 [crazywhalecc/static-php-cli-docs](https://github.com/crazywhalecc/static-php-cli-docs) 贡献。
|
||||
如果你想贡献文档内容,请到项目仓库 [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs) 贡献。
|
||||
|
||||
## 赞助本项目
|
||||
|
||||
|
||||
17
README.md
17
README.md
@@ -14,24 +14,24 @@ You can also use the micro binary file to combine php binary and php source code
|
||||
|
||||
<img width="600" alt="2023-05-02 15 52 33" src="https://user-images.githubusercontent.com/20330940/235610318-2ef4e3f1-278b-4ca4-99f4-b38120efc395.png">
|
||||
|
||||
> This SAPI feature is from the [Fork](https://github.com/crazywhalecc/phpmicro) of [dixyes/phpmicro](https://github.com/dixyes/phpmicro).
|
||||
> This SAPI feature is from the [Fork](https://github.com/static-php/phpmicro) of [dixyes/phpmicro](https://github.com/dixyes/phpmicro).
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/build.yml)
|
||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/build.yml)
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
|
||||
## Docs
|
||||
|
||||
The current README contains basic usage. For all the features of static-php-cli,
|
||||
see <https://static-php.dev>.
|
||||
see <https://static-php.dev> .
|
||||
|
||||
## Direct Download
|
||||
|
||||
If you don't want to compile yourself, you can download example pre-compiled artifact from Actions, or from self-hosted server: [Here](https://dl.static-php.dev/static-php-cli/common/)
|
||||
If you don't want to compile yourself, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml), or from [self-hosted server](https://dl.static-php.dev/static-php-cli/common/).
|
||||
|
||||
> self-hosted server contains extensions: `bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip`
|
||||
|
||||
@@ -197,7 +197,7 @@ cd buildroot/bin/
|
||||
|
||||
> phpmicro is a SelF-extracted eXecutable SAPI module,
|
||||
> provided by [phpmicro](https://github.com/dixyes/phpmicro) project.
|
||||
> But this project is using a [fork](https://github.com/crazywhalecc/phpmicro) of phpmicro, because we need to add some features to it.
|
||||
> But this project is using a [fork](https://github.com/static-php/phpmicro) of phpmicro, because we need to add some features to it.
|
||||
> It can put php runtime and your source code together.
|
||||
|
||||
When using the parameter `--build-all` or `--build-micro`,
|
||||
@@ -257,13 +257,14 @@ For an advanced example of how to use this feature, take a look at [how to use i
|
||||
If the extension you need is missing, you can create an issue.
|
||||
If you are familiar with this project, you are also welcome to initiate a pull request.
|
||||
|
||||
If you want to contribute document content, please go to [crazywhalecc/static-php-cli-docs](https://github.com/crazywhalecc/static-php-cli-docs).
|
||||
If you want to contribute documentation, please go to [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs).
|
||||
|
||||
Now there is a [static-php](https://github.com/static-php) organization, which is used to store the repo related to the project.
|
||||
|
||||
Part of the English document is written by me, and part is translated by Google,
|
||||
and there may be inaccurate descriptions, strange or offensive expressions.
|
||||
If you are a native English speaker, some corrections to the documentation are welcome.
|
||||
|
||||
|
||||
## Sponsor this project
|
||||
|
||||
You can sponsor my project on [this page](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md).
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
"iconv": {
|
||||
"type": "builtin",
|
||||
"arg-type": "with-prefix",
|
||||
"lib-depends-windows": [
|
||||
"lib-depends": [
|
||||
"libiconv"
|
||||
]
|
||||
},
|
||||
@@ -132,12 +132,12 @@
|
||||
},
|
||||
"imap": {
|
||||
"type": "builtin",
|
||||
"arg-type": "with",
|
||||
"arg-type": "custom",
|
||||
"lib-depends": [
|
||||
"imap"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"kerberos"
|
||||
"openssl"
|
||||
]
|
||||
},
|
||||
"inotify": {
|
||||
@@ -169,14 +169,14 @@
|
||||
"arg-type": "custom",
|
||||
"ext-depends": [
|
||||
"mbstring"
|
||||
],
|
||||
"lib-depends": [
|
||||
"onig"
|
||||
]
|
||||
},
|
||||
"mbstring": {
|
||||
"type": "builtin",
|
||||
"arg-type": "custom",
|
||||
"lib-depends": [
|
||||
"onig"
|
||||
]
|
||||
"arg-type": "custom"
|
||||
},
|
||||
"memcache": {
|
||||
"type": "external",
|
||||
@@ -234,7 +234,8 @@
|
||||
"type": "builtin",
|
||||
"arg-type": "custom",
|
||||
"lib-depends": [
|
||||
"openssl"
|
||||
"openssl",
|
||||
"zlib"
|
||||
],
|
||||
"ext-depends": [
|
||||
"zlib"
|
||||
|
||||
@@ -141,6 +141,15 @@
|
||||
"libxml2"
|
||||
]
|
||||
},
|
||||
"imap": {
|
||||
"source": "imap",
|
||||
"static-libs-unix": [
|
||||
"libc-client.a"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"openssl"
|
||||
]
|
||||
},
|
||||
"ldap": {
|
||||
"source": "ldap",
|
||||
"static-libs-unix": [
|
||||
@@ -302,8 +311,7 @@
|
||||
],
|
||||
"lib-suggests-windows": [
|
||||
"icu",
|
||||
"xz",
|
||||
"pthreads4w"
|
||||
"xz"
|
||||
]
|
||||
},
|
||||
"libxslt": {
|
||||
@@ -441,18 +449,6 @@
|
||||
"zstd"
|
||||
]
|
||||
},
|
||||
"pthreads4w": {
|
||||
"source": "pthreads4w",
|
||||
"static-libs-windows": [
|
||||
"libpthreadVC3.lib"
|
||||
],
|
||||
"headers-windows": [
|
||||
"_ptw32.h",
|
||||
"pthread.h",
|
||||
"sched.h",
|
||||
"semaphore.h"
|
||||
]
|
||||
},
|
||||
"readline": {
|
||||
"source": "readline",
|
||||
"static-libs-unix": [
|
||||
|
||||
@@ -111,9 +111,8 @@
|
||||
}
|
||||
},
|
||||
"freetype": {
|
||||
"type": "filelist",
|
||||
"url": "https://download-mirror.savannah.gnu.org/releases/freetype/",
|
||||
"regex": "/href=\"(?<file>freetype-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||
"type": "url",
|
||||
"url": "https://github.com/freetype/freetype/archive/refs/tags/VER-2-13-2.tar.gz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE.TXT"
|
||||
@@ -144,6 +143,15 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"imap": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/static-php/imap.git",
|
||||
"rev": "master",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"inotify": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/inotify",
|
||||
@@ -216,7 +224,7 @@
|
||||
},
|
||||
"libmemcached": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/crazywhalecc/libmemcached-macos.git",
|
||||
"url": "https://github.com/static-php/libmemcached-macos.git",
|
||||
"rev": "master",
|
||||
"license": {
|
||||
"type": "file",
|
||||
@@ -225,7 +233,7 @@
|
||||
},
|
||||
"libpng": {
|
||||
"type": "git",
|
||||
"url": "https://git.code.sf.net/p/libpng/code",
|
||||
"url": "https://github.com/glennrp/libpng.git",
|
||||
"rev": "libpng16",
|
||||
"license": {
|
||||
"type": "file",
|
||||
@@ -314,7 +322,7 @@
|
||||
"type": "git",
|
||||
"path": "php-src/sapi/micro",
|
||||
"rev": "master",
|
||||
"url": "https://github.com/crazywhalecc/phpmicro",
|
||||
"url": "https://github.com/static-php/phpmicro",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -393,15 +401,6 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"pthreads4w": {
|
||||
"type": "git",
|
||||
"rev": "master",
|
||||
"url": "https://git.code.sf.net/p/pthreads4w/code",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"readline": {
|
||||
"type": "filelist",
|
||||
"url": "https://ftp.gnu.org/pub/gnu/readline/",
|
||||
|
||||
@@ -69,7 +69,7 @@ abstract class BuilderBase
|
||||
foreach ($libraries as $library) {
|
||||
// if some libs are not supported (but in config "lib.json", throw exception)
|
||||
if (!isset($support_lib_list[$library])) {
|
||||
throw new RuntimeException('library [' . $library . '] is in the lib.json list but not supported to compile, but in the future I will support it!');
|
||||
throw new WrongUsageException('library [' . $library . '] is in the lib.json list but not supported to compile, but in the future I will support it!');
|
||||
}
|
||||
$lib = new ($support_lib_list[$library])($this);
|
||||
$this->addLib($lib);
|
||||
|
||||
@@ -163,6 +163,35 @@ class Extension
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run compile check if build target is cli
|
||||
* If you need to run some check, overwrite this or add your assert in src/globals/tests/{extension_name}.php
|
||||
* If check failed, throw RuntimeException
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function runCliCheck(): void
|
||||
{
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "' . $this->getDistName() . '"', false);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
}
|
||||
|
||||
if (file_exists(ROOT_DIR . '/src/globals/tests/' . $this->getName() . '.php')) {
|
||||
// Trim additional content & escape special characters to allow inline usage
|
||||
$test = str_replace(
|
||||
['<?php', 'declare(strict_types=1);', "\n", '"', '$'],
|
||||
['', '', '', '\"', '\$'],
|
||||
file_get_contents(ROOT_DIR . '/src/globals/tests/' . $this->getName() . '.php')
|
||||
);
|
||||
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "' . trim($test) . '"');
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
|
||||
@@ -17,10 +17,19 @@ class glfw extends Extension
|
||||
*/
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
if (file_exists(SOURCE_PATH . '/php-src/ext/glfw')) {
|
||||
return false;
|
||||
}
|
||||
FileSystem::copyDir(SOURCE_PATH . '/ext-glfw', SOURCE_PATH . '/php-src/ext/glfw');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function patchBeforeConfigure(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/configure', '-lglfw ', '-lglfw3 ');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(): string
|
||||
{
|
||||
return '--enable-glfw --with-glfw-dir=' . BUILD_ROOT_PATH;
|
||||
|
||||
28
src/SPC/builder/extension/imap.php
Normal file
28
src/SPC/builder/extension/imap.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('imap')]
|
||||
class imap extends Extension
|
||||
{
|
||||
/**
|
||||
* @throws WrongUsageException
|
||||
*/
|
||||
public function getUnixConfigureArg(): string
|
||||
{
|
||||
if ($this->builder->getOption('enable-zts')) {
|
||||
throw new WrongUsageException('ext-imap is not thread safe, do not build it with ZTS builds');
|
||||
}
|
||||
$arg = '--with-imap=' . BUILD_ROOT_PATH;
|
||||
if ($this->builder->getLib('openssl') !== null) {
|
||||
$arg .= ' --with-imap-ssl=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
}
|
||||
@@ -5,18 +5,25 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('mbregex')]
|
||||
class mbregex extends Extension
|
||||
{
|
||||
public function getDistName(): string
|
||||
{
|
||||
return 'mbstring';
|
||||
}
|
||||
|
||||
public function getConfigureArg(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* mbregex is not an extension, we need to overwrite the default check.
|
||||
*/
|
||||
public function runCliCheck(): void
|
||||
{
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "mbstring" | grep regex', false);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ class swoole extends Extension
|
||||
public function getUnixConfigureArg(): string
|
||||
{
|
||||
$arg = '--enable-swoole';
|
||||
$arg .= $this->builder->getExt('pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
|
||||
// pgsql hook is buggy for static php
|
||||
$arg .= ' --disable-swoole-pgsql';
|
||||
$arg .= $this->builder->getLib('openssl') ? ' --enable-openssl' : ' --disable-openssl --without-openssl';
|
||||
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
|
||||
// curl hook is buggy for static php
|
||||
$arg .= ' --disable-swoole-curl';
|
||||
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ' --disable-brotli';
|
||||
$arg .= $this->builder->getExt('curl') ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
|
||||
return $arg;
|
||||
}
|
||||
}
|
||||
|
||||
63
src/SPC/builder/linux/library/imap.php
Normal file
63
src/SPC/builder/linux/library/imap.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
class imap extends LinuxLibraryBase
|
||||
{
|
||||
public const NAME = 'imap';
|
||||
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
$cc = getenv('CC') ?: 'gcc';
|
||||
// FileSystem::replaceFileStr($this->source_dir . '/Makefile', '-DMAC_OSX_KLUDGE=1', '');
|
||||
FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', 'CC=cc', "CC={$cc}");
|
||||
/* FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', '-lcrypto -lz', '-lcrypto');
|
||||
FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', '-lcrypto', '-lcrypto -lz');
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/src/osdep/unix/ssl_unix.c',
|
||||
"#include <x509v3.h>\n#include <ssl.h>",
|
||||
"#include <ssl.h>\n#include <x509v3.h>"
|
||||
);
|
||||
// SourcePatcher::patchFile('1006_openssl1.1_autoverify.patch', $this->source_dir);
|
||||
SourcePatcher::patchFile('2014_openssl1.1.1_sni.patch', $this->source_dir); */
|
||||
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'SSLINCLUDE=/usr/include/openssl', 'SSLINCLUDE=' . BUILD_INCLUDE_PATH);
|
||||
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'SSLLIB=/usr/lib', 'SSLLIB=' . BUILD_LIB_PATH);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
if ($this->builder->getLib('openssl')) {
|
||||
$ssl_options = 'SPECIALAUTHENTICATORS=ssl SSLTYPE=unix.nopwd SSLINCLUDE=' . BUILD_INCLUDE_PATH . ' SSLLIB=' . BUILD_LIB_PATH;
|
||||
} else {
|
||||
$ssl_options = 'SSLTYPE=none';
|
||||
}
|
||||
shell()->cd($this->source_dir)
|
||||
->exec('make clean')
|
||||
->exec('touch ip6')
|
||||
->exec(
|
||||
"yes | make slx {$ssl_options}"
|
||||
);
|
||||
try {
|
||||
shell()
|
||||
->exec("cp -rf {$this->source_dir}/c-client/c-client.a " . BUILD_LIB_PATH . '/libc-client.a')
|
||||
->exec("cp -rf {$this->source_dir}/c-client/*.c " . BUILD_LIB_PATH . '/')
|
||||
->exec("cp -rf {$this->source_dir}/c-client/*.h " . BUILD_INCLUDE_PATH . '/')
|
||||
->exec("cp -rf {$this->source_dir}/src/osdep/unix/*.h " . BUILD_INCLUDE_PATH . '/');
|
||||
} catch (\Throwable) {
|
||||
// last command throws an exception, no idea why since it works
|
||||
}
|
||||
}
|
||||
}
|
||||
66
src/SPC/builder/macos/library/imap.php
Normal file
66
src/SPC/builder/macos/library/imap.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\store\SourcePatcher;
|
||||
|
||||
class imap extends MacOSLibraryBase
|
||||
{
|
||||
public const NAME = 'imap';
|
||||
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
$cc = getenv('CC') ?: 'clang';
|
||||
SourcePatcher::patchFile('0001_imap_macos.patch', $this->source_dir);
|
||||
// FileSystem::replaceFileStr($this->source_dir . '/Makefile', '-DMAC_OSX_KLUDGE=1', '');
|
||||
FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', 'CC=cc', "CC={$cc}");
|
||||
/* FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', '-lcrypto -lz', '-lcrypto');
|
||||
FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', '-lcrypto', '-lcrypto -lz');
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/src/osdep/unix/ssl_unix.c',
|
||||
"#include <x509v3.h>\n#include <ssl.h>",
|
||||
"#include <ssl.h>\n#include <x509v3.h>"
|
||||
);
|
||||
// SourcePatcher::patchFile('1006_openssl1.1_autoverify.patch', $this->source_dir);
|
||||
SourcePatcher::patchFile('2014_openssl1.1.1_sni.patch', $this->source_dir); */
|
||||
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'SSLINCLUDE=/usr/include/openssl', 'SSLINCLUDE=' . BUILD_INCLUDE_PATH);
|
||||
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'SSLLIB=/usr/lib', 'SSLLIB=' . BUILD_LIB_PATH);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
if ($this->builder->getLib('openssl')) {
|
||||
$ssl_options = 'SPECIALAUTHENTICATORS=ssl SSLTYPE=unix.nopwd SSLINCLUDE=' . BUILD_INCLUDE_PATH . ' SSLLIB=' . BUILD_LIB_PATH;
|
||||
} else {
|
||||
$ssl_options = 'SSLTYPE=none';
|
||||
}
|
||||
shell()->cd($this->source_dir)
|
||||
->exec('make clean')
|
||||
->exec('touch ip6')
|
||||
->exec(
|
||||
"yes | EXTRACFLAGS='-Wimplicit-function-declaration -include $(xcrun --show-sdk-path)/usr/include/poll.h -include $(xcrun --show-sdk-path)/usr/include/time.h -include $(xcrun --show-sdk-path)/usr/include/utime.h' make osx {$ssl_options}"
|
||||
);
|
||||
try {
|
||||
shell()
|
||||
->exec("cp -rf {$this->source_dir}/c-client/c-client.a " . BUILD_LIB_PATH . '/libc-client.a')
|
||||
->exec("cp -rf {$this->source_dir}/c-client/*.c " . BUILD_LIB_PATH . '/')
|
||||
->exec("cp -rf {$this->source_dir}/c-client/*.h " . BUILD_INCLUDE_PATH . '/')
|
||||
->exec("cp -rf {$this->source_dir}/src/osdep/unix/*.h " . BUILD_INCLUDE_PATH . '/');
|
||||
} catch (\Throwable) {
|
||||
// last command throws an exception, no idea why since it works
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,24 +66,7 @@ trait UnixBuilderTrait
|
||||
|
||||
foreach ($this->exts as $ext) {
|
||||
logger()->debug('testing ext: ' . $ext->getName());
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "' . $ext->getDistName() . '"', false);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $ext->getName() . ' failed compile check');
|
||||
}
|
||||
|
||||
if (file_exists(ROOT_DIR . '/src/globals/tests/' . $ext->getName() . '.php')) {
|
||||
// Trim additional content & escape special characters to allow inline usage
|
||||
$test = str_replace(
|
||||
['<?php', 'declare(strict_types=1);', "\n", '"', '$'],
|
||||
['', '', '', '\"', '\$'],
|
||||
file_get_contents(ROOT_DIR . '/src/globals/tests/' . $ext->getName() . '.php')
|
||||
);
|
||||
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "' . trim($test) . '"');
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $ext->getName() . ' failed sanity check');
|
||||
}
|
||||
}
|
||||
$ext->runCliCheck();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ trait postgresql
|
||||
$optional_packages = [
|
||||
'zstd' => 'libzstd',
|
||||
'ldap' => 'ldap',
|
||||
'libpam' => 'libpam',
|
||||
'libxslt' => 'libxslt',
|
||||
'icu' => 'icu-i18n',
|
||||
];
|
||||
@@ -74,12 +73,12 @@ trait postgresql
|
||||
'--with-libxml ' .
|
||||
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
|
||||
($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
|
||||
($this->builder->getLib('libpam') ? '--with-pam ' : '--without-pam ') .
|
||||
($this->builder->getLib('libxslt') ? '--with-libxslt ' : '--without-libxslt ') .
|
||||
($this->builder->getLib('zstd') ? '--with-zstd ' : '--without-zstd ') .
|
||||
'--without-lz4 ' .
|
||||
'--without-perl ' .
|
||||
'--without-python ' .
|
||||
'--without-pam ' .
|
||||
'--without-bonjour ' .
|
||||
'--without-tcl '
|
||||
);
|
||||
|
||||
@@ -12,6 +12,7 @@ use SPC\store\Config;
|
||||
use SPC\util\DependencyUtil;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
use function Laravel\Prompts\table;
|
||||
@@ -22,6 +23,13 @@ class AllExtCommand extends BaseCommand
|
||||
public function configure(): void
|
||||
{
|
||||
$this->addArgument('extensions', InputArgument::OPTIONAL, 'List of extensions that will be displayed, comma separated');
|
||||
$this->addOption(
|
||||
'columns',
|
||||
null,
|
||||
InputOption::VALUE_REQUIRED,
|
||||
'List of columns that will be displayed, comma separated (lib-depends, lib-suggests, ext-depends, ext-suggests, unix-only)',
|
||||
'lib-depends,lib-suggests,ext-depends,ext-suggests,unix-only'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,6 +40,16 @@ class AllExtCommand extends BaseCommand
|
||||
public function handle(): int
|
||||
{
|
||||
$extensions = array_map('trim', array_filter(explode(',', $this->getArgument('extensions') ?? '')));
|
||||
$columns = array_map('trim', array_filter(explode(',', $this->getOption('columns'))));
|
||||
|
||||
foreach ($columns as $column) {
|
||||
if (!in_array($column, ['lib-depends', 'lib-suggests', 'ext-depends', 'ext-suggests', 'unix-only', 'type'])) {
|
||||
$this->output->writeln('<error>Column name [' . $column . '] is not valid.</error>');
|
||||
$this->output->writeln('<error>Available column name: lib-depends, lib-suggests, ext-depends, ext-suggests, unix-only, type</error>');
|
||||
return static::FAILURE;
|
||||
}
|
||||
}
|
||||
array_unshift($columns, 'name');
|
||||
|
||||
$style = new SymfonyStyle($this->input, $this->output);
|
||||
$style->writeln($extensions ? 'Available extensions:' : 'Extensions:');
|
||||
@@ -51,23 +69,26 @@ class AllExtCommand extends BaseCommand
|
||||
$lib_suggests = Config::getExt($extension, 'lib-suggests', []);
|
||||
$ext_suggests = Config::getExt($extension, 'ext-suggests', []);
|
||||
|
||||
$data[] = [
|
||||
$extension,
|
||||
implode(', ', $libraries),
|
||||
implode(', ', $lib_suggests),
|
||||
implode(',', $not_included),
|
||||
implode(', ', $ext_suggests),
|
||||
Config::getExt($extension, 'unix-only', false) ? 'true' : 'false',
|
||||
];
|
||||
$row = [];
|
||||
foreach ($columns as $column) {
|
||||
$row[] = match ($column) {
|
||||
'name' => $extension,
|
||||
'type' => Config::getExt($extension, 'type'),
|
||||
'lib-depends' => implode(', ', $libraries),
|
||||
'lib-suggests' => implode(', ', $lib_suggests),
|
||||
'ext-depends' => implode(',', $not_included),
|
||||
'ext-suggests' => implode(', ', $ext_suggests),
|
||||
'unix-only' => Config::getExt($extension, 'unix-only', false) ? 'true' : 'false',
|
||||
default => '',
|
||||
};
|
||||
}
|
||||
$data[] = $row;
|
||||
}
|
||||
|
||||
if ($data === []) {
|
||||
$style->warning('Unknown extension selected: ' . implode(',', $extensions));
|
||||
} else {
|
||||
table(
|
||||
['Extension', 'lib-depends', 'lib-suggests', 'ext-depends', 'ext-suggests', 'unix-only'],
|
||||
$data
|
||||
);
|
||||
table($columns, $data);
|
||||
}
|
||||
|
||||
return static::SUCCESS;
|
||||
|
||||
@@ -36,7 +36,7 @@ class LinuxToolCheckList
|
||||
'git', 'autoconf', 'automake',
|
||||
'tar', 'unzip', 'gzip', 'gcc',
|
||||
'bzip2', 'cmake', 'patch',
|
||||
'xz', 'wget', // to get musl
|
||||
'xz',
|
||||
];
|
||||
|
||||
/** @noinspection PhpUnused */
|
||||
@@ -47,8 +47,7 @@ class LinuxToolCheckList
|
||||
|
||||
$required = match ($distro['dist']) {
|
||||
'alpine' => self::TOOLS_ALPINE,
|
||||
'almalinux' => self::TOOLS_RHEL,
|
||||
'rhel' => self::TOOLS_RHEL,
|
||||
'redhat' => self::TOOLS_RHEL,
|
||||
default => self::TOOLS_DEBIAN,
|
||||
};
|
||||
$missing = [];
|
||||
@@ -61,8 +60,7 @@ class LinuxToolCheckList
|
||||
return match ($distro['dist']) {
|
||||
'ubuntu',
|
||||
'alpine',
|
||||
'rhel',
|
||||
'almalinux',
|
||||
'redhat',
|
||||
'debian' => CheckResult::fail(implode(', ', $missing) . ' not installed on your system', 'install-linux-tools', [$distro, $missing]),
|
||||
default => CheckResult::fail(implode(', ', $missing) . ' not installed on your system'),
|
||||
};
|
||||
@@ -74,11 +72,10 @@ class LinuxToolCheckList
|
||||
#[AsCheckItem('if necessary packages are installed', limit_os: 'Linux')]
|
||||
public function checkSystemOSPackages(): ?CheckResult
|
||||
{
|
||||
$distro = SystemUtil::getOSRelease();
|
||||
if ($distro['dist'] === 'alpine') {
|
||||
if (SystemUtil::isMuslDist()) {
|
||||
// check linux-headers installation
|
||||
if (!file_exists('/usr/include/linux/mman.h')) {
|
||||
return CheckResult::fail('linux-headers not installed on your system', 'install-linux-tools', [$distro, ['linux-headers']]);
|
||||
return CheckResult::fail('linux-headers not installed on your system', 'install-linux-tools', [SystemUtil::getOSRelease(), ['linux-headers']]);
|
||||
}
|
||||
}
|
||||
return CheckResult::ok();
|
||||
@@ -94,8 +91,7 @@ class LinuxToolCheckList
|
||||
$install_cmd = match ($distro['dist']) {
|
||||
'ubuntu', 'debian' => 'apt-get install -y',
|
||||
'alpine' => 'apk add',
|
||||
'rhel' => 'dnf install -y',
|
||||
'almalinux' => 'dnf install -y',
|
||||
'redhat' => 'dnf install -y',
|
||||
default => throw new RuntimeException('Current linux distro does not have an auto-install script for musl packages yet.'),
|
||||
};
|
||||
$prefix = '';
|
||||
@@ -104,8 +100,8 @@ class LinuxToolCheckList
|
||||
logger()->warning('Current user is not root, using sudo for running command');
|
||||
}
|
||||
try {
|
||||
$is_rhel = in_array($distro['dist'], ['rhel', 'almalinux']);
|
||||
$to_install = $is_rhel ? $missing : str_replace('xz', 'xz-utils', $missing);
|
||||
$is_debian = in_array($distro['dist'], ['debian', 'ubuntu']);
|
||||
$to_install = $is_debian ? str_replace('xz', 'xz-utils', $missing) : $missing;
|
||||
shell(true)->exec($prefix . $install_cmd . ' ' . implode(' ', $to_install));
|
||||
} catch (RuntimeException) {
|
||||
return false;
|
||||
|
||||
220
src/globals/patch/0001_imap_macos.patch
Normal file
220
src/globals/patch/0001_imap_macos.patch
Normal file
@@ -0,0 +1,220 @@
|
||||
From 5ab3bd7fa858eec0626a9dd0117ca3b050ef4660 Mon Sep 17 00:00:00 2001
|
||||
From: crazywhalecc <jesse2061@outlook.com>
|
||||
Date: Mon, 13 Nov 2023 00:00:52 +0800
|
||||
Subject: [PATCH] make macOS static compile happy
|
||||
|
||||
---
|
||||
src/c-client/netmsg.c | 1 +
|
||||
src/c-client/nntp.c | 1 +
|
||||
src/osdep/amiga/dummy.c | 1 +
|
||||
src/osdep/amiga/mbx.c | 1 +
|
||||
src/osdep/amiga/mh.c | 1 +
|
||||
src/osdep/amiga/mtx.c | 1 +
|
||||
src/osdep/amiga/unix.c | 1 +
|
||||
src/osdep/unix/dummy.c | 1 +
|
||||
src/osdep/unix/mbx.c | 1 +
|
||||
src/osdep/unix/mh.c | 1 +
|
||||
src/osdep/unix/mmdf.c | 1 +
|
||||
src/osdep/unix/mtx.c | 1 +
|
||||
src/osdep/unix/mx.c | 1 +
|
||||
src/osdep/unix/tcp_unix.c | 1 +
|
||||
src/osdep/unix/tenex.c | 2 ++
|
||||
src/osdep/unix/unix.c | 1 +
|
||||
16 files changed, 17 insertions(+)
|
||||
|
||||
diff --git a/src/c-client/netmsg.c b/src/c-client/netmsg.c
|
||||
index 187e4eb..f316d0b 100644
|
||||
--- a/src/c-client/netmsg.c
|
||||
+++ b/src/c-client/netmsg.c
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
+#include <time.h>
|
||||
extern int errno; /* just in case */
|
||||
#include "c-client.h"
|
||||
#include "netmsg.h"
|
||||
diff --git a/src/c-client/nntp.c b/src/c-client/nntp.c
|
||||
index fe90edb..b2f7536 100644
|
||||
--- a/src/c-client/nntp.c
|
||||
+++ b/src/c-client/nntp.c
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
+#include <time.h>
|
||||
#include "c-client.h"
|
||||
#include "newsrc.h"
|
||||
#include "netmsg.h"
|
||||
diff --git a/src/osdep/amiga/dummy.c b/src/osdep/amiga/dummy.c
|
||||
index b003a0b..2c65824 100644
|
||||
--- a/src/osdep/amiga/dummy.c
|
||||
+++ b/src/osdep/amiga/dummy.c
|
||||
@@ -35,6 +35,7 @@ extern int errno; /* just in case */
|
||||
#include "osdep.h"
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <time.h>
|
||||
#include "dummy.h"
|
||||
#include "misc.h"
|
||||
|
||||
diff --git a/src/osdep/amiga/mbx.c b/src/osdep/amiga/mbx.c
|
||||
index 1ece5d8..2495965 100644
|
||||
--- a/src/osdep/amiga/mbx.c
|
||||
+++ b/src/osdep/amiga/mbx.c
|
||||
@@ -43,6 +43,7 @@ extern int errno; /* just in case */
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
+#include <utime.h>
|
||||
#include "misc.h"
|
||||
#include "dummy.h"
|
||||
#include "fdstring.h"
|
||||
diff --git a/src/osdep/amiga/mh.c b/src/osdep/amiga/mh.c
|
||||
index 0226b7a..e7c907a 100644
|
||||
--- a/src/osdep/amiga/mh.c
|
||||
+++ b/src/osdep/amiga/mh.c
|
||||
@@ -36,6 +36,7 @@ extern int errno; /* just in case */
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
+#include <utime.h>
|
||||
#include "misc.h"
|
||||
#include "dummy.h"
|
||||
#include "fdstring.h"
|
||||
diff --git a/src/osdep/amiga/mtx.c b/src/osdep/amiga/mtx.c
|
||||
index 8e6f76e..ca7b368 100644
|
||||
--- a/src/osdep/amiga/mtx.c
|
||||
+++ b/src/osdep/amiga/mtx.c
|
||||
@@ -43,6 +43,7 @@ extern int errno; /* just in case */
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
+#include <utime.h>
|
||||
#include "misc.h"
|
||||
#include "dummy.h"
|
||||
#include "fdstring.h"
|
||||
diff --git a/src/osdep/amiga/unix.c b/src/osdep/amiga/unix.c
|
||||
index be3c437..c755fe7 100644
|
||||
--- a/src/osdep/amiga/unix.c
|
||||
+++ b/src/osdep/amiga/unix.c
|
||||
@@ -46,6 +46,7 @@ extern int errno; /* just in case */
|
||||
#include "osdep.h"
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <utime.h>
|
||||
#include "unix.h"
|
||||
#include "pseudo.h"
|
||||
#include "fdstring.h"
|
||||
diff --git a/src/osdep/unix/dummy.c b/src/osdep/unix/dummy.c
|
||||
index b003a0b..2c65824 100644
|
||||
--- a/src/osdep/unix/dummy.c
|
||||
+++ b/src/osdep/unix/dummy.c
|
||||
@@ -35,6 +35,7 @@ extern int errno; /* just in case */
|
||||
#include "osdep.h"
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <time.h>
|
||||
#include "dummy.h"
|
||||
#include "misc.h"
|
||||
|
||||
diff --git a/src/osdep/unix/mbx.c b/src/osdep/unix/mbx.c
|
||||
index 1ece5d8..2495965 100644
|
||||
--- a/src/osdep/unix/mbx.c
|
||||
+++ b/src/osdep/unix/mbx.c
|
||||
@@ -43,6 +43,7 @@ extern int errno; /* just in case */
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
+#include <utime.h>
|
||||
#include "misc.h"
|
||||
#include "dummy.h"
|
||||
#include "fdstring.h"
|
||||
diff --git a/src/osdep/unix/mh.c b/src/osdep/unix/mh.c
|
||||
index 0226b7a..e7c907a 100644
|
||||
--- a/src/osdep/unix/mh.c
|
||||
+++ b/src/osdep/unix/mh.c
|
||||
@@ -36,6 +36,7 @@ extern int errno; /* just in case */
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
+#include <utime.h>
|
||||
#include "misc.h"
|
||||
#include "dummy.h"
|
||||
#include "fdstring.h"
|
||||
diff --git a/src/osdep/unix/mmdf.c b/src/osdep/unix/mmdf.c
|
||||
index e962434..8cc9fae 100644
|
||||
--- a/src/osdep/unix/mmdf.c
|
||||
+++ b/src/osdep/unix/mmdf.c
|
||||
@@ -34,6 +34,7 @@ extern int errno; /* just in case */
|
||||
#include "osdep.h"
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <utime.h>
|
||||
#include "pseudo.h"
|
||||
#include "fdstring.h"
|
||||
#include "misc.h"
|
||||
diff --git a/src/osdep/unix/mtx.c b/src/osdep/unix/mtx.c
|
||||
index 8e6f76e..ca7b368 100644
|
||||
--- a/src/osdep/unix/mtx.c
|
||||
+++ b/src/osdep/unix/mtx.c
|
||||
@@ -43,6 +43,7 @@ extern int errno; /* just in case */
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
+#include <utime.h>
|
||||
#include "misc.h"
|
||||
#include "dummy.h"
|
||||
#include "fdstring.h"
|
||||
diff --git a/src/osdep/unix/mx.c b/src/osdep/unix/mx.c
|
||||
index 4549527..9d444c9 100644
|
||||
--- a/src/osdep/unix/mx.c
|
||||
+++ b/src/osdep/unix/mx.c
|
||||
@@ -36,6 +36,7 @@ extern int errno; /* just in case */
|
||||
#include <pwd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
+#include <utime.h>
|
||||
#include "misc.h"
|
||||
#include "dummy.h"
|
||||
#include "fdstring.h"
|
||||
diff --git a/src/osdep/unix/tcp_unix.c b/src/osdep/unix/tcp_unix.c
|
||||
index 5bad706..5d6cd03 100644
|
||||
--- a/src/osdep/unix/tcp_unix.c
|
||||
+++ b/src/osdep/unix/tcp_unix.c
|
||||
@@ -27,6 +27,7 @@
|
||||
*/
|
||||
|
||||
#include "ip_unix.c"
|
||||
+#include <poll.h>
|
||||
|
||||
#undef write /* don't use redefined write() */
|
||||
|
||||
diff --git a/src/osdep/unix/tenex.c b/src/osdep/unix/tenex.c
|
||||
index eee61fb..61760f0 100644
|
||||
--- a/src/osdep/unix/tenex.c
|
||||
+++ b/src/osdep/unix/tenex.c
|
||||
@@ -46,6 +46,8 @@ extern int errno; /* just in case */
|
||||
#include "mail.h"
|
||||
#include "osdep.h"
|
||||
#include <sys/stat.h>
|
||||
+#include <time.h>
|
||||
+#include <utime.h>
|
||||
#include "misc.h"
|
||||
#include "dummy.h"
|
||||
|
||||
diff --git a/src/osdep/unix/unix.c b/src/osdep/unix/unix.c
|
||||
index be3c437..c755fe7 100644
|
||||
--- a/src/osdep/unix/unix.c
|
||||
+++ b/src/osdep/unix/unix.c
|
||||
@@ -46,6 +46,7 @@ extern int errno; /* just in case */
|
||||
#include "osdep.h"
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <utime.h>
|
||||
#include "unix.h"
|
||||
#include "pseudo.h"
|
||||
#include "fdstring.h"
|
||||
--
|
||||
2.39.3 (Apple Git-145)
|
||||
|
||||
Reference in New Issue
Block a user