You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/12/21 19:31:15 UTC

[4/4] mesos git commit: Fixed compilation for python eggs when gRPC is enabled.

Fixed compilation for python eggs when gRPC is enabled.

Review: https://reviews.apache.org/r/64763/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/63f116a5
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/63f116a5
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/63f116a5

Branch: refs/heads/master
Commit: 63f116a54e4a67d08535d9ddd03f1343ec0181a1
Parents: 1a365b7
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
Authored: Thu Dec 21 11:03:41 2017 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu Dec 21 11:03:41 2017 -0800

----------------------------------------------------------------------
 src/python/native_common/ext_modules.py.in | 28 +++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/63f116a5/src/python/native_common/ext_modules.py.in
----------------------------------------------------------------------
diff --git a/src/python/native_common/ext_modules.py.in b/src/python/native_common/ext_modules.py.in
index 47c2d24..cc4c6a4 100644
--- a/src/python/native_common/ext_modules.py.in
+++ b/src/python/native_common/ext_modules.py.in
@@ -124,6 +124,34 @@ def _create_module(module_name):
     if os.path.exists(libprofiler):
         EXTRA_OBJECTS.append(libprofiler)
 
+
+    # We need to check for the presense of libgrpc++.a, libgrpc.a and libgpr.a
+    # only if gRPC is enabled.
+    if '@ENABLE_GRPC_FALSE@' == '#':
+        grpc = os.path.join('3rdparty', 'grpc-1.4.2')
+        libgrpcxx = os.path.join(abs_top_builddir, grpc, 'libs', 'opt', 'libgrpc++.a')
+        libgrpc = os.path.join(abs_top_builddir, grpc, 'libs', 'opt', 'libgrpc.a')
+        libgpr = os.path.join(abs_top_builddir, grpc, 'libs', 'opt', 'libgpr.a')
+
+        if os.path.exists(libgrpcxx):
+            EXTRA_OBJECTS.append(libgrpcxx)
+        else:
+            EXTRA_OBJECTS.append('-lgrpc++')
+
+        if os.path.exists(libgrpc):
+            EXTRA_OBJECTS.append(libgrpc)
+        else:
+            EXTRA_OBJECTS.append('-lgrpc')
+
+        if os.path.exists(libgpr):
+            EXTRA_OBJECTS.append(libgpr)
+        else:
+            EXTRA_OBJECTS.append('-lgpr')
+
+        EXTRA_OBJECTS.append('-lssl')
+        EXTRA_OBJECTS.append('-lcrypto')
+
+
     # OSX uses a different linker (llvm-ld) and doesn't support --as-needed
     # TODO(SteveNiemitz): Feature detect --as-needed instead of looking at
     # sys.platform.