The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / libev / wscript @ 90fc8d36

History | View | Annotate | Download (2.02 KB)

1
import Options
2

    
3
def set_options(opt):
4
  pass
5
  #opt.tool_options('compiler_cc')
6

    
7
def configure(conf):
8
  print "--- libev ---"
9
  #conf.check_tool('compiler_cc')
10

    
11
  platform_string = "__" + Options.platform
12
  if Options.platform == "linux2":
13
    platform_string = "__linux"
14
  conf.define(platform_string, 1)
15

    
16
  conf.check_cc(header_name="sys/inotify.h")
17
  conf.check_cc(header_name="sys/epoll.h")
18
  conf.check_cc(header_name="sys/event.h")
19
  conf.check_cc(header_name="sys/queue.h")
20
  conf.check_cc(header_name="port.h")
21
  conf.check_cc(header_name="poll.h")
22
  conf.check_cc(header_name="sys/select.h")
23
  conf.check_cc(header_name="sys/eventfd.h")
24
  conf.check_cc(header_name="sys/inotify.h", function_name="inotify_init")
25
  conf.check_cc(header_name="sys/epoll.h", function_name="epoll_ctl")
26
  conf.check_cc(header_name="sys/queue.h", function_name="kqueue")
27
  conf.check_cc(header_name="port.h", function_name="port_create")
28
  conf.check_cc(header_name="poll.h", function_name="poll")
29
  conf.check_cc(header_name="sys/select.h", function_name="select")
30
  conf.check_cc(header_name="sys/eventfd.h", function_name="eventfd")
31
  code = """
32
      #include <syscall.h>
33
      #include <time.h>
34

    
35
      int main() {
36
          struct timespec ts; 
37
          int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts);
38
          return 0;
39
      }
40
  """
41
  conf.check_cc(fragment=code, define_name="HAVE_CLOCK_SYSCALL")
42
  conf.check_cc(lib="rt", header_name="time.h", function_name="clock_gettime")
43
  conf.check_cc(lib="rt", header_name="time.h", function_name="nanosleep")
44
  conf.check_cc(lib="m", header_name="math.h", function_name="ceil")
45

    
46
  conf.define("HAVE_CONFIG_H", 1)
47
  conf.write_config_header('config.h')
48

    
49
  conf.env.append_value('CCFLAGS', ['-DEV_MULTIPLICITY=0'])
50
  conf.env.append_value('CXXFLAGS', ['-DEV_MULTIPLICITY=0'])
51

    
52
def build(bld):
53
  libev = bld.new_task_gen("cc", "staticlib")
54
  libev.source = 'ev.c'
55
  libev.target = 'ev'
56
  libev.name = 'ev'
57
  libev.includes = '. ../..'
58
  libev.install_path = None
59
  if bld.env["USE_DEBUG"]:
60
    libev.clone("debug");
61