Browse Source

Fix check for epoll_ctl(). Was broken on Linux

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
fa667f718c
  1. 52
      deps/libev/wscript

52
deps/libev/wscript

@ -11,34 +11,35 @@ def configure(conf):
print "--- libev ---" print "--- libev ---"
#conf.check_tool('compiler_cc') #conf.check_tool('compiler_cc')
conf.check_cc(header_name="sys/inotify.h") # Why to the two checks? One is to define HAVE_SYS_EPOLL_H
have_epoll = conf.check_cc(header_name="sys/epoll.h") # the other is to define HAVE_EPOLL_CTL
conf.check_cc(header_name="sys/event.h") # Yes, WAF is a piece of shit.
conf.check_cc(header_name="sys/queue.h")
conf.check_cc(header_name="port.h")
conf.check_cc(header_name="poll.h")
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>
int main() {
epoll_ctl(0, 0, 0, NULL);
return 0;
}
"""
conf.check_cc(fragment=code, define_name="HAVE_EPOLL_CTL", msg="Checking for epoll_ctl")
if PLATFORM_IS_DARWIN: if conf.check_cc(header_name="sys/inotify.h"):
conf.check_cc(header_name="sys/inotify.h", function_name="inotify_init")
if conf.check_cc(header_name="sys/epoll.h"):
conf.check_cc(header_name="sys/epoll.h", function_name="epoll_ctl")
if conf.check_cc(header_name="port.h"):
conf.check_cc(header_name="port.h", function_name="port_create")
if conf.check_cc(header_name="poll.h"):
conf.check_cc(header_name="poll.h", function_name="poll")
if conf.check_cc(header_name="sys/event.h"):
conf.check_cc(header_name="sys/event.h", function_name="kqueue") conf.check_cc(header_name="sys/event.h", function_name="kqueue")
else:
if conf.check_cc(header_name="sys/queue.h"):
conf.check_cc(header_name="sys/queue.h", function_name="kqueue") conf.check_cc(header_name="sys/queue.h", function_name="kqueue")
conf.check_cc(header_name="port.h", function_name="port_create")
conf.check_cc(header_name="poll.h", function_name="poll") if conf.check_cc(header_name="sys/select.h"):
conf.check_cc(header_name="sys/select.h", function_name="select") conf.check_cc(header_name="sys/select.h", function_name="select")
conf.check_cc(header_name="sys/eventfd.h", function_name="eventfd")
if conf.check_cc(header_name="sys/eventfd.h"):
conf.check_cc(header_name="sys/eventfd.h", function_name="eventfd")
code = """ code = """
#include <syscall.h> #include <syscall.h>
#include <time.h> #include <time.h>
@ -61,6 +62,7 @@ def configure(conf):
conf.check_cc(header_name="time.h", function_name="nanosleep") conf.check_cc(header_name="time.h", function_name="nanosleep")
elif have_librt: elif have_librt:
conf.check_cc(lib="rt", header_name="time.h", function_name="nanosleep") conf.check_cc(lib="rt", header_name="time.h", function_name="nanosleep")
conf.check_cc(lib="m", header_name="math.h", function_name="ceil") conf.check_cc(lib="m", header_name="math.h", function_name="ceil")
conf.define("HAVE_CONFIG_H", 1) conf.define("HAVE_CONFIG_H", 1)

Loading…
Cancel
Save