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

Patrick Noffke patrick.noffke at gmail.com
Wed Sep 11 15:59:01 CEST 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130911/3ed497c6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: czmq-separate-zmq-lib-include-dirs.patch
Type: application/octet-stream
Size: 1552 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130911/3ed497c6/attachment.obj>


More information about the zeromq-dev mailing list