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

Attachment: czmq-separate-zmq-lib-include-dirs.patch
Description: Binary data

_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to