From cbaa7cfa93893876e4fd8794b6ea39f4d245b6b5 Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Mon, 23 Jan 2012 08:53:45 +0100 Subject: Imported Upstream version 2.1.6 --- AUTHORS | 1 + ChangeLog | 472 ++++++++++++++++ Makefile.am | 1 - Makefile.in | 24 +- NEWS | 42 +- README | 3 +- acinclude.m4 | 374 ++++++------ aclocal.m4 | 158 ++++++ builds/msvc/Makefile.in | 9 +- builds/msvc/msvc.sln | 40 +- builds/redhat/zeromq.spec.in | 139 +++++ configure | 1217 +++++++++++++++++++++++++--------------- configure.in | 109 ++-- doc/Makefile.in | 9 +- doc/zmq.7 | 6 +- doc/zmq_bind.3 | 6 +- doc/zmq_close.3 | 6 +- doc/zmq_connect.3 | 6 +- doc/zmq_cpp.7 | 6 +- doc/zmq_device.3 | 6 +- doc/zmq_epgm.7 | 8 +- doc/zmq_epgm.html | 8 +- doc/zmq_epgm.txt | 5 + doc/zmq_errno.3 | 6 +- doc/zmq_getsockopt.3 | 6 +- doc/zmq_init.3 | 6 +- doc/zmq_inproc.7 | 6 +- doc/zmq_ipc.7 | 6 +- doc/zmq_msg_close.3 | 13 +- doc/zmq_msg_close.html | 15 +- doc/zmq_msg_close.txt | 3 +- doc/zmq_msg_copy.3 | 13 +- doc/zmq_msg_copy.html | 15 +- doc/zmq_msg_copy.txt | 3 +- doc/zmq_msg_data.3 | 6 +- doc/zmq_msg_init.3 | 6 +- doc/zmq_msg_init_data.3 | 22 +- doc/zmq_msg_init_data.html | 13 +- doc/zmq_msg_init_data.txt | 3 + doc/zmq_msg_init_size.3 | 6 +- doc/zmq_msg_move.3 | 13 +- doc/zmq_msg_move.html | 15 +- doc/zmq_msg_move.txt | 3 +- doc/zmq_msg_size.3 | 6 +- doc/zmq_pgm.7 | 8 +- doc/zmq_pgm.html | 8 +- doc/zmq_pgm.txt | 5 + doc/zmq_poll.3 | 6 +- doc/zmq_recv.3 | 11 +- doc/zmq_recv.html | 12 +- doc/zmq_recv.txt | 2 + doc/zmq_send.3 | 13 +- doc/zmq_send.html | 15 +- doc/zmq_send.txt | 6 + doc/zmq_setsockopt.3 | 6 +- doc/zmq_socket.3 | 13 +- doc/zmq_socket.html | 14 +- doc/zmq_socket.txt | 4 +- doc/zmq_strerror.3 | 6 +- doc/zmq_tcp.7 | 6 +- doc/zmq_term.3 | 6 +- doc/zmq_version.3 | 6 +- foreign/openpgm/Makefile.in | 9 +- include/zmq.h | 3 +- include/zmq.hpp | 2 +- perf/Makefile.am | 8 +- perf/Makefile.in | 42 +- perf/inproc_lat.cpp | 232 ++++++++ perf/inproc_thr.cpp | 246 ++++++++ src/Makefile.in | 9 +- src/fq.cpp | 7 +- src/req.cpp | 2 +- src/socket_base.cpp | 22 +- src/tcp_listener.cpp | 3 +- src/thread.cpp | 2 + src/xrep.cpp | 2 +- src/zmq.cpp | 40 +- tests/Makefile.in | 9 +- tests/test_pair_tcp.cpp | 2 +- tests/test_reqrep_tcp.cpp | 2 +- tests/test_shutdown_stress.cpp | 6 +- zeromq.spec | 6 +- 82 files changed, 2770 insertions(+), 871 deletions(-) create mode 100644 builds/redhat/zeromq.spec.in create mode 100644 perf/inproc_lat.cpp create mode 100644 perf/inproc_thr.cpp diff --git a/AUTHORS b/AUTHORS index b75ac86..3ca57ce 100644 --- a/AUTHORS +++ b/AUTHORS @@ -51,6 +51,7 @@ Pavol Malosek Peter Bourgon Pieter Hintjens Piotr Trojanek +Robert G. Jakabosky Sebastian Otaegui Steven McCoy Tamara Kustarova diff --git a/ChangeLog b/ChangeLog index 779b799..5a9a3e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,477 @@ # Generated by Makefile. Do not edit. +commit ee185e241ec2a3091b9200cd5615cfa4f66e7a07 +Author: Pieter Hintjens +Date: Tue Apr 26 19:45:25 2011 +0200 + + Set version number for 2.1.6 + + include/zmq.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit d23534614452c954e7f64052ef232fd176e8897c +Author: Pieter Hintjens +Date: Tue Apr 26 19:44:36 2011 +0200 + + Fixed NEWS for 2.1.6 + + NEWS | 11 ++++++++++- + 1 files changed, 10 insertions(+), 1 deletions(-) + +commit ca24a1baa512751c54a89ab7eb5f815522d77b13 +Author: Pieter Hintjens +Date: Tue Apr 26 19:22:24 2011 +0200 + + Moved tests off 5555 (conflict with Eclipse) + + Signed-off-by: Pieter Hintjens + + tests/test_pair_tcp.cpp | 2 +- + tests/test_reqrep_tcp.cpp | 2 +- + tests/test_shutdown_stress.cpp | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +commit 6f653e39d7a0ade569bc7e78679930a11640de4e +Author: Martin Sustrik +Date: Fri Apr 22 07:51:24 2011 +0200 + + Assert during SUB socket termination fixed. + + Fair queueing algorithm was checking whether the current pipe + is not closed in the middle of reading a multipart message. + However, this is OK when the socket is closing down. + + Signed-off-by: Martin Sustrik + + src/fq.cpp | 7 +++---- + 1 files changed, 3 insertions(+), 4 deletions(-) + +commit fa6541c34e9c9496ad3fe83758773965862e272d +Author: Pieter Hintjens +Date: Tue Apr 26 10:01:56 2011 +0200 + + Ignore generated RHAT spec file + + .gitignore | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit 32915f8cadc30a62524ff6fe1c70158934704117 +Author: Mikko Koppanen +Date: Wed Apr 20 21:55:48 2011 +0100 + + Backport spec file changes from upstream + + Makefile.am | 1 - + builds/redhat/zeromq.spec | 139 ------------------------------------------ + builds/redhat/zeromq.spec.in | 139 ++++++++++++++++++++++++++++++++++++++++++ + configure.in | 3 +- + 4 files changed, 141 insertions(+), 141 deletions(-) + +commit 43307455e352769189d427f260c4b48a3a19f7ce +Author: Pieter Hintjens +Date: Wed Apr 20 19:39:57 2011 +0200 + + Fixed bad commit of message validity checking + + include/zmq.h | 2 +- + include/zmq.hpp | 2 +- + src/socket_base.cpp | 12 ++++++------ + src/zmq.cpp | 40 +++++++++++++++++++++++++++++++--------- + 4 files changed, 39 insertions(+), 17 deletions(-) + +commit 205533ac79e6634650c9b77c41ef934084a84619 +Author: Pieter Hintjens +Date: Wed Apr 20 16:17:56 2011 +0200 + + Updated for 2.1.6 + + include/zmq.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit a347a957ecf3dcbf300fd4513d8aad967a492395 +Author: Pieter Hintjens +Date: Wed Apr 20 16:12:15 2011 +0200 + + Fixed error in zmq_msg_t checking, reverted to 2.1.5 + + include/zmq.h | 2 +- + src/socket_base.cpp | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit bee9cd8aa40cf82bdb45b88e6d9fc9ef123c118e +Author: Pieter Hintjens +Date: Wed Apr 20 12:39:21 2011 +0200 + + Updated for 2.1.6 + + include/zmq.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit fd089736bcaa196106f516b87b8e8b906ffa8f63 +Author: Pieter Hintjens +Date: Wed Apr 20 12:31:17 2011 +0200 + + Updated news for 2.1.5 + + NEWS | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit f5043dff3ec0c1ea4619c89de8186a6d54938d5d +Merge: c27e9d1 8b13301 +Author: Pieter Hintjens +Date: Wed Apr 20 12:29:28 2011 +0200 + + Merge branch 'master' of github.com:zeromq/zeromq2-1 + +commit c27e9d16ad964f3b4252df890a3ec56c1c8ff6d7 +Author: Martin Sustrik +Date: Tue Apr 19 08:08:15 2011 +0200 + + Message validity is checked in the runtime + + Signed-off-by: Martin Sustrik + + doc/zmq_msg_close.txt | 3 ++- + doc/zmq_msg_copy.txt | 3 ++- + doc/zmq_msg_move.txt | 3 ++- + doc/zmq_recv.txt | 2 ++ + doc/zmq_send.txt | 2 ++ + include/zmq.h | 1 + + src/req.cpp | 2 +- + src/socket_base.cpp | 14 ++++++++++++++ + src/xrep.cpp | 2 +- + 9 files changed, 27 insertions(+), 5 deletions(-) + +commit 8b13301225b0ee34397af53a4c824a5bf05388ba +Author: Martin Sustrik +Date: Mon Apr 18 09:11:45 2011 +0200 + + zmq_socket(3) describes the EMFILE error code + + Signed-off-by: Martin Sustrik + + doc/zmq_socket.txt | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +commit 2b07aaad62cfa218fcbc2f586fce94c1f9fc7284 +Author: Martin Sustrik +Date: Fri Apr 15 08:03:26 2011 +0200 + + zmq_send(3) manpage improved + + Signed-off-by: Martin Sustrik + + doc/zmq_send.txt | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +commit 91bfeaf9b9ef1e0370fae31b14b4be3d8b02eff5 +Author: Martin Sustrik +Date: Fri Apr 15 07:59:28 2011 +0200 + + Error handling for accept on Cygwin fixed + + Signed-off-by: Martin Sustrik + + src/tcp_listener.cpp | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +commit 6ee55af86870e102cf9dab77e7ed217068c8c4d4 +Merge: 5a87743 1b55cf2 +Author: Pieter Hintjens +Date: Thu Apr 7 22:56:19 2011 +0200 + + Merge branch 'master' of github.com:zeromq/zeromq2-1 + +commit 5a8774373279ec9517b89ac21a945ca65fda20d2 +Author: Pieter Hintjens +Date: Thu Apr 7 22:56:09 2011 +0200 + + Reduced stress of shutdown tests + + tests/test_shutdown_stress.cpp | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 1b55cf2705b04caa0fc8152e1684389d91e557f0 +Author: Mikko Koppanen +Date: Tue Apr 5 12:00:30 2011 +0100 + + Fix Win32 builds + + src/tcp_socket.cpp | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 5fe4e9cea8af2c9d5f22d53b92ae202c03ce9c33 +Author: Mikko Koppanen +Date: Mon Apr 4 22:52:02 2011 +0200 + + Make pkg-config dependency conditional + + Signed-off-by: Mikko Koppanen + + autogen.sh | 6 ------ + configure.in | 13 ++++++++----- + 2 files changed, 8 insertions(+), 11 deletions(-) + +commit 28cdcaa8f323e05f7ebb3873c62ed1fd7839136f +Author: Martin Sustrik +Date: Mon Apr 4 13:12:46 2011 +0200 + + Another error handling issue on Win32 solved + + Signed-off-by: Martin Sustrik + + perf/inproc_lat.cpp | 2 +- + perf/inproc_thr.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 08066dcf6511faddf54ede3dd28bf14bf5f89201 +Author: Martin Sustrik +Date: Mon Apr 4 12:49:39 2011 +0200 + + Issue with error checking on Win32 platform fixed + + Signed-off-by: Martin Sustrik + + src/thread.cpp | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 6f9cb01eab130589d9c97062847a293b7605d429 +Author: Martin Sustrik +Date: Mon Apr 4 12:12:06 2011 +0200 + + Unreferenced variable removed + + Signed-off-by: Martin Sustrik + + src/tcp_socket.cpp | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +commit 5436832fdfe12c51c869e2cd59722b2be21a5a2a +Author: Pieter Hintjens +Date: Mon Apr 4 10:50:51 2011 +0200 + + Fixed RPM source spec + + builds/redhat/zeromq.spec | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit c493a44a2c1f2eb4e9e2aa37929b16170d849975 +Author: Pieter Hintjens +Date: Mon Apr 4 10:36:24 2011 +0200 + + Fixed bad packaging for zmq_device + + builds/redhat/zeromq.spec | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 122b9a48247d12258710bde53d4298da03661a01 +Author: Robert G. Jakabosky +Date: Sun Apr 3 20:44:02 2011 +0200 + + Add note about thread-safety to zmq_msg_init_data() manpage. + + Signed-off-by: Robert G. Jakabosky + + doc/zmq_msg_init_data.txt | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 2ec3fdeff4c9b0d825cc5f1192abf3362b0bf771 +Author: Pieter Hintjens +Date: Sun Apr 3 14:28:07 2011 +0200 + + Backported inproc perf tests to 2.x api + + perf/inproc_lat.cpp | 16 ++++++++-------- + perf/inproc_thr.cpp | 12 ++++++------ + 2 files changed, 14 insertions(+), 14 deletions(-) + +commit 4929636cea946892870921162388ecdf39f5267a +Author: Mikko Koppanen +Date: Sun Apr 3 12:51:12 2011 +0100 + + Fix merge conflicts + + acinclude.m4 | 6 +++--- + configure.in | 3 --- + 2 files changed, 3 insertions(+), 6 deletions(-) + +commit 6641ed81d2d2215f6b0d2aafa30c455eafe00c29 +Author: Pieter Hintjens +Date: Sun Apr 3 10:37:12 2011 +0200 + + Updated NEWS + + NEWS | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +commit 7a5f33ed180303c45b83e224bebaa4d734687fbf +Author: Martin Sustrik +Date: Sun Apr 3 07:36:02 2011 +0200 + + Git ignores .gcno files + + Signed-off-by: Martin Sustrik + + .gitignore | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 1e3ccf94c3b964ebb5b85c76775489ed73d881d1 +Author: Mikko Koppanen +Date: Sun Apr 3 07:34:14 2011 +0200 + + Additional gcov changes + + Signed-off-by: Mikko Koppanen + + acinclude.m4 | 32 +++++++++++++++++++++----------- + 1 files changed, 21 insertions(+), 11 deletions(-) + +commit 9014b40901bf87c322f69e656ff77c99e34cf1d1 +Author: Mikko Koppanen +Date: Sat Apr 2 22:49:41 2011 +0200 + + Added code coverage checking + + Signed-off-by: Mikko Koppanen + + acinclude.m4 | 8 ++++---- + configure.in | 3 +++ + 2 files changed, 7 insertions(+), 4 deletions(-) + +commit cd299055643ef160e87b7a339cb30aa0bb2eab98 +Author: Mikko Koppanen +Date: Sat Apr 2 22:50:46 2011 +0200 + + Large rename: AC_ZMQ_ to LIBZMQ_ and ac_zmq_ to libzmq_. Fixes "warning suspicious cache-id" + + Signed-off-by: Mikko Koppanen + + acinclude.m4 | 366 +++++++++++++++++++++++++++++++-------------------------- + configure.in | 86 +++++++------- + 2 files changed, 243 insertions(+), 209 deletions(-) + +commit 45f95648b825257f5426263643547a7df9c304b7 +Author: Mikko Koppanen +Date: Sat Apr 2 22:48:52 2011 +0200 + + Add option to build with system opepgm + + Signed-off-by: Mikko Koppanen + + autogen.sh | 6 ++++++ + configure.in | 17 +++++++++++++++++ + 2 files changed, 23 insertions(+), 0 deletions(-) + +commit c54e54b1c32c602d9a188d4f2318f72d4f3b21f9 +Author: Pieter Hintjens +Date: Sat Apr 2 20:17:38 2011 +0200 + + Updated NEWS for patches + + NEWS | 28 +++++++++++++++++++++++----- + 1 files changed, 23 insertions(+), 5 deletions(-) + +commit b4c4648fef62b6aceaad1ab3d47764b9f3c06e47 +Author: Martin Sustrik +Date: Sat Apr 2 19:32:44 2011 +0200 + + Project location on github changed in README file + + Signed-off-by: Martin Sustrik + + README | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +commit 006b72e73d34edda48a477d62042b3b73dfe5166 +Author: Pieter Hintjens +Date: Sat Apr 2 09:22:41 2011 +0200 + + Fixed memory leak with threads on win32 + + Signed-off-by: Pieter Hintjens + + src/thread.cpp | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit b65071324288ff5b5c1bfa2439d547a11c40b687 +Author: Martin Sustrik +Date: Sat Apr 2 09:50:35 2011 +0200 + + inproc perf tests now work on Windows + + Signed-off-by: Martin Sustrik + + builds/msvc/inproc_lat/inproc_lat.vcproj | 174 ++++++++++++++++++++++++++++++ + builds/msvc/inproc_thr/inproc_thr.vcproj | 174 ++++++++++++++++++++++++++++++ + builds/msvc/msvc.sln | 40 ++++--- + perf/inproc_lat.cpp | 46 ++++++++- + perf/inproc_thr.cpp | 46 ++++++++- + 5 files changed, 458 insertions(+), 22 deletions(-) + +commit 6da2436ea8944dc8625ccaa005eddc69c5a8942b +Author: Martin Sustrik +Date: Fri Apr 1 11:55:10 2011 +0200 + + inproc_lat and inproc_thr added to .gitignore + + Signed-off-by: Martin Sustrik + + .gitignore | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +commit e1926d84698cdc2a331123c7d3f6c0d2aa8d8cfd +Author: Martin Sustrik +Date: Fri Apr 1 11:53:51 2011 +0200 + + PGM wire format specification improved in zmq_pgm(7) + + Signed-off-by: Martin Sustrik + + doc/zmq_pgm.txt | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +commit 1fb5a3ee6e07cdbdef31a5dd1abaf8799a88b1a7 +Author: Martin Sustrik +Date: Thu Mar 31 23:16:14 2011 +0200 + + Robert G. Jakabosky added to the AUTHORS file + + Signed-off-by: Martin Sustrik + + AUTHORS | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +commit 0e528fb7029234f490d77ab7d382d47413f85c4e +Author: Robert G. Jakabosky +Date: Thu Mar 31 23:14:38 2011 +0200 + + Adding thread latency/throughput perf. examples. + + Signed-off-by: Robert G. Jakabosky + + perf/Makefile.am | 8 ++- + perf/inproc_lat.cpp | 190 +++++++++++++++++++++++++++++++++++++++++++++++ + perf/inproc_thr.cpp | 204 +++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 401 insertions(+), 1 deletions(-) + +commit 51d6e1d47d3a2cf13358b83d312236317a53f435 +Author: Pieter Hintjens +Date: Wed Mar 30 14:45:29 2011 +0200 + + Udated version for next release + + include/zmq.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +commit 5684d43eb3a03cb863f920015c5fa52f73977ec8 +Author: Pieter Hintjens +Date: Wed Mar 30 14:21:58 2011 +0200 + + Fixed whitespace error + + doc/Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + commit 3420eb7304ec05e2d7f36ac6f811abf2d0ba8bff Author: Pieter Hintjens Date: Wed Mar 30 14:09:19 2011 +0200 diff --git a/Makefile.am b/Makefile.am index 1e4a404..bf624ef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,7 +35,6 @@ dist-hook: echo A git clone is required to generate a ChangeLog >&2; \ fi -cp $(top_srcdir)/builds/redhat/zeromq.spec $(distdir)/zeromq.spec - -sed s/\@PACKAGE_VERSION\@/@PACKAGE_VERSION@/ -i $(distdir)/zeromq.spec -rm -rf $(distdir)/foreign/openpgm/build-staging distclean-local: -rm -rf $(top_srcdir)/foreign/openpgm/build-staging diff --git a/Makefile.in b/Makefile.in index 7ce18c2..30d5d0b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,10 +35,12 @@ build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ - COPYING.LESSER INSTALL NEWS config/compile config/config.guess \ - config/config.sub config/depcomp config/install-sh \ - config/ltmain.sh config/missing + $(srcdir)/Makefile.in \ + $(top_srcdir)/builds/redhat/zeromq.spec.in \ + $(top_srcdir)/configure AUTHORS COPYING COPYING.LESSER INSTALL \ + NEWS config/compile config/config.guess config/config.sub \ + config/depcomp config/install-sh config/ltmain.sh \ + config/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ @@ -52,7 +54,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/platform.hpp -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = builds/redhat/zeromq.spec CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) @@ -169,6 +171,8 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ +OpenPGM_CFLAGS = @OpenPGM_CFLAGS@ +OpenPGM_LIBS = @OpenPGM_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -177,6 +181,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -191,8 +198,6 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_zmq_have_asciidoc = @ac_zmq_have_asciidoc@ -ac_zmq_have_xmlto = @ac_zmq_have_xmlto@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -221,6 +226,8 @@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +libzmq_have_asciidoc = @libzmq_have_asciidoc@ +libzmq_have_xmlto = @libzmq_have_xmlto@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ @@ -298,6 +305,8 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): +builds/redhat/zeromq.spec: $(top_builddir)/config.status $(top_srcdir)/builds/redhat/zeromq.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo @@ -759,7 +768,6 @@ dist-hook: echo A git clone is required to generate a ChangeLog >&2; \ fi -cp $(top_srcdir)/builds/redhat/zeromq.spec $(distdir)/zeromq.spec - -sed s/\@PACKAGE_VERSION\@/@PACKAGE_VERSION@/ -i $(distdir)/zeromq.spec -rm -rf $(distdir)/foreign/openpgm/build-staging distclean-local: -rm -rf $(top_srcdir)/foreign/openpgm/build-staging diff --git a/NEWS b/NEWS index a0151b6..3ad869d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,35 @@ +0MQ version 2.1.6 (Stable), released on 2011/04/26 +================================================== + +Bug fixes +--------- + +* Fixed memory leak with threads on Windows. + +* Assert during SUB socket termination fixed. + +Changes +------- + +* Checks zmq_msg_t validity at each operation. + +* Inproc performance tests now work on Windows. + +* PGM wire format specification improved in zmq_pgm(7) + +* Added thread latency/throughput performance examples. + +* Added "--with-system-pgm" configure option to use already installed + OpenPGM. + + +0MQ version 2.1.5 (Broken), released on 2011/04/20 +================================================== + +Note that this version contained a malformed patch and is not usable. +It is not available for download, but is available in the git via the +2.1.5 tag. + 0MQ version 2.1.4 (Stable), released on 2011/03/30 ================================================== @@ -23,7 +55,7 @@ Bug fixes * Fix to PUSH sockets, which would sometimes deliver tail frames of a multipart message to new subscribers (Martin Sustrik). -* Fix to PUB sockets, which would sometimes deliver tail frames of a +* Fix to PUB sockets, which would sometimes deliver tail frames of a multipart message to new subscribers (Martin Sustrik). * Windows build was broken due to EPROTONOSUPPORT not being defined. This @@ -50,10 +82,10 @@ Changes * ZMQ_DEALER and ZMQ_ROUTER macros provided to ease upgrade to 0MQ/3.0. These are scheduled to replace ZMQ_XREQ and ZMQ_XREP (Pieter Hintjens). -* Added man page for zmq_device(3) which was hereto undocumented (Pieter +* Added man page for zmq_device(3) which was hereto undocumented (Pieter Hintjens). -* Removed zmq_queue(3), zmq_forwarder(3), zmq_streamer(3) man pages +* Removed zmq_queue(3), zmq_forwarder(3), zmq_streamer(3) man pages (Pieter Hintjens). OpenPGM Integration @@ -67,7 +99,7 @@ OpenPGM Integration * Build system allows configuration with arbitrary versions of OpenPGM (./configure --with-pgm=libpgm-x.y.z) (Mikko Koppanen). -* OpenPGM uses new PGM_ODATA_MAX_RTE controlling original data instead of +* OpenPGM uses new PGM_ODATA_MAX_RTE controlling original data instead of PGM_TXW_MAX_RTE covering entire channel (Steven McCoy). Building @@ -107,7 +139,7 @@ New functionality * Size of inproc HWM and SWAP is sum of peers' HWMs and SWAPs (Douglas Greager, Martin Sustrik). - + Bug fixes --------- diff --git a/README b/README index dd9ec9f..7f1ebfd 100644 --- a/README +++ b/README @@ -26,8 +26,7 @@ Website: http://www.zeromq.org/ Development mailing list: zeromq-dev@lists.zeromq.org Announcements mailing list: zeromq-announce@lists.zeromq.org -Git repository for this release: http://github.com/zeromq/zeromq2-1. -Repository for current development: http://github.com/zeromq/zeromq2. +Git repository: http://github.com/zeromq/libzmq 0MQ developers can also be found on the IRC channel #zeromq, on the Freenode network (irc.freenode.net). diff --git a/acinclude.m4 b/acinclude.m4 index 1257c9e..bfafc7c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,8 +1,8 @@ dnl ############################################################################## -dnl # AC_ZMQ_CONFIG_LIBTOOL # +dnl # LIBZMQ_CONFIG_LIBTOOL # dnl # Configure libtool. Requires AC_CANONICAL_HOST # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CONFIG_LIBTOOL], [{ +AC_DEFUN([LIBZMQ_CONFIG_LIBTOOL], [{ AC_REQUIRE([AC_CANONICAL_HOST]) # Libtool configuration for different targets @@ -19,192 +19,192 @@ AC_DEFUN([AC_ZMQ_CONFIG_LIBTOOL], [{ }]) dnl ############################################################################## -dnl # AC_ZMQ_CHECK_LANG_ICC([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_ICC([action-if-found], [action-if-not-found]) # dnl # Check if the current language is compiled using ICC # dnl # Adapted from http://software.intel.com/en-us/forums/showthread.php?t=67984 # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_LANG_ICC], +AC_DEFUN([LIBZMQ_CHECK_LANG_ICC], [AC_CACHE_CHECK([whether we are using Intel _AC_LANG compiler], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler], + [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __INTEL_COMPILER error if not ICC #endif ]])], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="yes" ; $1], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="no" ; $2]) + [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="yes" ; $1], + [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="no" ; $2]) ])]) dnl ############################################################################## -dnl # AC_ZMQ_CHECK_LANG_SUN_STUDIO([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_SUN_STUDIO([action-if-found], [action-if-not-found]) # dnl # Check if the current language is compiled using Sun Studio # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_LANG_SUN_STUDIO], +AC_DEFUN([LIBZMQ_CHECK_LANG_SUN_STUDIO], [AC_CACHE_CHECK([whether we are using Sun Studio _AC_LANG compiler], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler], + [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) error if not sun studio #endif ]])], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="yes" ; $1], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="no" ; $2]) + [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="yes" ; $1], + [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="no" ; $2]) ])]) dnl ############################################################################## -dnl # AC_ZMQ_CHECK_LANG_CLANG([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_CLANG([action-if-found], [action-if-not-found]) # dnl # Check if the current language is compiled using clang # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_LANG_CLANG], +AC_DEFUN([LIBZMQ_CHECK_LANG_CLANG], [AC_CACHE_CHECK([whether we are using clang _AC_LANG compiler], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler], + [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __clang__ error if not clang #endif ]])], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="yes" ; $1], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="no" ; $2]) + [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="yes" ; $1], + [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="no" ; $2]) ])]) dnl ############################################################################## -dnl # AC_ZMQ_CHECK_LANG_GCC4([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_GCC4([action-if-found], [action-if-not-found]) # dnl # Check if the current language is compiled using clang # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_LANG_GCC4], +AC_DEFUN([LIBZMQ_CHECK_LANG_GCC4], [AC_CACHE_CHECK([whether we are using gcc >= 4 _AC_LANG compiler], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler], + [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if (!defined __GNUC__ || __GNUC__ < 4) error if not gcc4 or higher #endif ]])], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="yes" ; $1], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="no" ; $2]) + [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="yes" ; $1], + [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="no" ; $2]) ])]) dnl ############################################################################## -dnl # AC_ZMQ_CHECK_DOC_BUILD # +dnl # LIBZMQ_CHECK_DOC_BUILD # dnl # Check whether to build documentation and install man-pages # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_DOC_BUILD], [{ +AC_DEFUN([LIBZMQ_CHECK_DOC_BUILD], [{ # Allow user to disable doc build AC_ARG_WITH([documentation], [AS_HELP_STRING([--without-documentation], [disable documentation build even if asciidoc and xmlto are present [default=no]])]) if test "x$with_documentation" = "xno"; then - ac_zmq_build_doc="no" - ac_zmq_install_man="no" + libzmq_build_doc="no" + libzmq_install_man="no" else # Determine whether or not documentation should be built and installed. - ac_zmq_build_doc="yes" - ac_zmq_install_man="yes" + libzmq_build_doc="yes" + libzmq_install_man="yes" # Check for asciidoc and xmlto and don't build the docs if these are not installed. - AC_CHECK_PROG(ac_zmq_have_asciidoc, asciidoc, yes, no) - AC_CHECK_PROG(ac_zmq_have_xmlto, xmlto, yes, no) - if test "x$ac_zmq_have_asciidoc" = "xno" -o "x$ac_zmq_have_xmlto" = "xno"; then - ac_zmq_build_doc="no" + AC_CHECK_PROG(libzmq_have_asciidoc, asciidoc, yes, no) + AC_CHECK_PROG(libzmq_have_xmlto, xmlto, yes, no) + if test "x$libzmq_have_asciidoc" = "xno" -o "x$libzmq_have_xmlto" = "xno"; then + libzmq_build_doc="no" # Tarballs built with 'make dist' ship with prebuilt documentation. if ! test -f doc/zmq.7; then - ac_zmq_install_man="no" + libzmq_install_man="no" AC_MSG_WARN([You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.]) AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.]) fi fi # Do not install man pages if on mingw - if test "x$ac_zmq_on_mingw32" = "xyes"; then - ac_zmq_install_man="no" + if test "x$libzmq_on_mingw32" = "xyes"; then + libzmq_install_man="no" fi fi AC_MSG_CHECKING([whether to build documentation]) - AC_MSG_RESULT([$ac_zmq_build_doc]) + AC_MSG_RESULT([$libzmq_build_doc]) AC_MSG_CHECKING([whether to install manpages]) - AC_MSG_RESULT([$ac_zmq_install_man]) + AC_MSG_RESULT([$libzmq_install_man]) - AM_CONDITIONAL(BUILD_DOC, test "x$ac_zmq_build_doc" = "xyes") - AM_CONDITIONAL(INSTALL_MAN, test "x$ac_zmq_install_man" = "xyes") + AM_CONDITIONAL(BUILD_DOC, test "x$libzmq_build_doc" = "xyes") + AM_CONDITIONAL(INSTALL_MAN, test "x$libzmq_install_man" = "xyes") }]) dnl ############################################################################## -dnl # AC_ZMQ_CHECK_LANG_COMPILER([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_COMPILER([action-if-found], [action-if-not-found]) # dnl # Check that compiler for the current language actually works # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_LANG_COMPILER], [{ +AC_DEFUN([LIBZMQ_CHECK_LANG_COMPILER], [{ # Test that compiler for the current language actually works AC_CACHE_CHECK([whether the _AC_LANG compiler works], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_compiler_works], + [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works], [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="yes" ; $1], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="no" ; $2]) + [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="yes" ; $1], + [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="no" ; $2]) ]) - if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_compiler_works" != "xyes"; then + if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works" != "xyes"; then AC_MSG_ERROR([Unable to find a working _AC_LANG compiler]) fi }]) dnl ############################################################################## -dnl # AC_ZMQ_CHECK_COMPILERS # +dnl # LIBZMQ_CHECK_COMPILERS # dnl # Check compiler characteristics. This is so that we can AC_REQUIRE checks # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_COMPILERS], [{ +AC_DEFUN([LIBZMQ_CHECK_COMPILERS], [{ # For that the compiler works and try to come up with the type AC_LANG_PUSH([C]) - AC_ZMQ_CHECK_LANG_COMPILER + LIBZMQ_CHECK_LANG_COMPILER - AC_ZMQ_CHECK_LANG_ICC - AC_ZMQ_CHECK_LANG_SUN_STUDIO - AC_ZMQ_CHECK_LANG_CLANG - AC_ZMQ_CHECK_LANG_GCC4 + LIBZMQ_CHECK_LANG_ICC + LIBZMQ_CHECK_LANG_SUN_STUDIO + LIBZMQ_CHECK_LANG_CLANG + LIBZMQ_CHECK_LANG_GCC4 AC_LANG_POP([C]) AC_LANG_PUSH(C++) - AC_ZMQ_CHECK_LANG_COMPILER + LIBZMQ_CHECK_LANG_COMPILER - AC_ZMQ_CHECK_LANG_ICC - AC_ZMQ_CHECK_LANG_SUN_STUDIO - AC_ZMQ_CHECK_LANG_CLANG - AC_ZMQ_CHECK_LANG_GCC4 + LIBZMQ_CHECK_LANG_ICC + LIBZMQ_CHECK_LANG_SUN_STUDIO + LIBZMQ_CHECK_LANG_CLANG + LIBZMQ_CHECK_LANG_GCC4 AC_LANG_POP([C++]) # Set GCC and GXX variables correctly if test "x$GCC" = "xyes"; then - if test "xyes" = "x$ac_zmq_cv_c_intel_compiler"; then + if test "xyes" = "x$libzmq_cv_c_intel_compiler"; then GCC="no" fi fi if test "x$GXX" = "xyes"; then - if test "xyes" = "x$ac_zmq_cv_cxx_intel_compiler"; then + if test "xyes" = "x$libzmq_cv_cxx_intel_compiler"; then GXX="no" fi fi }]) dnl ############################################################################ -dnl # AC_ZMQ_CHECK_LANG_FLAG([flag], [action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_FLAG([flag], [action-if-found], [action-if-not-found]) # dnl # Check if the compiler supports given flag. Works for C and C++ # -dnl # Sets ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no # +dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no # dnl ############################################################################ -AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG], [{ +AC_DEFUN([LIBZMQ_CHECK_LANG_FLAG], [{ AC_REQUIRE([AC_PROG_GREP]) AC_MSG_CHECKING([whether _AC_LANG compiler supports $1]) - ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag + libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag ac_[]_AC_LANG_ABBREV[]_werror_flag="yes" case "x[]_AC_LANG_ABBREV" in xc) - ac_zmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" + libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" ;; xcxx) - ac_zmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" + libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $1" ;; *) @@ -217,18 +217,18 @@ AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG], [{ # Remarks are not turned into errors even with -Werror on [if ($GREP 'ignoring unknown' conftest.err || $GREP 'not supported' conftest.err) >/dev/null 2>&1; then - eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no" + eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no" else - eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="yes" + eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="yes" fi], - [eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no"]) + [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no"]) case "x[]_AC_LANG_ABBREV" in xc) - CFLAGS="$ac_zmq_cv_check_lang_flag_save_CFLAGS" + CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS" ;; xcxx) - CPPFLAGS="$ac_zmq_cv_check_lang_flag_save_CPPFLAGS" + CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS" ;; *) # nothing to restore @@ -236,42 +236,42 @@ AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG], [{ esac # Restore the werror flag - ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save + ac_[]_AC_LANG_ABBREV[]_werror_flag=$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save # Call the action as the flags are restored - AS_IF([eval test x$]AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], + AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], [AC_MSG_RESULT(yes) ; $2], [AC_MSG_RESULT(no) ; $3]) }]) dnl #################################################################################### -dnl # AC_ZMQ_CHECK_LANG_FLAG_PREPEND([flag], [action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_FLAG_PREPEND([flag], [action-if-found], [action-if-not-found]) # dnl # Check if the compiler supports given flag. Works for C and C++ # dnl # This macro prepends the flag to CFLAGS or CPPFLAGS accordingly # -dnl # Sets ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no # +dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no # dnl #################################################################################### -AC_DEFUN([AC_ZMQ_CHECK_LANG_FLAG_PREPEND], [{ - AC_ZMQ_CHECK_LANG_FLAG([$1]) +AC_DEFUN([LIBZMQ_CHECK_LANG_FLAG_PREPEND], [{ + LIBZMQ_CHECK_LANG_FLAG([$1]) case "x[]_AC_LANG_ABBREV" in xc) - AS_IF([eval test x$]AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], + AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], [CFLAGS="$1 $CFLAGS"; $2], $3) ;; xcxx) - AS_IF([eval test x$]AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], + AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], [CPPFLAGS="$1 $CPPFLAGS"; $2], $3) ;; esac }]) dnl ############################################################################## -dnl # AC_ZMQ_CHECK_ENABLE_DEBUG([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_ENABLE_DEBUG([action-if-found], [action-if-not-found]) # dnl # Check whether to enable debug build and set compiler flags accordingly # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{ +AC_DEFUN([LIBZMQ_CHECK_ENABLE_DEBUG], [{ # Require compiler specifics - AC_REQUIRE([AC_ZMQ_CHECK_COMPILERS]) + AC_REQUIRE([LIBZMQ_CHECK_COMPILERS]) # This flag is checked also in AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], @@ -283,21 +283,21 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{ # GCC, clang and ICC if test "x$GCC" = "xyes" -o \ - "x$ac_zmq_cv_c_intel_compiler" = "xyes" -o \ - "x$ac_zmq_cv_c_clang_compiler" = "xyes"; then + "x$libzmq_cv_c_intel_compiler" = "xyes" -o \ + "x$libzmq_cv_c_clang_compiler" = "xyes"; then CFLAGS="-g -O0 " - elif test "x$ac_zmq_cv_c_sun_studio_compiler" = "xyes"; then + elif test "x$libzmq_cv_c_sun_studio_compiler" = "xyes"; then CFLAGS="-g0 " fi # GCC, clang and ICC if test "x$GXX" = "xyes" -o \ - "x$ac_zmq_cv_cxx_intel_compiler" = "xyes" -o \ - "x$ac_zmq_cv_cxx_clang_compiler" = "xyes"; then + "x$libzmq_cv_cxx_intel_compiler" = "xyes" -o \ + "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then CPPFLAGS="-g -O0 " CXXFLAGS="-g -O0 " # Sun studio - elif test "x$ac_zmq_cv_cxx_sun_studio_compiler" = "xyes"; then + elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then CPPFLAGS="-g0 " CXXFLAGS="-g0 " fi @@ -317,13 +317,55 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{ fi }]) +dnl ############################################################################## +dnl # LIBZMQ_WITH_GCOV([action-if-found], [action-if-not-found]) # +dnl # Check whether to build with code coverage # +dnl ############################################################################## +AC_DEFUN([LIBZMQ_WITH_GCOV], [{ + # Require compiler specifics + AC_REQUIRE([LIBZMQ_CHECK_COMPILERS]) + + AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no], + [With GCC Code Coverage reporting.])], + [ZMQ_GCOV="$withval"]) + + AC_MSG_CHECKING(whether to enable code coverage) + + if test "x$ZMQ_GCOV" = "xyes"; then + + if test "x$GXX" != "xyes"; then + AC_MSG_ERROR([--with-gcov=yes works only with GCC]) + fi + + CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" + if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then + CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}" + fi + + CPPFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" + if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then + CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}" + fi + + CXXFLAGS="-fprofile-arcs" + if test "x${ZMQ_ORIG_CXXFLAGS}" != "xnone"; then + CXXFLAGS="${CXXFLAGS} ${ZMQ_ORIG_CXXFLAGS}" + fi + + LIBS="-lgcov ${LIBS}" + fi + + AS_IF([test "x$ZMQ_GCOV" = "xyes"], + [AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2]) +}]) + dnl ############################################################################## dnl # AC_ZMQ_CHECK_WITH_FLAG([flags], [macro]) # dnl # Runs a normal autoconf check with compiler flags # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_CHECK_WITH_FLAG], [{ - ac_zmq_check_with_flag_save_CFLAGS="$CFLAGS" - ac_zmq_check_with_flag_save_CPPFLAGS="$CPPFLAGS" +AC_DEFUN([LIBZMQ_CHECK_WITH_FLAG], [{ + libzmq_check_with_flag_save_CFLAGS="$CFLAGS" + libzmq_check_with_flag_save_CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS $1" CPPFLAGS="$CPPFLAGS $1" @@ -331,43 +373,43 @@ AC_DEFUN([AC_ZMQ_CHECK_WITH_FLAG], [{ # Execute the macro $2 - CFLAGS="$ac_zmq_check_with_flag_save_CFLAGS" - CPPFLAGS="$ac_zmq_check_with_flag_save_CPPFLAGS" + CFLAGS="$libzmq_check_with_flag_save_CFLAGS" + CPPFLAGS="$libzmq_check_with_flag_save_CPPFLAGS" }]) dnl ############################################################################## -dnl # AC_ZMQ_LANG_WALL([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_LANG_WALL([action-if-found], [action-if-not-found]) # dnl # How to define -Wall for the current compiler # -dnl # Sets ac_zmq_cv_[]_AC_LANG_ABBREV[]__wall_flag variable to found style # +dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]__wall_flag variable to found style # dnl ############################################################################## -AC_DEFUN([AC_ZMQ_LANG_WALL], [{ +AC_DEFUN([LIBZMQ_LANG_WALL], [{ AC_MSG_CHECKING([how to enable additional warnings for _AC_LANG compiler]) - ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="" + libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="" # C compilers case "x[]_AC_LANG_ABBREV" in xc) # GCC, clang and ICC if test "x$GCC" = "xyes" -o \ - "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ - "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall" + "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ + "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall" # Sun studio - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-v" + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-v" fi ;; xcxx) # GCC, clang and ICC if test "x$GXX" = "xyes" -o \ - "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ - "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall" + "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ + "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall" # Sun studio - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="+w" + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="+w" fi ;; *) @@ -375,8 +417,8 @@ AC_DEFUN([AC_ZMQ_LANG_WALL], [{ esac # Call the action - if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" != "x"; then - AC_MSG_RESULT([$ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag]) + if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" != "x"; then + AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag]) $1 else AC_MSG_RESULT([not found]) @@ -385,36 +427,36 @@ AC_DEFUN([AC_ZMQ_LANG_WALL], [{ }]) dnl #################################################################### -dnl # AC_ZMQ_LANG_STRICT([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_LANG_STRICT([action-if-found], [action-if-not-found]) # dnl # Check how to turn on strict standards compliance # dnl #################################################################### -AC_DEFUN([AC_ZMQ_LANG_STRICT], [{ +AC_DEFUN([LIBZMQ_LANG_STRICT], [{ AC_MSG_CHECKING([how to enable strict standards compliance in _AC_LANG compiler]) - ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="" + libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="" # C compilers case "x[]_AC_LANG_ABBREV" in xc) # GCC, clang and ICC - if test "x$GCC" = "xyes" -o "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic" - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi" + if test "x$GCC" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic" + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi" # Sun studio - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-Xc" + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-Xc" fi ;; xcxx) # GCC, clang and ICC - if test "x$GXX" = "xyes" -o "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic" - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi" + if test "x$GXX" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic" + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi" # Sun studio - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-compat=5" + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-compat=5" fi ;; *) @@ -422,8 +464,8 @@ AC_DEFUN([AC_ZMQ_LANG_STRICT], [{ esac # Call the action - if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag" != "x"; then - AC_MSG_RESULT([$ac_zmq_cv_[]_AC_LANG_ABBREV[]_strict_flag]) + if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag" != "x"; then + AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag]) $1 else AC_MSG_RESULT([not found]) @@ -432,32 +474,32 @@ AC_DEFUN([AC_ZMQ_LANG_STRICT], [{ }]) dnl ######################################################################## -dnl # AC_ZMQ_LANG_WERROR([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_LANG_WERROR([action-if-found], [action-if-not-found]) # dnl # Check how to turn warnings to errors # dnl ######################################################################## -AC_DEFUN([AC_ZMQ_LANG_WERROR], [{ +AC_DEFUN([LIBZMQ_LANG_WERROR], [{ AC_MSG_CHECKING([how to turn warnings to errors in _AC_LANG compiler]) - ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="" + libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="" # C compilers case "x[]_AC_LANG_ABBREV" in xc) # GCC, clang and ICC - if test "x$GCC" = "xyes" -o "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror" + if test "x$GCC" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror" # Sun studio - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all" + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all" fi ;; xcxx) # GCC, clang and ICC - if test "x$GXX" = "xyes" -o "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror" + if test "x$GXX" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror" # Sun studio - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then - ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all" + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then + libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all" fi ;; *) @@ -465,8 +507,8 @@ AC_DEFUN([AC_ZMQ_LANG_WERROR], [{ esac # Call the action - if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag" != "x"; then - AC_MSG_RESULT([$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag]) + if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag" != "x"; then + AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag]) $1 else AC_MSG_RESULT([not found]) @@ -475,66 +517,66 @@ AC_DEFUN([AC_ZMQ_LANG_WERROR], [{ }]) dnl ################################################################################ -dnl # AC_ZMQ_CHECK_LANG_PRAGMA([pragma], [action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_PRAGMA([pragma], [action-if-found], [action-if-not-found]) # dnl # Check if the compiler supports given pragma # dnl ################################################################################ -AC_DEFUN([AC_ZMQ_CHECK_LANG_PRAGMA], [{ +AC_DEFUN([LIBZMQ_CHECK_LANG_PRAGMA], [{ # Need to know how to enable all warnings - AC_ZMQ_LANG_WALL + LIBZMQ_LANG_WALL AC_MSG_CHECKING([whether _AC_LANG compiler supports pragma $1]) # Save flags - ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag + libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag ac_[]_AC_LANG_ABBREV[]_werror_flag="yes" if test "x[]_AC_LANG_ABBREV" = "xc"; then - ac_zmq_cv_check_lang_pragma_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" + libzmq_cv_check_lang_pragma_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then - ac_zmq_cv_check_lang_pragma_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $ac_zmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" + libzmq_cv_check_lang_pragma_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" else AC_MSG_WARN([testing compiler characteristic on an unknown language]) fi AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#pragma $1]])], - [eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="yes" ; AC_MSG_RESULT(yes)], - [eval AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="no" ; AC_MSG_RESULT(no)]) + [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="yes" ; AC_MSG_RESULT(yes)], + [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="no" ; AC_MSG_RESULT(no)]) if test "x[]_AC_LANG_ABBREV" = "xc"; then - CFLAGS="$ac_zmq_cv_check_lang_pragma_save_CFLAGS" + CFLAGS="$libzmq_cv_check_lang_pragma_save_CFLAGS" elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then - CPPFLAGS="$ac_zmq_cv_check_lang_pragma_save_CPPFLAGS" + CPPFLAGS="$libzmq_cv_check_lang_pragma_save_CPPFLAGS" fi - ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_zmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save + ac_[]_AC_LANG_ABBREV[]_werror_flag=$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save # Call the action as the flags are restored - AS_IF([eval test x$]AS_TR_SH(ac_zmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)[ = "xyes"], + AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)[ = "xyes"], [$2], [$3]) }]) dnl ################################################################################ -dnl # AC_ZMQ_CHECK_LANG_VISIBILITY([action-if-found], [action-if-not-found]) # +dnl # LIBZMQ_CHECK_LANG_VISIBILITY([action-if-found], [action-if-not-found]) # dnl # Check if the compiler supports dso visibility # dnl ################################################################################ -AC_DEFUN([AC_ZMQ_CHECK_LANG_VISIBILITY], [{ - - ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="" - - if test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ - "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes" -o \ - "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler" = "xyes"; then - AC_ZMQ_CHECK_LANG_FLAG([-fvisibility=hidden], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-fvisibility=hidden"]) - elif test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then - AC_ZMQ_CHECK_LANG_FLAG([-xldscope=hidden], - [ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-xldscope=hidden"]) +AC_DEFUN([LIBZMQ_CHECK_LANG_VISIBILITY], [{ + + libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="" + + if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ + "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes" -o \ + "x$libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler" = "xyes"; then + LIBZMQ_CHECK_LANG_FLAG([-fvisibility=hidden], + [libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-fvisibility=hidden"]) + elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then + LIBZMQ_CHECK_LANG_FLAG([-xldscope=hidden], + [libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-xldscope=hidden"]) fi AC_MSG_CHECKING(whether _AC_LANG compiler supports dso visibility) - AS_IF([test "x$ac_zmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag" != "x"], + AS_IF([test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag" != "x"], [AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2]) }]) diff --git a/aclocal.m4 b/aclocal.m4 index a9cf856..bd741d2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -19,6 +19,164 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first c