Unable to install OpenVPN on macOS - configure: error: lzo enabled but missing

Unable to install OpenVPN on macOS - configure: error: lzo enabled but missing

我正在尝试在 macOS High Sierra 上安装 OpenVPN

我已经克隆了 github 存储库:

git clone https://github.com/OpenVPN/openvpn

并切换到最新的稳定分支:

git checkout origin release/2.4

但是当我尝试构建项目时(按照 INSTALL 说明):

autoreconf -i -v -f
./configure 

我在 configure 步骤中遇到了这个错误:

configure: error: lzo enabled but missing

即使安装 lzo 与 macos 端口的依赖关系,问题仍然存在。

这个问题的答案比我想象的要简单...

我只需要在 运行 configure 脚本之前定义环境变量 CFLAGSLDFLAGS:

export CFLAGS="-I/opt/local/include" 
export LDFLAGS="-L/opt/local/lib"

./configure
make
sudo make install

更新

如果你必须安装 lzo:

  • 使用 brew:brew install lzobrew link lzo 如果它已经存在
  • 使用端口:sudo port install lzo

我用的是 M1 MacBook Pro,所以 没用。我不得不从自制目录中包含库,所以我的最终配置命令是:

./configure LDFLAGS="-L/opt/homebrew/lib -L/opt/homebrew/opt/openssl@3/lib" CPPFLAGS="-I/opt/homebrew/include -I/opt/homebrew/opt/openssl@3/include"