From: Ryan Dahl Date: Fri, 18 Dec 2009 14:36:25 +0000 (+0100) Subject: Fix check for epoll_ctl(). Was broken on Linux X-Git-Tag: v0.1.22~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa667f718ca1f6a887d5dddbed62ec6720f3f205;p=platform%2Fupstream%2Fnodejs.git Fix check for epoll_ctl(). Was broken on Linux --- diff --git a/deps/libev/wscript b/deps/libev/wscript index 986ea18..98932cc 100644 --- a/deps/libev/wscript +++ b/deps/libev/wscript @@ -11,34 +11,35 @@ def configure(conf): print "--- libev ---" #conf.check_tool('compiler_cc') - conf.check_cc(header_name="sys/inotify.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") - 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 - - 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") + # Why to the two checks? One is to define HAVE_SYS_EPOLL_H + # the other is to define HAVE_EPOLL_CTL + # Yes, WAF is a piece of shit. - 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") - 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="port.h", function_name="port_create") - conf.check_cc(header_name="poll.h", function_name="poll") - 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/select.h"): + conf.check_cc(header_name="sys/select.h", function_name="select") + + if conf.check_cc(header_name="sys/eventfd.h"): + conf.check_cc(header_name="sys/eventfd.h", function_name="eventfd") + + code = """ #include #include @@ -61,6 +62,7 @@ def configure(conf): 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") conf.define("HAVE_CONFIG_H", 1)