Skip to content

Commit

Permalink
Merge pull request zeromq#1809 from hintjens/master
Browse files Browse the repository at this point in the history
Number of fixes for gyp builds
  • Loading branch information
c-rack committed Feb 17, 2016
2 parents df6876a + 94c7087 commit 7200f47
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 32 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ autom4te.cache
*.html
*.pdf
*.ps
.*
*~
.*~
.deps
.dirstamp
.libs
curve_keygen
test_heartbeats
test_msg_ffn
Expand Down Expand Up @@ -170,6 +172,3 @@ zeromq-*.zip
core
build
test-suite.log
project.Makefile
libzmq.target.mk
out/
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ set (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
# platform specifics

if (WIN32)
# Socket limit is 4K (can be raised arbitrarily)
add_definitions (-DFD_SETSIZE=4096)
# Socket limit is 16K (can be raised arbitrarily)
add_definitions (-DFD_SETSIZE=16384)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
endif ()

Expand Down
5 changes: 5 additions & 0 deletions builds/gyp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project.Makefile
*.mk
out/
Makefile

5 changes: 5 additions & 0 deletions builds/gyp/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
// This file provides the configuration for Linux, Windows, and OS/X
// as determined by ZMQ_HAVE_XXX macros passed from project.gyp

// Check that we're being called from our gyp makefile
#ifndef ZMQ_GYP_BUILD
# error "foreign platform.hpp detected, please re-configure"
#endif

// Set for all platforms
#define ZMQ_HAVE_CURVE 1
#define ZMQ_USE_TWEETNACL 1
Expand Down
32 changes: 25 additions & 7 deletions builds/gyp/project.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#
# gyp --depth=. --format=make
# make
#
{
'includes': [
'project-tests.gypi',
Expand All @@ -16,13 +15,18 @@
'.'
],
'defines': [
'ZMQ_CUSTOM_PLATFORM_HPP'
'_REENTRANT',
'_THREAD_SAFE',
'ZMQ_CUSTOM_PLATFORM_HPP',
'ZMQ_GYP_BUILD'
],
'conditions': [
[ 'OS=="win"', {
'defines': [
'ZMQ_HAVE_WINDOWS=1',
'ZMQ_STATIC'
'ZMQ_HAVE_WINDOWS',
'ZMQ_STATIC',
'FD_SETSIZE=16384',
'_CRT_SECURE_NO_WARNINGS'
],
'libraries': [
'ws2_32',
Expand All @@ -32,12 +36,18 @@
}],
[ 'OS=="mac"', {
'defines': [
'ZMQ_HAVE_OSX=1'
]
'ZMQ_HAVE_OSX'
],
'xcode_settings': {
'GCC_ENABLE_CPP_RTTI': 'YES'
}
}],
[ 'OS=="linux"', {
'defines': [
'ZMQ_HAVE_LINUX=1'
'ZMQ_HAVE_LINUX'
],
'cflags_cc!': [
'-fno-rtti'
],
'libraries': [
'-lpthread'
Expand Down Expand Up @@ -263,6 +273,14 @@
'../../src/yqueue.hpp',
'../../src/zmq.cpp',
'../../src/zmq_utils.cpp'
],
'copies': [
{
'destination': '../../src',
'files': [
'platform.hpp'
]
}
]
}
]
Expand Down
24 changes: 5 additions & 19 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,9 @@ AC_RUN_IFELSE(

AC_MSG_RESULT([$libzmq_tipc_support])

AC_ARG_WITH([relaxed],
[AS_HELP_STRING([--with-relaxed],
[switch off pedantic compiler])],
[zmq_relaxed="yes"],
[])

if test "x$zmq_relaxed" = "xyes"; then
libzmq_pedantic="no"
else
libzmq_pedantic="yes"
fi
AC_ARG_ENABLE([pedantic],
[AS_HELP_STRING([--disable-pedantic], [disable pedantic compiler checks [default=enabled]])],
[libzmq_pedantic=$enableval], [libzmq_pedantic=yes])

AC_ARG_WITH([militant],
[AS_HELP_STRING([--with-militant],
Expand All @@ -137,8 +129,8 @@ libzmq_on_android="no"
libzmq_on_linux="no"
libzmq_on_gnu="no"

# Set some default features required by 0MQ code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
# Set some default features required by ZeroMQ code
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -Wno-long-long $CPPFLAGS"

# For host type checks
AC_CANONICAL_HOST
Expand Down Expand Up @@ -255,10 +247,6 @@ case "${host_os}" in
[AC_MSG_ERROR([cannot link with rpcrt4.dll.])])
AC_CHECK_LIB(iphlpapi, main, ,
[AC_MSG_ERROR([cannot link with iphlpapi.dll.])])
# mingw defines __int64_t as long long
AC_LANG_PUSH([C++])
LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-long-long])
AC_LANG_POP([C++])
libzmq_on_mingw="yes"
libzmq_dso_visibility="no"

Expand Down Expand Up @@ -450,15 +438,13 @@ elif test "x$with_libsodium" == "xyes"; then
case "${host_os}" in
*solaris*)
LDFLAGS="-lssp $LDFLAGS"
CPPFLAGS="-Wno-long-long $CPPFLAGS"
;;
esac
else
AC_MSG_NOTICE([Using tweetnacl for CURVE security])
AC_DEFINE(ZMQ_HAVE_CURVE, [1], [Using curve encryption])
AC_DEFINE(ZMQ_USE_TWEETNACL, [1], [Using tweetnacl for curve encryption])
curve_library="tweetnacl"
libzmq_pedantic="no" # Disable pedantic warnings
fi

AM_CONDITIONAL(USE_LIBSODIUM, test "$curve_library" == "libsodium")
Expand Down
2 changes: 2 additions & 0 deletions src/tweetnacl.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "platform.hpp"
#if defined (ZMQ_USE_TWEETNACL)

#pragma GCC diagnostic ignored "-Wsign-compare"

#include "tweetnacl.h"

#define FOR(i,n) for (i = 0;i < n;++i)
Expand Down
1 change: 1 addition & 0 deletions src/tweetnacl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define TWEETNACL_H

#include "platform.hpp"

#if defined (ZMQ_USE_TWEETNACL)

#define crypto_box_SECRETKEYBYTES 32
Expand Down

0 comments on commit 7200f47

Please sign in to comment.