Solution: set SOVERSION in CMakeLists to match the SONAME generated
by libtool so that there is no mismatch between the output of the
*NIX build systems.
Before:
$ ls -l
total 2696
lrwxrwxrwx 1 luca luca 15 Dec 1 22:36 libzmq.so -> libzmq.so.4.2.0
lrwxrwxrwx 1 luca luca 15 Dec 1 22:36 libzmq.so.4.2.0 -> libzmq.so.4.2.1
-rwxr-xr-x 1 luca luca 906168 Dec 1 22:36 libzmq.so.4.2.1
$ readelf -d libzmq.so.4.2.1 | grep SONAME
0x000000000000000e (SONAME) Library soname: [libzmq.so.4.2.0]
After:
$ ls -l
total 2700
lrwxrwxrwx 1 luca luca 15 Dec 1 22:31 libzmq.so -> libzmq.so.5.1.0
-rwxr-xr-x 1 luca luca 906168 Dec 1 22:31 libzmq.so.4.2.1
lrwxrwxrwx 1 luca luca 15 Dec 1 22:31 libzmq.so.5.1.0 -> libzmq.so.4.2.1
$ readelf -d libzmq.so.4.2.1 | grep SONAME
0x000000000000000e (SONAME) Library soname: [libzmq.so.5.1.0]
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.
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.
Solution:
Add CMake option called WITH_MILITANT so that it aligns with the Autotools
build infrastructure; enabling this option defines ZMQ_ACT_MILITANT, which
enables assertions should malformed requests make their way into
zmq_setsockopt(3) or zmq_getsockopt(3).
Solution: add macro in ZMQSourceRunChecks.cmake and optionally
include the TIPC sources if the support is available.
More importantly, only run the TIPC tests if the support is there.
Solution: Add precompiled flags to CMakeList.txt for faster compiles
+ bonus - removed compilation warning on Windows by adding
add_definitions (-D_WINSOCK_DEPRECATED_NO_WARNINGS)
Solution: it's a lot of work to define the tests in project.gyp
so I did this using gsl to generate the JSON, from a small XML
list of the test cases.
To keep this, and the hundreds of .mk files, away from the root
directory, I've moved the gyp files into builds/gyp, where you
would run them.
It all seems to work now. Next up, OS/X and Windows :)
- 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
This happens if you first configure with autotools, and then run
cmake. The problem is that the compiler finds the old src/platform.hpp
before looking for the one generated by CMake. Further, there are a
set of macros that configure passes via the command line, yet CMake
passes via platform.hpp. (HAVE_xxx for pollers, at least.) This means
you can't do a CMake build using the autotools platform.hpp.
Solution: remove any src/platform.hpp when running cmake. This is a
workaround. I'll fix the inconsistent macros separately.
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.
Solution: bump CMake required version to 2.8.12 to avoid:
CMake Error at tests/CMakeLists.txt:110 (target_include_directories):
Unknown CMake command "target_include_directories".