qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject qpid-proton git commit: PROTON-987: do not assume clock_gettime is present on the build system
Date Mon, 31 Aug 2015 14:29:59 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master daec4da42 -> f37e2af0e


PROTON-987: do not assume clock_gettime is present on the build system


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/f37e2af0
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/f37e2af0
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/f37e2af0

Branch: refs/heads/master
Commit: f37e2af0ea63b0f3e056e136487927259d527e32
Parents: daec4da
Author: Ken Giusti <kgiusti@apache.org>
Authored: Fri Aug 28 16:14:32 2015 -0400
Committer: Ken Giusti <kgiusti@apache.org>
Committed: Mon Aug 31 10:15:55 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/python/setup.py | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/f37e2af0/proton-c/bindings/python/setup.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setup.py b/proton-c/bindings/python/setup.py
index c42e3c2..91cc24e 100755
--- a/proton-c/bindings/python/setup.py
+++ b/proton-c/bindings/python/setup.py
@@ -221,9 +221,14 @@ class Configure(build_ext):
                        glob.iglob(os.path.join(proton_src, '*.c'))))
 
         # Look for any optional libraries that proton needs, and adjust the
-        # source list as necessary.
+        # source list and compile flags as necessary.
         libraries = []
 
+        # -D flags (None means no value, just define)
+        macros=[('qpid_proton_EXPORTS', None),
+                ('USE_ATOLL', None),
+                ('USE_STRERROR_R', None)]
+
         # Check whether openssl is installed by poking
         # pkg-config for a minimum version 0. If it's installed, it should
         # return True and we'll use it. Otherwise, we'll use the stub.
@@ -237,11 +242,14 @@ class Configure(build_ext):
         cc = new_compiler(compiler=self.compiler_type)
         cc.output_dir = self.build_temp
 
-        # Some systems need to link to
-        # `rt`. Check whether `clock_getttime` is around
-        # and if not, link on rt.
-        if not cc.has_function('clock_getttime'):
-            libraries.append('rt')
+        # Some systems need to link to `rt`. Check whether `clock_gettime` is
+        # around and if librt is needed
+        if cc.has_function('clock_gettime'):
+            macros.append(('USE_CLOCK_GETTIME', None))
+        else:
+            if cc.has_function('clock_gettime', libraries=['rt']):
+                libraries.append('rt')
+                macros.append(('USE_CLOCK_GETTIME', None))
 
         # 0.10 added an implementation for cyrus. Check
         # if it is available before adding the implementation to the sources
@@ -266,11 +274,7 @@ class Configure(build_ext):
         ds_sys.customize_compiler(cc)
 
         objects = cc.compile(sources,
-                             # -D flags (None means no value, just define)
-                             macros=[('qpid_proton_EXPORTS', None),
-                                     ('USE_ATOLL', None),
-                                     ('USE_CLOCK_GETTIME', None),
-                                     ('USE_STRERROR_R', None)],
+                             macros=macros,
                              include_dirs=[build_include,
                                            proton_include,
                                            proton_src],


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message