diff --git a/README.md b/README.md index 3bd5e7bc4..3801b32a4 100644 --- a/README.md +++ b/README.md @@ -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 一样正常编译了