问题描述
我正在尝试通过编译在Mac上安装rsync 3.2.3。但是,我想安装所有功能。为此,它需要一些库,此处(https://download.samba.org/pub/rsync/INSTALL)中没有解释如何安装和/或编译它们。
顺便说一句,当我“ ./prepare-source”时,我收到此消息:
make:conf不需要做任何事情。
这是对的吗
通过运行“ ./configure”,我会收到以下消息:
配置发现以下问题:
- 无法找到openssl / md4.h和openssl / md5.h来支持openssl加密库。
- 无法找到用于xxhash校验和支持的xxhash.h。
- 找不到用于zstd压缩支持的zstd.h。
- 找不到用于lz4压缩支持的lz4.h。
有关如何安装缺少的库和/或的提示,请参阅INSTALL文件。 如何生成(或获取)手册页: https://github.com/WayneD/rsync/blob/master/INSTALL.md
要禁用一个或多个功能,相关的配置选项为: --disable-openssl --disable-xxhash --disable-zstd --disable-lz4
因此,就像我之前说的,我想安装所有功能(ACL支持/ Xattr支持/ xxhash库/ zstd库)。
帮助非常丰富!
谢谢!
解决方法
首先,安装 Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
然后执行以下命令:
brew install xxhash; brew install zstd; brew install lz4; brew install openssl;
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib";
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include";
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc;
再次尝试执行: ./配置
更新 -- 2021 年 6 月 5 日
您可以尝试将以下脚本粘贴到终端并运行:
cd ~/Desktop;
curl -OL https://github.com/Cyan4973/xxHash/archive/v0.8.0.tar.gz;
tar -xvf v0.8.0.tar.gz;
cd xxHash-0.8.0;
make -j4;
sudo make install;
cd ~/Desktop;
curl -OL https://github.com/lz4/lz4/archive/v1.9.3.tar.gz;
tar -xvf v1.9.3.tar.gz;
cd lz4-1.9.3;
make -j4;
sudo make install;
cd ~/Desktop;
curl -OL https://www.openssl.org/source/openssl-1.1.1k.tar.gz;
tar -xvf openssl-1.1.1k.tar.gz;
cd openssl-1.1.1k ;
./config;
make -j4;
sudo make install;
cd ~/Desktop;
curl -OL https://github.com/facebook/zstd/archive/v1.5.0.tar.gz;
tar -xvf v1.5.0.tar.gz;
cd zstd-1.5.0 ;
make -j4;
sudo make install;
cd ~/Desktop;
curl -OL https://rsync.samba.org/ftp/rsync/src/rsync-3.2.3.tar.gz;
tar -xvf rsync-3.2.3.tar.gz;
cd rsync-3.2.3;
./configure;
make -j4;
sudo make install;
cd /usr/local/bin;
./rsync --version;
查找所有软件包源代码下载地址是一项繁琐的工作。如果您是“脚本纯粹主义者”,那么您确实可以做到这一点。但是我觉得Homebrew真的可以解放程序员的双手,摆脱“淹没在curl和printlog的海洋中”的噩梦。
我怎么知道每个包的下载地址? google了几天,最后还是要参考Homebrew的公式代码:
xxhash:https://formulae.brew.sh/formula/xxhash#default
lz4:https://formulae.brew.sh/formula/lz4#default
openssl1.1:https://formulae.brew.sh/formula/openssl@1.1#default