Browse files

Merge pull request #56 from icing/gyp-support

Gyp support for node 0.8.16, necessary on OS X 10.8
  • Loading branch information...
2 parents 48a7c11 + a310350 commit 2d4765ff7572deb018dc966027d452e74974599c @ujjwalt ujjwalt committed Feb 11, 2013
Showing with 11 additions and 21 deletions.
  1. +9 −0 binding.gyp
  2. +1 −2 package.json
  3. +1 −1 pcap_binding.cc
  4. +0 −18 wscript
View
9 binding.gyp
@@ -0,0 +1,9 @@
+{
+ "targets": [
+ {
+ "target_name": "pcap_binding",
+ "sources": [ "pcap_binding.cc" ],
+ "link_settings" : { "libraries" : [ "-lpcap" ] }
+ }
+ ]
+}
View
3 package.json
@@ -6,6 +6,5 @@
"repository": {
"type": "git",
"url": "git://github.com/mranney/node_pcap.git"
- },
- "scripts": { "install": "node-waf configure clean build" }
+ }
}
View
2 pcap_binding.cc
@@ -64,7 +64,7 @@ void PacketReady(u_char *callback_p, const struct pcap_pkthdr* pkthdr, const u_c
packet_header->Set(String::New("caplen"), Integer::NewFromUnsigned(pkthdr->caplen));
packet_header->Set(String::New("len"), Integer::NewFromUnsigned(pkthdr->len));
- Local<Value> argv[1] = packet_header;
+ Local<Value> argv[1] = { packet_header };
(*callback)->Call(Context::GetCurrent()->Global(), 1, argv);
View
18 wscript
@@ -1,18 +0,0 @@
-srcdir = "."
-blddir = "build"
-VERSION = "0.0.1"
-
-def set_options(opt):
- opt.tool_options("compiler_cxx")
-
-def configure(conf):
- conf.check_tool("compiler_cxx")
- conf.check_tool("node_addon")
- if not conf.check(lib="pcap", mandantory=True):
- conf.fatal("libpcap C library not found on this system.")
-
-def build(bld):
- obj = bld.new_task_gen("cxx", "shlib", "node_addon")
- obj.target = "pcap_binding"
- obj.source = "pcap_binding.cc"
- obj.linkflags = ['-lpcap']

0 comments on commit 2d4765f

Please sign in to comment.