Boost logo

Boost Users :

From: Bob (obsdml_at_[hidden])
Date: 2021-03-03 18:19:12


Hello Boost mailing list,

I am building a code project in my user home directory on OpenBSD, and
doing this involves both a local build of Boost and also a local build
of ZLib. I do the whole build using GCC.

This is a relatively ordinary build use case, however GCC on OpenBSD
(at least in its current version) has a peculiarity to it, which is
that it adds to LD the argument "-L/usr/lib" in the leading position,
and this means that LD's search for libz.so will find and use the
operating system's bundled ZLib binary which is /usr/lib/libz.so
ALWAYS, and NEVER use my local libz.so .

Can you help me understand if Boost can be customized to link to ZLib
in the following way:

I can force GCC/LD to use a particular libz.so file, by specifying it
by filename, e.g. "gcc ... libz.so ...", "gcc ... /my/dir/libz.so ...",
instead of by the conventional "-lz". Boost's build process is
hardwired to "-lz" and I ask you to help me understand if there is a
way to circumvent that.

ZLIB_LIBRARY_PATH will not make "-lz" hit anything else than
/usr/lib/libz.so , per the compiler's default -L/usr/lib in leading
position, so it will not be of help to solve my problem.

To my best awareness ZLIB_INCLUDE has nothing to do with linking, so it
will not be of help to solve my problem.

ZLIB_NAME would only be to customize the library name would it e.g. to
"-lmycustomz", or what is it for?

Please clarify so I could figure if it could be of help, though ideally
i keep my local ZLib having its default name "libz.so".

And this brings me to the path of solving the problem that I imagine
could work, but that I don't understand fully from the Boost
documentation:

There is the possibility to customize ZLib build settings through the
JAM configuration, that is user-config.jam . The syntax used is "using
zlib ...".

Can you please help me understand if this route works, if so how would
that "using zlib ..." statement look, such that Boost's build process
will NOT build ZLib itself, and then will NOT link to it via "-lz", but
will instead link to it by "$MYCUSTOMBUILDDIR/libz.so"?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net