[zeromq-dev] Compile statically libzmq and czmq

Kerrigan29a kerrigan29a at hotmail.com
Wed Oct 16 02:03:08 CEST 2013

Could it be related with this?

In fact in this configure.ac I found the static library is searched explicitly:

# Optional shared linking with libfb
 AS_IF([test "x$with_shared_libfb" = xyes],
	AC_CHECK_LIB([fb], [libfb_init],
		     [AC_SUBST([LIBFB], ["-lfb"])
		     AC_DEFINE([HAVE_LIBFB], [1], [Define to 1 if you have libfb])
		     AC_MSG_FAILURE([test for libfb failed (required)])),
		     # otherwise, we need to link static libfb and also link in libnet and libpcap
	# Check for static libfb
	      AC_SUBST([LIBFB], ["/usr/local/lib/libfb.a"])
	      AC_DEFINE(HAVE_STATIC_LIBFB, 1, [Define to 1 if you have the static version of libfb in the right place.])
	      [AC_MSG_ERROR([Couldn't find static libfb libraries])])

I've not check it, but if the info in the first link is correct I guess that installing the libs in a "standard" path will fix this Autoconf problem.

Anyway. What I did was very simple:

``` $ diff -Naur configure.ac.old configure.ac

--- configure.ac.old	2013-10-16 01:55:34.000000000 +0200
+++ configure.ac	2013-10-16 01:59:11.000000000 +0200
@@ -83,14 +83,7 @@

-AC_CHECK_LIB(zmq, zmq_init, ,[AC_MSG_ERROR([cannot link with -lzmq, install libzmq.])])
-AC_MSG_CHECKING([whether libzmq installation works])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <zmq.h>],
-                                [zmq_init(1);])
-               ],
-               [AC_MSG_RESULT([yes])],
-               [AC_MSG_ERROR([no. Please specify libzmq installation prefix using --with-libzmq])])
+LIBS="-lzmq ${LIBS}"

 # Platform specific checks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131016/c24861d7/attachment.htm>

More information about the zeromq-dev mailing list