Sha256: d7b4ce5a963d778335b604c73c3e0b0d43e0f9480b2bcbe6176d0a31ac7ee43a

Contents?: true

Size: 856 Bytes

Versions: 4

Compression:

Stored size: 856 Bytes

Contents

require 'mkmf'

pcap_dir        = with_config("pcap-dir", "/usr/local")
pcap_includedir = with_config("pcap-includedir", pcap_dir + "/include")
pcap_libdir     = with_config("pcap-libdir", pcap_dir + "/lib")

$CFLAGS  = "-I#{pcap_includedir}"
$LDFLAGS = "-L#{pcap_libdir}"

# According to the blog entry at
# http://blog.phusion.nl/2010/06/10/making-ruby-threadable-properly-handling-context-switching-in-native-extensions/
# TRAP_BEG and TRAP_END just release / reacquire the GIL (global interpreter lock) on Ruby 1.9, which means
# they should not be used in our case.
$defs.push("-DPCAP_DONT_TRAP=1") if RUBY_VERSION >= '1.9'

have_library("socket", "socket")
have_library("xnet", "gethostbyname")
have_func("hstrerror")
if have_header("pcap.h") && have_library("pcap", "pcap_open_live")
  have_func("pcap_compile_nopcap")
  create_makefile("pcap")
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-pcap-0.8.1 ext/pcap/extconf.rb
ruby-pcap-0.8.0 ext/pcap/extconf.rb
ruby-pcap-0.7.9 ext/pcap/extconf.rb
ruby-pcap-0.7.8 ext/extconf.rb