diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | configure.in | 21 | ||||
-rw-r--r-- | include/zmq.h | 116 | ||||
-rw-r--r-- | src/Makefile.am | 26 | ||||
-rw-r--r-- | src/libxszmq.pc.in | 2 | ||||
-rw-r--r-- | src/libzmq.pc.in | 10 |
6 files changed, 61 insertions, 117 deletions
@@ -20,6 +20,8 @@ autom4te.cache .* *~ .*~ +include/zmq.h +include/zmq_utils.h tests/pair_inproc tests/pair_ipc tests/pair_tcp @@ -54,6 +56,7 @@ doc/*.html doc/*.xml src/libxs.pc src/libxszmq.pc +src/libzmq.pc bin/ lib/ obj/ diff --git a/configure.in b/configure.in index f355968..45117e6 100644 --- a/configure.in +++ b/configure.in @@ -277,6 +277,17 @@ AC_HEADER_TIME AC_TYPE_UINT32_T AC_C_VOLATILE +# libzmq compatibility mode +libxs_libzmq_compat="no" +AC_ARG_ENABLE([libzmq-compat], [AS_HELP_STRING([--enable-libzmq-compat], + [install libzmq compatibility library and headers [default=no]])], + [enable_libzmq_compat=$enableval], [enable_libzmq_compat=no]) + +if test "x$enable_libzmq_compat" != "xno"; then + AC_MSG_NOTICE([enabling libzmq compatibility library and headers]) + libxs_libzmq_compat="yes" +fi + # PGM extension libxs_pgm_ext="no" @@ -369,6 +380,7 @@ if test "x$libxs_pedantic" = "xyes"; then fi AC_LANG_POP([C++]) +AM_CONDITIONAL(BUILD_LIBZMQ, test "x$libxs_libzmq_compat" = "xyes") AM_CONDITIONAL(BUILD_PGM, test "x$libxs_pgm_ext" = "xyes") AM_CONDITIONAL(ON_MINGW, test "x$libxs_on_mingw32" = "xyes") @@ -391,5 +403,14 @@ AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile perf/Makefile src/libxs.pc src/libxszmq.pc \ builds/msvc/Makefile tests/Makefile \ foreign/openpgm/Makefile]) +if test "x$libxs_libzmq_compat" == "xyes"; then + AC_CONFIG_FILES([src/libzmq.pc]) +fi AC_OUTPUT +if test "x$libxs_libzmq_compat" == "xyes"; then + AC_MSG_WARN([The --enable-libzmq-compat option was specified:]) + AC_MSG_WARN([libzmq compatibility library and headers are enabled.]) + AC_MSG_WARN([This will overwrite any existing installation of libzmq.]) +fi + diff --git a/include/zmq.h b/include/zmq.h deleted file mode 100644 index 11270f9..0000000 --- a/include/zmq.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright (c) 2012 250bpm s.r.o. - Copyright (c) 2012 Other contributors as noted in the AUTHORS file - - This file is part of Crossroads I/O project. - - Crossroads I/O is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Crossroads 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 Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef __ZMQ_H_INCLUDED__ -#define __ZMQ_H_INCLUDED__ - -// ZeroMQ compatibility header file. - -#include <xs.h> - -#define ZMQ_USE_XS -#define ZMQ_VERSION_MAJOR XS_VERSION_MAJOR -#define ZMQ_VERSION_MINOR XS_VERSION_MINOR -#define ZMQVERSION_PATCH XS_VERSION_PATCH -#define ZMQ_MAKE_VERSION(major, minor, patch) \ - XS_MAKE_VERSION(major, ninor, patch) -#define ZMQ_VERSION XS_VERSION -#define zmq_version xs_version - -#define zmq_errno xs_errno -#define zmq_strerror xs_strerror - -#define zmq_msg_t xs_msg_t -#define zmq_free_fd xs_free_fn -#define zmq_msg_init xs_msg_init -#define zmq_msg_init_size xs_msg_init_size -#define zmq_msg_init_data xs_msg_init_data -#define zmq_msg_close xs_msg_close -#define zmq_msg_move xs_msg_move -#define zmq_msg_copy xs_msg_copy -#define zmq_msg_data xs_msg_data -#define zmq_msg_size xs_msg_size -#define zmq_getmsgopt xs_getmsgopt - -#define zmq_init xs_init -#define zmq_term xs_term - -#define ZMQ_PAIR XS_PAIR -#define ZMQ_PUB XS_PUB -#define ZMQ_SUB XS_SUB -#define ZMQ_REQ XS_REQ -#define ZMQ_REP XS_REP -#define ZMQ_XREQ XS_XREQ -#define ZMQ_XRER XS_XREP -#define ZMQ_PULL XS_PULL -#define ZMQ_PUSH XS_PUSH -#define ZMQ_XPUB XS_XPUB -#define ZMQ_XSUB XS_XSUB -#define ZMQ_ROUTER XS_ROUTER -#define ZMQ_DEALER XS_DEALER - -#define ZMQ_AFFINITY XS_AFFINITY -#define ZMQ_IDENTITY XS_IDENTITY -#define ZMQ_SUBSCRIBE XS_SUBSCRIBE -#define ZMQ_UNSUBSCRIBE XS_UNSUBSCRIBE -#define ZMQ_RATE XS_RATE -#define ZMQ_RECOVERY_IVL XS_RECOVERY_IVL -#define ZMQ_SNDBUF XS_SNDBUF -#define ZMQ_RCVBUF XS_RCVBUF -#define ZMQ_RCVMORE XS_RCVMORE -#define ZMQ_FD XS_FD -#define ZMQ_EVENTS XS_EVENTS -#define ZMQ_TYPE XS_TYPE -#define ZMQ_LINGER XS_LINGER -#define ZMQ_RCONNECT_IVL XS_RECONNECT_IVL -#define ZMQ_BACKLOG XS_BACKLOG -#define ZMQ_RECONNECT_IVL_MAX XS_RECONNECT_IVL_MAX -#define ZMQ_MAXMSGSIZE XS_MAXMSGSIZE -#define ZMQ_SNDHWM XS_SNDHWM -#define ZMQ_RCVHWM XS_RCVHWM -#define ZMQ_MULTICAST_HOPS XS_MULTICAST_HOPS -#define ZMQ_RCVTIMEO XS_RCVTIMEO -#define ZMQ_SNDTIMEO XS_SNDTIMEO -#define ZMQ_IPV4ONLY XS_IPV4ONLY - -#define ZMQ_MORE XS_MORE -#define ZMQ_DONTWAIT XS_DONTWAIT -#define ZMQ_SNDMORE XS_SNDMORE - -#define zmq_socket xs_socket -#define zmq_close xs_close -#define zmq_setsockopt xs_setsockopt -#define zmq_getsockopt xs_getsockopt -#define zmq_bind xs_bind -#define zmq_connect xs_connect -#define zmq_send xs_send -#define zmq_recv xs_recv -#define zmq_sendmsg xs_sendmsg -#define zmq_recvmsg xs_recvmsg - -#define ZMQ_POLLIN XS_POLLIN -#define ZMQ_POLLOUT XS_POLLOUT -#define ZMQ_POLLERR XS_POLLERR - -#define zmq_pollitem_t xs_pollitem_t -#define zmq_poll xs_poll - -#endif - diff --git a/src/Makefile.am b/src/Makefile.am index 664dabc..0d25a7c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,10 +1,29 @@ +if BUILD_LIBZMQ +lib_LTLIBRARIES = libxs.la libxszmq.la libzmq.la +else lib_LTLIBRARIES = libxs.la libxszmq.la +endif pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libxs.pc libxszmq.pc +if BUILD_LIBZMQ +include_HEADERS = ../include/xs.h ../include/xs_utils.h \ + ../include/xszmq.h ../include/xszmq_utils.h \ + ../include/zmq.h ../include/zmq_utils.h + +../include/zmq.h: ../include/xszmq.h + cp ../include/xszmq.h ../include/zmq.h + +../include/zmq_utils.h: ../include/xszmq_utils.h + cp ../include/xszmq_utils.h ../include/zmq_utils.h + +distclean-local: + -rm -f ../include/zmq.h ../include/zmq_utils.h +else include_HEADERS = ../include/xs.h ../include/xs_utils.h \ ../include/xszmq.h ../include/xszmq_utils.h +endif libxs_la_SOURCES = \ array.hpp \ @@ -155,6 +174,13 @@ else libxszmq_la_LDFLAGS = -version-info @LIBXSZMQ_ABI_VERSION@ endif +if BUILD_LIBZMQ +libzmq_la_SOURCES = $(libxszmq_la_SOURCES) +libzmq_la_CPPFLAGS = $(libxszmq_la_CPPFLAGS) +libzmq_la_LIBADD = $(libxszmq_la_LIBADD) +libzmq_la_LDFLAGS = $(libxszmq_la_LDFLAGS) +endif + dist-hook: -rm $(distdir)/platform.hpp diff --git a/src/libxszmq.pc.in b/src/libxszmq.pc.in index 577724f..9c631ad 100644 --- a/src/libxszmq.pc.in +++ b/src/libxszmq.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ includedir=@includedir@ Name: libxszmq -Description: Crossroads libzmq compatibility library +Description: Crossroads libxszmq compatibility library Version: @VERSION@ Libs: -L${libdir} -lxszmq Cflags: -I${includedir} diff --git a/src/libzmq.pc.in b/src/libzmq.pc.in new file mode 100644 index 0000000..b282680 --- /dev/null +++ b/src/libzmq.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libzmq +Description: Crossroads libzmq compatibility library +Version: @VERSION@ +Libs: -L${libdir} -lzmq +Cflags: -I${includedir} |