Skip to main content
Tags
Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Source Link
secondman
  • 267
  • 1
  • 2
  • 6

Export Multiple LDFLAGS, CPPFLAGS, PKG_CONFIG_PATH in a zshrc File

In my .zshrc file I have existing exports for OpenSSL.

export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"

Now I have to compile packages that require the zlib library. How can I add these flags without overwriting the previous?

I tried chaining them on with a : like is done for path, but that didn't seem to work, when I run ./configure it reading them as a single flag.

ld: warning: directory not found for option '-L/usr/local/opt/[email protected]/lib:-L/usr/local/opt/zlib/lib'

Can someone please advise on how to do this correctly?