From 5fade792a45a7434f1b8c03e7835756ef8c2a672 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 6 Jul 2015 11:08:22 -0700 Subject: [PATCH 1/4] Use pkg-config in node's binding.gyp --- binding.gyp | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/binding.gyp b/binding.gyp index 83f72fab..e0220397 100644 --- a/binding.gyp +++ b/binding.gyp @@ -16,14 +16,45 @@ 'ldflags': [ '-g' ], - 'link_settings': { - 'libraries': [ - '-lpthread', - '-lgrpc', - '-lgpr' - ] - }, "conditions": [ + ['OS != "win"', { + 'variables': { + 'has_pkg_config': '/dev/null 2>&1 && echo true || echo false)' + }, + 'conditions': [ + ['has_pkg_config == "true"', { + 'link_settings': { + 'libraries': [ + ' Date: Mon, 6 Jul 2015 12:11:44 -0700 Subject: [PATCH 2/4] Link Node against static dependencies just in case --- binding.gyp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index e0220397..5b8c994a 100644 --- a/binding.gyp +++ b/binding.gyp @@ -25,14 +25,14 @@ ['has_pkg_config == "true"', { 'link_settings': { 'libraries': [ - ' Date: Mon, 6 Jul 2015 16:44:35 -0700 Subject: [PATCH 3/4] Only use pkg-config if grpc is installed --- binding.gyp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index 5b8c994a..b4debbda 100644 --- a/binding.gyp +++ b/binding.gyp @@ -19,10 +19,10 @@ "conditions": [ ['OS != "win"', { 'variables': { - 'has_pkg_config': '/dev/null 2>&1 && echo true || echo false)' + 'pkg_config_grpc': '/dev/null 2>&1 && echo true || echo false)' }, 'conditions': [ - ['has_pkg_config == "true"', { + ['pkg_config_grpc == "true"', { 'link_settings': { 'libraries': [ ' Date: Mon, 6 Jul 2015 17:27:46 -0700 Subject: [PATCH 4/4] Added other LDFLAGS to node gyp file --- binding.gyp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/binding.gyp b/binding.gyp index b4debbda..73797cf0 100644 --- a/binding.gyp +++ b/binding.gyp @@ -33,6 +33,9 @@ ], 'libraries': [ '