Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files

build: always link with -lz

Fix building with a shared zlib: ensure link with '-lz'.

Configuring for a shared zlib:

    LDFLAGS="-L/opt/local/lib -R/opt/local/lib" \
        ./configure --shared-zlib \
        --shared-zlib-includes=/opt/local/include \

and building would fail on SmartOS because the link would not include '-lz'.
This doesn't fail on Mac (at least in my setup) because you get lucky with the
openssl libs reported from the Homebrew pkg-config:

    $ pkg-config --libs openssl
    -lssl -lcrypto -lz

On SmartOS, the pkgsrc libs for openssl are:

    $ pkg-config --libs openssl
    -Wl,-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto -lsocket -lnsl -ldl

The patch has no adverse effect on the Mac build (by control case).
  • Loading branch information...
trentm authored and bnoordhuis committed Jun 16, 2012
1 parent eef57dd commit dd1c3d72e254f7879a00104847c68f7f2f66ed1b
Showing with 1 addition and 1 deletion.
  1. +1 −1 wscript
@@ -296,7 +296,7 @@ def configure(conf):
conf.env["USE_GDBJIT"] = o.use_gdbjit
conf.env['USE_NPM'] = not o.without_npm

if not conf.env["USE_SHARED_ZLIB"] and not sys.platform.startswith("win32"):
if not sys.platform.startswith("win32"):
conf.env.append_value("LINKFLAGS", "-lz")

conf.check(lib='dl', uselib_store='DL')

0 comments on commit dd1c3d7

Please sign in to comment.
You can’t perform that action at this time.