Browse Source

detect nanosleep on OS X and do not look for functions in libraries we know dows not exist

v0.7.4-release
Rasmus Andersson 15 years ago
committed by Ryan Dahl
parent
commit
752da03eb0
  1. 14
      deps/libev/wscript

14
deps/libev/wscript

@ -1,6 +1,8 @@
import Options
import platform
PLATFORM_IS_DARWIN = platform.platform().find('Darwin') == 0
def set_options(opt):
pass
#opt.tool_options('compiler_cc')
@ -10,7 +12,7 @@ def configure(conf):
#conf.check_tool('compiler_cc')
conf.check_cc(header_name="sys/inotify.h")
conf.check_cc(header_name="sys/epoll.h")
have_epoll = conf.check_cc(header_name="sys/epoll.h")
conf.check_cc(header_name="sys/event.h")
conf.check_cc(header_name="sys/queue.h")
conf.check_cc(header_name="port.h")
@ -18,7 +20,7 @@ def configure(conf):
conf.check_cc(header_name="sys/select.h")
conf.check_cc(header_name="sys/eventfd.h")
conf.check_cc(header_name="sys/inotify.h", function_name="inotify_init")
if have_epoll:
code = """
#include <sys/epoll.h>
@ -29,7 +31,7 @@ def configure(conf):
"""
conf.check_cc(fragment=code, define_name="HAVE_EPOLL_CTL", msg="Checking for epoll_ctl")
if platform.platform().find('Darwin') == 0:
if PLATFORM_IS_DARWIN:
conf.check_cc(header_name="sys/event.h", function_name="kqueue")
else:
conf.check_cc(header_name="sys/queue.h", function_name="kqueue")
@ -52,8 +54,12 @@ def configure(conf):
conf.check_cc(fragment=code, define_name="HAVE_CLOCK_SYSCALL", execute=True,
msg="Checking for SYS_clock_gettime")
conf.check(lib='rt', uselib_store='RT')
have_librt = conf.check(lib='rt', uselib_store='RT')
if have_librt:
conf.check_cc(lib="rt", header_name="time.h", function_name="clock_gettime")
if PLATFORM_IS_DARWIN:
conf.check_cc(header_name="time.h", function_name="nanosleep")
elif have_librt:
conf.check_cc(lib="rt", header_name="time.h", function_name="nanosleep")
conf.check_cc(lib="m", header_name="math.h", function_name="ceil")

Loading…
Cancel
Save