From c78e4f33a3f486765bd6809c0be2e467fd4de154 Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Fri, 12 Feb 2016 22:16:35 +0100 Subject: [PATCH] Problem: if src/platform.hpp still exists, gyp uses this Gyp needs its own platform.hpp; there is no way to delete this file automatically. Solution: copy gyp's platform.hpp into src, so that things build properly no matter what the starting state. If you build with gyp and then try to build using autotools' makefile, you'll get an error from the platform.hpp. --- builds/gyp/platform.hpp | 5 +++++ builds/gyp/project.gyp | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/builds/gyp/platform.hpp b/builds/gyp/platform.hpp index ae3db3e3..0b50178d 100644 --- a/builds/gyp/platform.hpp +++ b/builds/gyp/platform.hpp @@ -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 diff --git a/builds/gyp/project.gyp b/builds/gyp/project.gyp index f8323a0c..37130338 100644 --- a/builds/gyp/project.gyp +++ b/builds/gyp/project.gyp @@ -15,7 +15,10 @@ '.' ], 'defines': [ - 'ZMQ_CUSTOM_PLATFORM_HPP' + '_REENTRANT', + '_THREAD_SAFE', + 'ZMQ_CUSTOM_PLATFORM_HPP', + 'ZMQ_GYP_BUILD' ], 'conditions': [ [ 'OS=="win"', { @@ -264,6 +267,14 @@ '../../src/yqueue.hpp', '../../src/zmq.cpp', '../../src/zmq_utils.cpp' + ], + 'copies': [ + { + 'destination': '../../src', + 'files': [ + 'platform.hpp' + ] + } ] } ]