Update README.md

This commit is contained in:
coolsnowwolf 2022-03-28 20:18:40 +08:00 committed by GitHub
parent f56e4b855b
commit f575f2151f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,23 +79,31 @@ macOS 原生系统进行编译:
1.在 AppStore 中安装 Xcode
2. 安装 Homebrew
```bash
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
3. 使用 Homebrew 安装工具链、依赖与基础软件包:
```bash
brew unlink awk
brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep wget quilt xz
brew install gcc@11
```
4.然后输入以下命令,添加到系统环境变量中:
```bash
echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc
echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc
echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc
echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc
```
4.重新加载一下 shell 启动文件
```bash
source ~/.bashrc
```
然后就可以和 Linux 一样正常编译了