diff --git a/.gitignore b/.gitignore index 08e43b0b..4fb611c5 100644 --- a/.gitignore +++ b/.gitignore @@ -170,3 +170,6 @@ zeromq-*.zip core build test-suite.log +project.Makefile +libzmq.target.mk +out/ diff --git a/Makefile.am b/Makefile.am index 8bffeeec..7adbf220 100644 --- a/Makefile.am +++ b/Makefile.am @@ -215,8 +215,8 @@ src_libzmq_la_SOURCES = \ src/vmci_listener.hpp \ src/windows.hpp \ src/wire.hpp \ - src/xpub.hpp \ src/xpub.cpp \ + src/xpub.hpp \ src/xsub.cpp \ src/xsub.hpp \ src/ypipe.hpp \ @@ -225,10 +225,10 @@ src_libzmq_la_SOURCES = \ src/yqueue.hpp \ src/zmq.cpp \ src/zmq_utils.cpp \ - src/decoder_allocators.hpp \ - src/decoder_allocators.cpp \ - src/socket_poller.hpp \ - src/socket_poller.cpp + src/decoder_allocators.cpp \ + src/decoder_allocators.hpp \ + src/socket_poller.cpp \ + src/socket_poller.hpp if USE_TWEETNACL src_libzmq_la_SOURCES += \ diff --git a/builds/gyp/platform.hpp b/builds/gyp/platform.hpp new file mode 100644 index 00000000..593d9ef9 --- /dev/null +++ b/builds/gyp/platform.hpp @@ -0,0 +1,72 @@ +/* + Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file + + This file is part of libzmq, the ZeroMQ core engine in C++. + + libzmq is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License (LGPL) as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + As a special exception, the Contributors give you permission to link + this library with independent modules to produce an executable, + regardless of the license terms of these independent modules, and to + copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the + terms and conditions of the license of that module. An independent + module is a module which is not derived from or based on this library. + If you modify this library, you must extend this exception to your + version of the library. + + libzmq 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 . +*/ + +#ifndef __ZMQ_PLATFORM_HPP_INCLUDED__ +#define __ZMQ_PLATFORM_HPP_INCLUDED__ + +// This file provides the configuration for Linux, Windows, and OS/X +// as determined by ZMQ_HAVE_XXX macros passed from project.gyp + +// Set for all platforms +#define ZMQ_HAVE_CURVE 1 +#define ZMQ_USE_TWEETNACL 1 + +#if defined ZMQ_HAVE_WINDOWS +# define ZMQ_USE_SELECT 1 + +#elif defined ZMQ_HAVE_OSX +# define ZMQ_USE_KQUEUE 1 +# define HAVE_POSIX_MEMALIGN 1 +# define ZMQ_HAVE_SO_KEEPALIVE 1 +# define ZMQ_HAVE_TCP_KEEPALIVE 1 +# define ZMQ_HAVE_TCP_KEEPCNT 1 +# define ZMQ_HAVE_TCP_KEEPINTVL 1 +# define ZMQ_HAVE_UIO 1 +# define HAVE_FORK 1 + +#elif defined ZMQ_HAVE_LINUX +# define ZMQ_USE_EPOLL 1 +# define HAVE_POSIX_MEMALIGN 1 +# define ZMQ_HAVE_EVENTFD 1 +# define ZMQ_HAVE_IFADDRS 1 +# define ZMQ_HAVE_SOCK_CLOEXEC 1 +# define ZMQ_HAVE_SO_KEEPALIVE 1 +# define ZMQ_HAVE_SO_PEERCRED 1 +# define ZMQ_HAVE_TCP_KEEPCNT 1 +# define ZMQ_HAVE_TCP_KEEPIDLE 1 +# define ZMQ_HAVE_TCP_KEEPINTVL 1 +# define ZMQ_HAVE_UIO 1 +# define HAVE_CLOCK_GETTIME 1 +# define HAVE_FORK 1 + +#else +# error "No platform defined, abandoning" +#endif + +#endif diff --git a/project.gyp b/project.gyp new file mode 100644 index 00000000..c67955b5 --- /dev/null +++ b/project.gyp @@ -0,0 +1,158 @@ +# +# This is the gyp script for libzmq +# +# Use: +# gyp --depth=. +{ + 'targets': [ + { + 'target_name': 'libzmq', + 'type': 'static_library', + 'sources': [ + 'include/zmq.h', + 'builds/gyp/platform.hpp', + 'src/address.cpp', 'src/address.hpp', + 'src/array.hpp', + 'src/atomic_counter.hpp', + 'src/atomic_ptr.hpp', + 'src/blob.hpp', + 'src/client.cpp', 'src/client.hpp', + 'src/clock.cpp', 'src/clock.hpp', + 'src/command.hpp', + 'src/condition_variable.hpp', + 'src/config.hpp', + 'src/ctx.cpp', 'src/ctx.hpp', + 'src/curve_client.cpp', 'src/curve_client.hpp', + 'src/curve_server.cpp', 'src/curve_server.hpp', + 'src/dbuffer.hpp', + 'src/dealer.cpp', 'src/dealer.hpp', + 'src/decoder.hpp', + 'src/devpoll.cpp', 'src/devpoll.hpp', + 'src/dish.cpp', 'src/dish.hpp', + 'src/dist.cpp', 'src/dist.hpp', + 'src/encoder.hpp', + 'src/epoll.cpp', 'src/epoll.hpp', + 'src/err.cpp', 'src/err.hpp', + 'src/fd.hpp', + 'src/fq.cpp', 'src/fq.hpp', + 'src/gssapi_mechanism_base.cpp', 'src/gssapi_mechanism_base.hpp', + 'src/gssapi_client.cpp', 'src/gssapi_client.hpp', + 'src/gssapi_server.cpp', 'src/gssapi_server.hpp', + 'src/i_encoder.hpp', + 'src/i_engine.hpp', + 'src/i_decoder.hpp', + 'src/i_mailbox.hpp', + 'src/i_poll_events.hpp', + 'src/io_object.cpp', 'src/io_object.hpp', + 'src/io_thread.cpp', 'src/io_thread.hpp', + 'src/ip.cpp', 'src/ip.hpp', + 'src/ipc_address.cpp', 'src/ipc_address.hpp', + 'src/ipc_connecter.cpp', 'src/ipc_connecter.hpp', + 'src/ipc_listener.cpp', 'src/ipc_listener.hpp', + 'src/kqueue.cpp', 'src/kqueue.hpp', + 'src/lb.cpp', 'src/lb.hpp', + 'src/likely.hpp', + 'src/mailbox.cpp', 'src/mailbox.hpp', + 'src/mailbox_safe.cpp', 'src/mailbox_safe.hpp', + 'src/mechanism.cpp', 'src/mechanism.hpp ', + 'src/metadata.cpp', 'src/metadata.hpp', + 'src/msg.cpp', 'src/msg.hpp', + 'src/mtrie.cpp', 'src/mtrie.hpp', + 'src/mutex.hpp', + 'src/norm_engine.cpp', 'src/norm_engine.hpp', + 'src/null_mechanism.cpp', 'src/null_mechanism.hpp', + 'src/object.cpp', 'src/object.hpp', + 'src/options.cpp', 'src/options.hpp', + 'src/own.cpp', 'src/own.hpp', + 'src/pair.cpp', 'src/pair.hpp', + 'src/pgm_receiver.cpp', 'src/pgm_receiver.hpp', + 'src/pgm_sender.cpp', 'src/pgm_sender.hpp', + 'src/pgm_socket.cpp', 'src/pgm_socket.hpp', + 'src/pipe.cpp', 'src/pipe.hpp', + 'src/plain_client.cpp', 'src/plain_client.hpp', + 'src/plain_server.cpp', 'src/plain_server.hpp', + 'src/poll.cpp', 'src/poll.hpp', + 'src/poller.hpp', 'src/poller_base.cpp', + 'src/poller_base.hpp', + 'src/proxy.cpp', 'src/proxy.hpp', + 'src/pub.cpp', 'src/pub.hpp', + 'src/pull.cpp', 'src/pull.hpp', + 'src/push.cpp', 'src/push.hpp', + 'src/radio.cpp', 'src/radio.hpp', + 'src/random.cpp', 'src/random.hpp', + 'src/raw_decoder.cpp', 'src/raw_decoder.hpp', + 'src/raw_encoder.cpp', 'src/raw_encoder.hpp', + 'src/reaper.cpp', 'src/reaper.hpp', + 'src/rep.cpp', 'src/rep.hpp', + 'src/req.cpp', 'src/req.hpp', + 'src/router.cpp', 'src/router.hpp', + 'src/select.cpp', 'src/select.hpp', + 'src/server.cpp', 'src/server.hpp', + 'src/session_base.cpp', 'src/session_base.hpp', + 'src/signaler.cpp', 'src/signaler.hpp', + 'src/socket_base.cpp', 'src/socket_base.hpp', + 'src/socks.cpp', 'src/socks.hpp', + 'src/socks_connecter.cpp', 'src/socks_connecter.hpp', + 'src/stdint.hpp', + 'src/stream.cpp', 'src/stream.hpp', + 'src/stream_engine.cpp', 'src/stream_engine.hpp', + 'src/sub.cpp', 'src/sub.hpp', + 'src/tcp.cpp', 'src/tcp.hpp', + 'src/tcp_address.cpp', 'src/tcp_address.hpp', + 'src/tcp_connecter.cpp', 'src/tcp_connecter.hpp', + 'src/tcp_listener.cpp', 'src/tcp_listener.hpp', + 'src/thread.cpp', 'src/thread.hpp', + 'src/timers.cpp', 'src/timers.hpp', + 'src/tipc_address.cpp', 'src/tipc_address.hpp', + 'src/tipc_connecter.cpp', 'src/tipc_connecter.hpp', + 'src/tipc_listener.cpp', 'src/tipc_listener.hpp', + 'src/trie.cpp', 'src/trie.hpp', + 'src/tweetnacl.c', 'src/tweetnacl.h', + 'src/udp_address.cpp', 'src/udp_address.hpp', + 'src/udp_engine.cpp', 'src/udp_engine.hpp', + 'src/v1_decoder.cpp', 'src/v1_decoder.hpp', + 'src/v2_decoder.cpp', 'src/v2_decoder.hpp', + 'src/v1_encoder.cpp', 'src/v1_encoder.hpp', + 'src/v2_encoder.cpp', 'src/v2_encoder.hpp', + 'src/v2_protocol.hpp', + 'src/vmci.cpp', 'src/vmci.hpp', + 'src/vmci_address.cpp', 'src/vmci_address.hpp', + 'src/vmci_connecter.cpp', 'src/vmci_connecter.hpp', + 'src/vmci_listener.cpp', 'src/vmci_listener.hpp', + 'src/windows.hpp', + 'src/wire.hpp', + 'src/xpub.cpp', 'src/xpub.hpp', + 'src/xsub.cpp', 'src/xsub.hpp', + 'src/ypipe.hpp', + 'src/ypipe_base.hpp', + 'src/ypipe_conflate.hpp', + 'src/yqueue.hpp', + 'src/zmq.cpp', + 'src/zmq_utils.cpp', + 'src/decoder_allocators.cpp', 'src/decoder_allocators.hpp', + 'src/socket_poller.cpp' 'src/socket_poller.hpp', + ], + 'include_dirs': [ + 'include', + 'builds/gyp' + ], + 'conditions': [ + [ 'OS=="win"', { + "defines": [ + "ZMQ_HAVE_WINDOWS=1" + ] + }], + [ 'OS=="mac"', { + "defines": [ + "ZMQ_HAVE_OSX=1" + ] + }], + [ 'OS=="linux"', { + "defines": [ + "ZMQ_HAVE_LINUX=1" + ] + }] + ] + } + ] +}