summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorTom Hughes <tom.hughes@palm.com>2011-03-05 18:11:09 -0600
committerRyan Dahl <ry@tinyclouds.org>2011-03-09 09:16:11 -0800
commit2c185a9dfd3be8e718858b946333c433c375c295 (patch)
treeade3631658858c28887dc3fc64e3e3a1aad20035 /wscript
parent502900c0bc9b78faf191489c0ea4d8c00f1642d2 (diff)
downloadandroid-node-v8-2c185a9dfd3be8e718858b946333c433c375c295.tar.gz
android-node-v8-2c185a9dfd3be8e718858b946333c433c375c295.tar.bz2
android-node-v8-2c185a9dfd3be8e718858b946333c433c375c295.zip
Use higher resolution clock for uptime on Linux (if available).
Diffstat (limited to 'wscript')
-rw-r--r--wscript19
1 files changed, 18 insertions, 1 deletions
diff --git a/wscript b/wscript
index aea3fb7b9b..526195456d 100644
--- a/wscript
+++ b/wscript
@@ -328,7 +328,24 @@ def configure(conf):
elif 'DEST_CPU' in conf.env and conf.env['DEST_CPU']:
conf.env['DEST_CPU'] = canonical_cpu_type(conf.env['DEST_CPU'])
- conf.check(lib='rt', uselib_store='RT')
+ have_librt = conf.check(lib='rt', uselib_store='RT')
+
+ have_monotonic = False
+ if have_librt:
+ code = """
+ #include <time.h>
+ int main(void) {
+ struct timespec now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ return 0;
+ }
+ """
+ have_monotonic = conf.check_cc(lib="rt", msg="Checking for CLOCK_MONOTONIC", fragment=code)
+
+ if have_monotonic:
+ conf.env.append_value('CPPFLAGS', '-DHAVE_MONOTONIC_CLOCK=1')
+ else:
+ conf.env.append_value('CPPFLAGS', '-DHAVE_MONOTONIC_CLOCK=0')
if sys.platform.startswith("sunos"):
if not conf.check(lib='socket', uselib_store="SOCKET"):