2

I'm trying to install OpenVPN on macOS High Sierra

I have cloned the github repo:

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

And switched to the latest stable branch:

git checkout origin release/2.4

But when I tried to build the project (following the INSTALL instructions):

autoreconf -i -v -f
./configure 

I had this error during the configure step:

configure: error: lzo enabled but missing

Even after installing lzo dependency with macos ports, the problem persists.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
freedev
  • 25,946
  • 8
  • 108
  • 125

3 Answers3

7

The answer to this problem was easier than I thought...

I had just to define the env vars CFLAGS and LDFLAGS before running configure script:

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

./configure
make
sudo make install

UPDATE

If you had to install lzo:

  • using brew: brew install lzo or brew link lzo in case it already exists
  • using port: sudo port install lzo
freedev
  • 25,946
  • 8
  • 108
  • 125
1

I use a M1 MacBook Pro so freedev's answer did not work. I had to instead include the library from inside the homebrew directories so my final configure command was:

./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"
Saifur Rahman Mohsin
  • 929
  • 1
  • 11
  • 37
1

The following resolved the issue for me:

sudo apt-get install libssl-dev liblzo2-dev libpam0g-dev

I got this fix from this askubuntu.com openvpn lzo enabled but missing question.

More details: I got each of the 3 error messages shown below separately. Each one was resolved, then I got the next. All 3 are resolved with the one command line above. Basically, 3 developer packages were missing.

  • configure: error: OpenSSL version too old (resolved with libssl-dev)
  • configure: error: lzo enabled but missing (resolved with liblzo2-dev)
  • configure: error: libpam required but missing (resolved with libpam0g-dev)

Thanks to all the other answers which helped to confirm things, triangulate to the answer I felt most confident about!

Ashley
  • 575
  • 5
  • 12