56 lines
1.8 KiB
Plaintext
56 lines
1.8 KiB
Plaintext
--- deps/libev/wscript.orig 2010-04-10 08:05:03.000000000 +0800
|
|
+++ deps/libev/wscript 2010-04-13 09:28:42.000000000 +0800
|
|
@@ -2,6 +2,7 @@ import Options
|
|
import platform
|
|
|
|
PLATFORM_IS_DARWIN = platform.platform().find('Darwin') == 0
|
|
+PLATFORM_IS_FREEBSD = platform.platform().find('FreeBSD') == 0
|
|
|
|
def set_options(opt):
|
|
pass
|
|
@@ -27,12 +28,30 @@ def configure(conf):
|
|
if conf.check_cc(header_name="poll.h"):
|
|
conf.check_cc(header_name="poll.h", function_name="poll")
|
|
|
|
- conf.check_cc(header_name="sys/event.h")
|
|
conf.check_cc(header_name="sys/queue.h")
|
|
- 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")
|
|
+
|
|
+ code = """
|
|
+ #include <sys/types.h>
|
|
+ #include <sys/event.h>
|
|
+
|
|
+ int main() {
|
|
+ return 0;
|
|
+ }
|
|
+ """
|
|
+ conf.check_cc(fragment=code, define_name="HAVE_SYS_EVENT_H", execute=False,
|
|
+ msg="Checking for header sys/event.h")
|
|
+
|
|
+ code = """
|
|
+ #include <sys/types.h>
|
|
+ #include <sys/event.h>
|
|
+
|
|
+ int main() {
|
|
+ int fd = kqueue();
|
|
+ return 0;
|
|
+ }
|
|
+ """
|
|
+ conf.check_cc(fragment=code, define_name="HAVE_KQUEUE", execute=False,
|
|
+ msg="Checking for function kqueue")
|
|
|
|
if conf.check_cc(header_name="sys/select.h"):
|
|
conf.check_cc(header_name="sys/select.h", function_name="select")
|
|
@@ -58,7 +77,7 @@ def configure(conf):
|
|
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:
|
|
+ if PLATFORM_IS_DARWIN or PLATFORM_IS_FREEBSD:
|
|
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")
|