Changeset 389

Show
Ignore:
Timestamp:
06/15/07 18:33:31 (2 years ago)
Author:
blackhedd
Message:

improved the epoll-availability test so it works properly on 2.4 kernels

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • version_0/ext/extconf.rb

    r358 r389  
    9898  flags << '-DBUILD_FOR_RUBY' 
    9999 
    100   flags << '-DHAVE_EPOLL' if have_header('sys/epoll.h') 
     100  # Original epoll test is inadequate because 2.4 kernels have the header 
     101  # but not the code. 
     102  #flags << '-DHAVE_EPOLL' if have_header('sys/epoll.h') 
     103  if have_header('sys/epoll.h') 
     104          File.open("hasEpollTest.c", "w") {|f| 
     105                  f.puts "#include <sys/epoll.h>" 
     106                  f.puts "void X() { epoll_create(1024); }" 
     107          } 
     108          e = `gcc hasEpollTest.c -o hasEpollTest 2> /dev/null` 
     109          `rm -f hasEpollTest.c hasEpollTest` 
     110          flags << '-DHAVE_EPOLL' if e == 0 
     111  end 
    101112 
    102113  dir_config('ssl')