2007-10-08 23:16:31 +00:00
|
|
|
require 'mkmf'
|
|
|
|
|
2008-02-14 19:50:56 +00:00
|
|
|
if /i386-mswin32/ =~ RUBY_PLATFORM
|
|
|
|
pcap_dir = with_config("pcap-dir", "C:\WpdPack")
|
|
|
|
pcap_includedir = with_config("pcap-includedir", pcap_dir + "\\include")
|
|
|
|
pcap_libdir = with_config("pcap-libdir", pcap_dir + "\\lib")
|
|
|
|
|
|
|
|
$CFLAGS = "-DWIN32 -I#{pcap_includedir}"
|
|
|
|
$LDFLAGS = "/link /LIBPATH:#{pcap_libdir}"
|
|
|
|
have_library("wpcap", "pcap_open_live")
|
2008-06-22 17:14:11 +00:00
|
|
|
have_library("wpcap", "pcap_setnonblock")
|
2008-02-14 19:50:56 +00:00
|
|
|
else
|
|
|
|
have_library("pcap", "pcap_open_live")
|
2008-06-22 17:14:11 +00:00
|
|
|
have_library("pcap", "pcap_setnonblock")
|
2008-02-14 19:50:56 +00:00
|
|
|
end
|
|
|
|
|
2007-10-08 23:16:31 +00:00
|
|
|
create_makefile("pcaprub")
|