Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos 、linux 构建步骤 #504

Open
jingjingxyk opened this issue Nov 16, 2023 · 5 comments
Open

macos 、linux 构建步骤 #504

jingjingxyk opened this issue Nov 16, 2023 · 5 comments

Comments

@jingjingxyk
Copy link
Contributor

macos 构建步骤:

git clone -b main https://github.com/swoole/swoole-cli.git
cd swoole-cli
git submodule update --init

bash setup-php-runtime.sh --mirror china

composer install

php prepare.php

# 查看可用的构建命令
bash make.sh -h


# 静态编译依赖库
bash make.sh  all-library

# 静态编译 PHP 预处理
bash make.sh config

# 静态编译PHP (编译、汇编、链接)
bash make.sh build

# 静态编译PHP (打包)
bash make.sh archive

要支持其它版本PHP ,使用 build_native_php 分支即可,步骤如上,关键点如下:

切换分支后,需要执行 bash sapi/quickstart/clean-folder.sh 执行清理工作

# 执行清理无用文件
bash sapi/quickstart/clean-folder.sh

php prepare.php --with-php-version=8.2.6

macos 环境配置:

macos 构建构建 文档: https://github.com/swoole/swoole-cli/blob/main/docs/macOS.md

构建选项: https://github.com/swoole/swoole-cli/blob/main/docs/options.md

为了省事,如下一条命令即可:

bash sapi/quickstart/macos/macos-init.sh --mirror china

一条命令执行整个构建流程:

build-release-example.sh

build-release-example.sh 定制构建选项

cp  -f build-release-example.sh  build-release.sh 

sh   build-release.sh  --mirror china 

@jingjingxyk
Copy link
Contributor Author

jingjingxyk commented Nov 16, 2023

linux 构建步骤:

默认在 alpine 容器中进行构建

git clone -b main https://github.com/swoole/swoole-cli.git
cd swoole-cli
git submodule update --init

bash setup-php-runtime.sh --mirror china

composer install

php prepare.php

# 构建容器
bash make.sh docker-build china

# 进入容器
bash make.sh docker-bash 

php prepare.php

# 查看可用的构建命令
bash make.sh -h


# 静态编译依赖库
bash make.sh  all-library

# 静态编译 PHP 预处理
bash make.sh config

# 静态编译PHP (编译、汇编、链接)
bash make.sh build

# 静态编译PHP (打包)
bash make.sh archive

要支持其它版本PHP ,使用 build_native_php 分支即可,步骤如上,关键点如下:

切换分支后,需要执行 bash sapi/quickstart/clean-folder.sh 执行清理工作

# 执行清理无用文件
bash sapi/quickstart/clean-folder.sh

php prepare.php --with-php-version=8.2.6

linux 环境配置:

linux 构建构建 文档:https://github.com/swoole/swoole-cli/blob/main/docs/linux.md

构建选项: https://github.com/swoole/swoole-cli/blob/main/docs/options.md

为了省事,跳过构建容器、构建依赖库,可以执行如下命令

bash sapi/quickstart/linux/run-alpine-container.sh 

bash sapi/quickstart/linux/connection-swoole-cli-alpine.sh

# 可跳过构建依赖库
# bash sapi/quickstart/linux/run-alpine-container-full.sh

bash sapi/quickstart/linux/alpine-init.sh --mirror china 

一条命令执行整个构建流程:

build-release-example.sh

build-release-example.sh 定制构建选项

cp  -f build-release-example.sh  build-release.sh 

sh   build-release.sh  --mirror china 

@jingjingxyk jingjingxyk pinned this issue Nov 16, 2023
@jingjingxyk
Copy link
Contributor Author

简易辅助构建工具: https://swoole-cli-ui.jingjingxyk.com/

@1808661305
Copy link

可以更新一个linux arm版本的swoole-cli吗?

@jingjingxyk
Copy link
Contributor Author

可以更新一个linux arm版本的swoole-cli吗?

可以的。

@1808661305
Copy link

1808661305 commented Jan 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants