[zeromq-dev] Problem compiling czmq with separate include and lib dirs for zeromq

Pieter Hintjens ph at imatix.com
Wed Sep 11 16:00:51 CEST 2013

Hi Patrick,

Feel free to submit the patch as a pull request, and we'll merge it.


On Wed, Sep 11, 2013 at 3:59 PM, Patrick Noffke
<patrick.noffke at gmail.com> wrote:
> I am cross-compiling 0MQ and czmq (using gcc 4.8.0) for an embedded Linux
> target.  To keep the install size down, I install only the libraries in the
> root filesystem ($(ROOT_DIR) variable).  Headers, man pages, etc. go
> elsewhere ($(TOOL_DIR) variable).
> I configure 0MQ as follows (I'm omitting environment variables (CC, CPP,
> PATH, etc.) that I set), which works as expected:
> ./configure \
> --prefix=$(ROOT_DIR) \
> --includedir=$(TOOL_DIR)/include \
> --datarootdir=$(TOOL_DIR)
> But czmq only has a configure option for --with-libzmq, and the configure
> script expects to find both the headers and libraries in that directory.  I
> have patched configure.ac to support separate include and lib dirs (but if
> you specify --with-libzmq, it'll still work as before).  Then I can run
> configure as follows, and it sets the CFLAGS and LDFLAGS to the correct
> locations.
> ./configure \
> --prefix=$(ROOT_DIR) \
> --includedir=$(TOOL_DIR)/include \
> --datarootdir=$(TOOL_DIR) \
> --with-libzmq-include-dir=$(TOOL_DIR) \
> --with-libzmq-lib-dir=$(ROOT_DIR)
> My patch is attached.  Please let me know if I should submit a bug about
> this issue, or if I'm doing something wrong.
> Please also let me know if the patch has any issues.  Note that I removed
> the error if zmq.h was not found, relying on the code to error out later
> when trying to compile with zeromq.  There's probably a more standard way of
> doing this.
> Thanks,
> Patrick
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list