Commit Graph

198 Commits

Author SHA1 Message Date
Luca Boccassi
6585aeaba2 Merge pull request #2195 from vyskocilm/master
Problem: curve_keygen not build unless --enable-curve is passed
2016-11-05 17:13:00 +01:00
Michal Vyskocil
213a7efe86 Problem: curve_keygen not build unless --enable-curve is passed
Solution: test ENABLE_CURVE_KEYGEN and enable it only if
zmq_enable_curve_keygen=yes nad enable_curve=yes. Additionally set
enable_curve=yes for libsodium and tweetnacl, so it is enabled
implicitly and fixes the problem.
2016-11-05 10:51:10 +01:00
Luca Boccassi
6da8385b2a Problem: new public symbols added
Solution: bump ABI version fromo 5:0:0 to 6:0:1 since 4.2 is backward
compatible with 4.1, but new symbols are there
2016-11-01 13:18:21 +00:00
Luca Boccassi
06d810b4c9 Problem: pkg-config Requires.private is broken
Solution: use only Libs.private to avoid breaking application builds.
Even though Requires.private are supposed to be parsed only if
pkg-config is called with --static, the --cflags parameter is enough
to trigger the parsing, causing build failures for applications that
do not (and should not) depend on libzmq's dependencies.
2016-09-27 23:34:35 +01:00
Luca Boccassi
6d9411607d Problem: pkgconfig file does not support static link
Solution: add dependencies, if necessary, to the .private Libs and
Requires field of the pkgconfig file at build time.
This way pkg-config --static --libs libzmq will correctly print
dependencies if they were used to build the static libzmq.a library.
2016-09-27 18:39:07 +01:00
Luca Boccassi
0372e5ce22 Problem: spec file needs version before build on OBS
Solution: stop autogenerating it and hard code version so that the
OBS build service can extract it and use it to build packages
automatically
2016-07-31 17:10:33 +01:00
camachat
5e684172d6 Fix build with NORM enabled on FreeBSD. (#2066) 2016-07-27 19:42:35 +01:00
Sam Lishak
d49e43bbc8 Problem: FD_SETSIZE not set to 16k for all build definitions
Solution: Set FD_SETSIZE to 16k for all other build definitions.
2016-06-13 09:42:54 +01:00
Waldemar Brodkorb
492a035706 allow to build sparc (v8,leon)
Only set sparcv9 optimization for sparc64 systems.
This allows to run for example application using zeromq
on sparc32 systems.

Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-06-04 13:40:14 +02:00
David Millard
9e6745c12e Fix autotools for static MinGW builds 2016-05-10 13:53:53 -07:00
hitstergtd
8fc985a9b0 Problem: style/typo issue
Solution:
Fix it.
2016-05-09 14:24:12 +01:00
Luca Boccassi
bb5037e855 Problem: leftover commented out line in configure
Solution: clean up and remove it
2016-05-06 21:34:43 +01:00
Luca Boccassi
8045e9ae24 Problem: no backtrace is printed on assert
Solution: add an optional dependency on libunwind, and if present
use it to print the backtrace when zmq_abort is called.
2016-05-06 21:34:25 +01:00
Luca Boccassi
064cd1fbfb Problem: no support for DRAFT API in build systems
Solution: add support for --enable-drafts/ENABLE_DRAFTS=ON in
Autools and CMake.
2016-05-02 21:47:05 +01:00
Luca Boccassi
b1232a0fd8 Problem: Solaris build fails with libsodium
Solution: disable pedantic and Werror, as libsodium headers use
pragma diagnostic which are not available in gcc 3.4.
2016-04-13 00:32:19 +01:00
Luca Boccassi
abe44500de Problem: tweetnacl does not build on Solaris 10
Solution: add Wnosign-compare to CPPFLAGS. GCC version is too old on
Solaris 10 to use pragma diagnostic (min 4.2 needed, but 3.4 is
available)
2016-04-13 00:31:58 +01:00
Luca Boccassi
f18463f323 Problem: mkdtemp not available on all platforms
Solution: check for availability in autoconf and cmake, and if not
available fall back to random file name rather than random directory.
2016-04-11 00:18:51 +01:00
Pieter Hintjens
6a78b3ec19 Problem: HAVE_LIBSODIUM macro is inconsistent
Solution: use ZMQ_USE_LIBSODIUM to match ZMQ_USE_TWEETNACL
2016-03-30 14:19:20 +02:00
Luca Boccassi
2b2f9046d4 Problem: no Makefile target for Valgrind
Solution: import ax_valgrind_check.m4 macro file to provide a
conveniente automake hook to run Valgrind on all tests.
Add --enable-valgrind to ./configure call and then run make
check-valgrind to run memcheck, helgrind, drd and sgcheck on all
tests. Run check-valgrind-memcheck to run only memcheck.
2016-03-19 21:54:29 +00:00
Luca Boccassi
6df753c55a Problem: no code coverage integration
Solution: import ax_code_coverage.m4 from autoconf-archive and use it
in configure.ac and Makefile.am in order to provide a make
check-code-coverage target behind a --enable-code-coverage configure
flag, that can be used to generate a gcov/lcov code coverage report.
Depends on having gcov and lcov installed.
2016-03-13 19:28:23 +00:00
Luca Boccassi
693d6384b6 Merge pull request #1837 from obache/neatsrc/fix-test-portability
Problem: Fix unportable `==` operator for `test`
2016-03-04 09:41:15 +00:00
OBATA Akio
55dad06cce Problem: Fix unportable == operator for test 2016-03-04 17:17:04 +09:00
OBATA Akio
09e868b743 Problem: Fix build with Heimdal krb5
Solution:
* Check gssapi/gssapi_generic.h header file, it is not in Heimdal.
* Check libgssapi too, libgssapi_krb5 is not separated in Heimdal.
2016-03-04 16:38:57 +09:00
Jim Garlick
54389fefb5 Problem: AS_HELP_STRING improperly quoted
Brackets around defaults in configure --help strings for
--with-libsodium and --disable-curve were not displayed.

Solution:  Add m4 quotes.
2016-03-02 12:11:08 -08:00
Jim Garlick
9d75a9c27d Problem: AM_CONDITIONAL is used incorrectly
Move AM_CONDITIONAL for --disable-curve outside of shell
conditional (per sec 20.1 of automake manual) and fix its
second argument to be a test rather than a literal zero.
2016-03-02 11:28:42 -08:00
Luca Boccassi
7dfbab3f97 Problem: it's 2016 and we are building with C++98
Solution: bump to C++11 and C11 in autoconf
2016-02-19 21:49:38 +00:00
Luca Boccassi
b9f1e3ed61 Problem: writing autoconf macros is boring
Solution: import macros to check for compiler options from
autoconf-archive into the m4 subdir.
2016-02-19 21:41:24 +00:00
Pieter Hintjens
94c7087e36 Problem: piece of garbage ended up in configure.ac
Solution: remove it
2016-02-17 12:40:44 +01:00
Pieter Hintjens
7129187f87 Problem: getting various warnings in tweetnacl
libzmq used to switch off pedantic checks when using tweetnacl. As
this is now the default, that means pedantic checks are always off.
This is not good.

Solution: in tweetnacl.c alone, use a GCC pragma to disable sign
comparison warnings. We could also clean the code up yet this is
simpler. In other code, we still want those warnings, hence I've
used a pragma rather than global compile option.

Second, use -Wno-long-long all the time, as this warning does not
work with a pragma.

I removed code that set -wno-long-long, for MinGW and Solaris.

Related problem 2: --with-relaxed is badly named

This option switches off pedantic checks, so should be called
--disable-pedantic. 'with' is for optional packages.
2016-02-17 12:06:45 +01:00
Luca Boccassi
f777ad8b91 Problem: typo in configure.ac, can't use libsodium
Solution: set the curve_library variable to the expected value if
libsodium is selected
2016-02-11 20:30:07 +00:00
Pieter Hintjens
f8ed793f76 Problem: tweetnacl sources are a mess
- they have no copyright / license statement
- they are in some randomish directory structure
- they are a mix of postable and non-portable files
- they do not conform to conditional compile environment

Overall, it makes it rather more work than needed, in build scripts.

Solution: clean up tweetnacl sauce.

- merged code into single tweetnacl.c and .h
- standard copyright header, DJB to AUTHORS
- moved into src/ along with all other source files
- all system and conditional compilation hidden in these files
- thus, they can be compiled and packaged in all cases
- ZMQ_USE_TWEETNACL is set when we're using built-in tweetnacl
- HAVE_LIBSODIUM is set when we're using external libsodium
2016-02-11 18:06:07 +01:00
Pieter Hintjens
e65367ea2d Problem: some configure options are confusing
It's especially annoying to see this:

  --enable-perf           Build performance measurement tools [default=yes].
  --disable-eventfd       disable eventfd [default=no]
  --enable-curve-keygen   Build curve key-generation tool [default=yes].

Solution: all options should explain the non-default case. Also
the language should be enable/disable, with/without, rather than
yes/no. E.g. '--without-docs'.
2016-02-11 16:52:41 +01:00
Pieter Hintjens
9f8ced3f65 Problem: autotools platform.hpp is not compatible with CMake
Specifically, the poller detection code does not set macros in
platform.hpp. The configure script passed them as -D on the command
line.

Solution: rewrite the poller detection code.
2016-02-11 16:14:12 +01:00
Pieter Hintjens
b49a60410a Problem: use of libsodium vs. tweetnacl is confused
It's unclear which we need and in the source code, conditional code
treats tweetnacl as a subclass of libsodium, which is inaccurate.

Solution: redesign the configure/cmake API for this:

* tweetnacl is present by default and cannot be enabled
* libsodium can be enabled using --with-libsodium, which replaces
  the built-in tweetnacl
* CURVE encryption can be disabled entirely using --enable-curve=no

The macros we define in platform.hpp are:

    ZMQ_HAVE_CURVE    1        //  When CURVE is enabled
    HAVE_LIBSODIUM    1        //  When we are using libsodium
    HAVE_TWEETNACL    1        //  When we're using tweetnacl (default)

As of this patch, the default build of libzmq always has CURVE
security, and always uses tweetnacl.
2016-02-11 13:32:01 +01:00
Luca Boccassi
6681bcf08c Problem: tweetnacl/contrib/randombytes need C++0x
Solution: disable -pedantic when building with tweetnacl to avoid
warning about "long long" not existing in ISO C++ 98
2016-02-08 12:31:05 +00:00
Min RK
e86650794f fallback on tweetnacl if libsodium is not found and not explicitly requested 2016-02-08 11:58:30 +01:00
Min RK
2902fd60b9 add --with-tweetnacl to configure
allows building with tweetnacl without cmake
2016-02-08 11:40:50 +01:00
Michael
0463926db8 change references from mingw32 to mingw
conformity update for mingw32 variables to mingw
2016-02-03 23:51:52 +11:00
Laszlo Boszormenyi (GCS)
be387d5e56 Last bits of Hurd support 2016-01-20 07:18:22 +01:00
Laszlo Boszormenyi (GCS)
be5ab6d5c9 GNU/Hurd support 2016-01-16 02:26:20 +01:00
Pieter Hintjens
055995e535 Problem: builds directory contains packaging scripts
Specifically, the RedHat tools.

Solution: move this into packaging/
2016-01-15 10:25:38 +01:00
Ilya Kulakov
141de87085 Fix a typo in reference to with_norm_ext. 2015-12-09 15:45:15 +06:00
Luca Boccassi
64ce6ca772 Problem: build fails, vmci enabled by default
Solution: disable vmci by default
Fixes issue #1655
2015-12-08 17:58:31 +00:00
Ilya Kulakov
68b13fbddb Add the VMCI transport.
VMCI transport allows fast communication between the Host
and a virtual machine, between virtual machines on the same host,
and within a virtual machine (like IPC).

It requires VMware to be installed on the host and Guest Additions
to be installed on a guest.
2015-12-08 13:16:09 +06:00
Jeroen Ooms
9114d39577 enable static libraries on mingw 2015-10-20 13:10:38 +02:00
Anthony Scemama
aefc5d120b Default behavior is --with-libsodium=yes 2015-10-07 22:18:08 +02:00
Anthony Scemama
73a0eed75d Fixes issue #1556 2015-10-07 21:45:49 +02:00
Markus Pfeiffer
ee984b1fe6 Make DragonFly a first class citizen in terms of compilation 2015-09-03 09:00:12 +01:00
Pieter Hintjens
5d5cdac161 Problem: source packages lack makefiles for all systems except msvc
Solution: specify the necessary EXTRA_DIST

I added a Makefile.am in builds that covers all systems except msvc,
which already has a Makefile.am that does this.

Fixes #1505
2015-08-11 19:34:25 +02:00
Pieter Hintjens
6f1d1142d1 Problem: 4.1 broke the ABI yet did not bump ABI number
Solution: bump to ABI version 5
2015-06-11 23:53:23 +02:00
Michael
166a14c4a5 Update configure.ac 2015-05-02 01:13:33 +10:00
Michael
bd795d6f7a Update configure.ac 2015-05-02 01:12:22 +10:00
Michael
095741cd9c set FD_SETSIZE to 1024 on mingw
Sets FD_SETSIZE to 1024 under mingw systems, increasing it from the default of 64, and brings it into line with the previous limit for CMake builds on mingw.
2015-05-02 01:11:54 +10:00
Constantin Rack
cd830dd203 Merge pull request #1378 from CommanderBubble/master
Allow configure to support mingw64
2015-04-21 14:15:14 +02:00
Martin Natano
8957ad5edf Add Bitrig to OS detection in configure.ac. 2015-04-17 22:14:53 +02:00
Michael
c9bdcfc584 allow host_os to accept mingw64
Changes the pattern for the host_os matches to *mingw* from *mingw32* to accept both mingw32 and mingw64 versions.
2015-04-16 00:40:32 +10:00
Florian Ebeling
54b56210ad Problem: curve keygen build cannot be switched off 2015-02-07 15:36:14 +01:00
Florian Ebeling
2d59594a3a Problem: perf tools build cannot be switched off 2015-02-07 15:36:14 +01:00
Thomas Rodgers
e6c45f5376 Support using compielr intrinsics for atomic operations
Works with GCC and most likely clang
2015-01-28 10:27:15 -06:00
Thomas Rodgers
6372fc2e56 Align inter-thread shared structers on cache-line granularity
Specifically ypipe_t specializations for msg_t and command_t.

Currently only supports platforms where posix_memalign is available.
2015-01-12 13:37:32 -06:00
DaiyuHurst
5d084cdfdd Implement a definitive cygwin target for libzmq. 2014-12-29 17:39:19 -05:00
Phillip Mienk
510eabaec8 Alter --with-libsodium default. 2014-12-04 14:09:14 -08:00
J.T. Conklin
10c18f7408 Support both --enable-eventfd and --disable-eventfd options. 2014-10-28 05:03:31 -07:00
Phillip Mienk
1735c1e462 Add --with-libgssapi_krb5 to match libsodium and pgm. 2014-10-25 01:10:53 -07:00
Arnaud Kapp
216caee1b3 Improve build script error checking.
This commit adds a check to make sure pkg-config is present on the
computer building libzmq.
This particular line was stolen from the debian mailing list.
See https://lists.debian.org/debian-dpkg/2011/04/msg00054.html
2014-10-21 22:27:38 +02:00
J.T. Conklin
64a92cce49 Support both --with-* and --without-* options for libsodium and pgm 2014-10-18 16:49:46 -07:00
Phillip Mienk
8cf5e9fd48 Correct declaration of HAVE_LIBSODIUM. 2014-10-16 04:44:21 -07:00
Phillip Mienk
c8ee16940f Require pkg-config, use pkg-config to pull seek libsodium. 2014-10-16 00:37:57 -07:00
Phillip Mienk
00b3bfab10 Remove local pgm configuration option, cleanup configure.ac, remove unused Makefile.am instances. 2014-10-13 19:10:36 -07:00
Phillip Mienk
c6aedc3837 Partial migration to nonrecursive make. 2014-10-10 14:36:12 -07:00
Pieter Hintjens
b4ed3f5506 Problem: API violations are treated as recoverable errors
The example is applications passing invalid arguments to a socket option
and then failing to check the return code. The results can be very hard
to diagnose. Here are some threads that show the pain this causes:

* https://github.com/zeromq/zyre/issues/179
* http://lists.zeromq.org/pipermail/zeromq-dev/2014-June/026388.html

One common argument is that a library should never assert, and should
pass errors back to the calling application. The counter argument is
that when an application is broken enough to pass garbage to libzmq,
it cannot be trusted to handle the resulting errors properly. Empirical
evidence from CZMQ, where we systematically assert on bad arguments, is
that this militant approach makes applications more, not less, robust.

I don't see any valid use cases for returning errors on bad arguments,
with one exception: zmq_setsockopt can be used to probe whether libzmq
was e.g. built with CURVE security. I'd argue that it's nasty to use a
side effect like this. If apps need to probe how libzmq was built, this
should be done explicitly, and for ALL build options, not just CURVE.

There are/were no libzmq test cases that check the return code for an
invalid option.

For now I've enabled militant assertions using --with-militant at
configure time. However I'd like to make this the default setting.
2014-06-17 16:00:55 +02:00
Samuel Martin
6fdafc458a autotools: tests: disable test_fork if fork() is not available
fork() support is optional and its availability is correctly detected at
contfigure time.

But test_fork was all always built, preventing build for targets that do
not provide fork() from building successfully.

This pacth fixes the autotools on this point.
2014-05-03 21:55:03 +02:00
Pieter Hintjens
cac0f9838d Problem: generates incompatible libzmq.so.3.1.0
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743508

The ABI in fact changed in two significant ways, one with inproc
connects, and one with socket monitoring

Solution: generate libzmq.so.4.0.0 library instead.

This change should be backported to zeromq-4.x
2014-05-01 16:12:51 +02:00
Mike Gatny
1445516c41 Establishing GSSAPI sec context is working now 2014-04-24 14:17:36 -07:00
bebopagogo
33f22d0d04 added norm_engine 2014-03-15 10:48:12 -04:00
Drew Crawford
6009e2c6c4 Libsodium is now required if and only if --with-libsodium is used
This patch is proposed for https://github.com/zeromq/libzmq/issues/912.  If a user specifies that they want libzmq built with libsodium, and the requirement cannot be satisfied, we should error at the user so they can either A) install libsodium to a reasonable location or B) relax their requirement for libsodium support.

Previously a warning was issued in this case, causing users who wanted libsodium support not to get it, which may be discovered at a much later time when their programs didn't work as expected.

I release this patch under the LGPL v3 or any later version.
2014-03-10 13:59:33 -05:00
Brandon Carpenter
a018ef5e86 Add support for extending ZAP request address with IPC peer credentials.
Another take on LIBZMQ-568 to allow filtering IPC connections, this time
using ZAP.  This change is backward compatible.  If the
ZMQ_ZAP_IPC_CREDS option is set, the user, group, and process IDs of the
peer process are appended to the address (separated by colons) of a ZAP
request; otherwise, nothing changes.  See LIBZMQ-568 and zmq_setsockopt
documentation for more information.
2013-12-06 14:28:44 -08:00
Brandon Carpenter
f0bd333728 Move {SO,LOCAL}_PEERCRED checks to C++ context. 2013-12-06 10:59:07 -08:00
Brandon Carpenter
af808203d7 Fix failing test case in test_filter_ipc.
Add explicit check for primary group.
2013-12-06 00:46:14 -08:00
Brandon Carpenter
8662f44efa Intial IPC accept filter support.
Adds sets of process (Linux only), user, and group IDs for filtering
connections from peer processes over IPC transport.  If all of the
filter sets are empty, every connection is accepted.  Otherwise,
credentials for a connecting process are checked against the filter sets
and the connection is only accepted if a match is found.

This commit is part of LIBZMQ-568 and only adds the filter sets and
implements the filter in the IPC accept method.  The interface for
adding IDs to filter sets are included in a separate commit.

IPC accept filtering is supported only on Linux and OS X.
2013-12-04 14:12:29 -08:00
Erik Hugne
58ac87def1 zmq: narrow condition to include TIPC in build/test
As TIPC transport for 0MQ will only work on post 3.8
Linux kernels where nonblocking connect was added,
we add AC_RUN test to check for this functionality.
Should the test fail, tipc is excluded from build/test.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
2013-11-01 14:59:31 +01:00
Pieter Hintjens
65050b1b03 Added --with-relaxed to disable pedantic compiles 2013-10-24 03:31:02 +02:00
Brandon Carpenter
f499c89528 Add test for abstract namespace support in ipc sockets on Linux.
See issue 567.
2013-10-04 11:33:52 -07:00
Matt Connolly
7660b78e12 config for libsodium in alternate path, using CPP flags for both C and C++ sources. 2013-09-29 21:20:14 +10:00
Matt Connolly
848ce1adb1 Disable compiler warning for Solaris 2013-09-27 11:20:09 +00:00
Matt Connolly
aa84e85153 Add '-lssp' linker flag for Solaris. Check for libraries after host specific setup. 2013-09-27 11:12:16 +00:00
Richard Newton
5f0a8dcffe Merge pull request #680 from hintjens/master
Bumped library version and age
2013-09-24 00:24:45 -07:00
Pieter Hintjens
186b713aba Bumped library version and age 2013-09-24 09:10:39 +02:00
Matt Connolly
12eef06e45 Update configure: Allow libsodium to be installed in a custom path 2013-09-24 08:07:43 +10:00
Matt Connolly
0478ee04f4 Adding test showing failure to close socket/context in forked child 2013-09-01 20:42:10 +10:00
Pieter Hintjens
7041770108 Added Z85 support
The use of binary for CURVE keys is painful; you cannot easily copy
these in e.g. email, or use them directly in source code. There are
various encoding possibilities. Base16 and Base64 are not optimal.
Ascii85 is not safe for source (it generates quotes and escapes).

So, I've designed a new Base85 encoding, Z85, which is safe to use
in code and elsewhere, and I've modified libzmq to use this where
it also uses binary keys (in get/setsockopt).

Very simply, if you use a 32-byte value, it's Base256 (binary),
and if you use a 40-byte value, it's Base85 (Z85).

I've put the Z85 codec into z85_codec.hpp, it's not elegant C++
but it is minimal and it works. Feel free to rewrap as a real class
if this annoys you.
2013-06-28 22:10:22 +02:00
Ian Barber
211bf2b08e Added security curve test
Test is skipped if no libsodium.
Added warning if libsodium not configured
2013-06-22 16:17:25 +01:00
Jose Pedro Oliveira
42ab0e8217 Make
./configure --with-system-pgm
detect the OpenPGM 5.2 system library.

Note that OpenPGM installs a versioned pkgconfig file
(openpgm-5.2.pc, openpgm-5.1.pc).
2013-06-01 03:39:40 +01:00
Pieter Hintjens
e918fd4d69 Use correct libsodium call for detection 2013-05-07 14:47:07 +02:00
Pieter Hintjens
fa346fddd3 Added configure check for libsodium 2013-04-28 18:38:15 +02:00
Pieter Hintjens
cb69986d74 Comment change 2013-03-12 13:24:57 +01:00
MinRK
21c97f0cc2 AM_CONFIG_HEADER -> AC_CONFIG_HEADERS
AM_CONFIG_HEADER raises an 'obsolete error' with automake 1.13.
2013-01-17 16:00:38 -08:00
MinRK
64c019e24d move configure.in -> configure.ac
autotools warns that configure.in
should actually be named configure.ac
2013-01-17 15:59:11 -08:00