Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Gyp support for node 0.8.16, necessary on OS X 10.8 #56

Merged
merged 2 commits into from

2 participants

@icing

Building with node-waf is no longer working on OS X 10.8 since it
enforces the i386 architecture. It needs to be x86_64 instead.

See also: joyent/node#3633

I removed the wscript and added a simple binding.gyp

With the way node-gyp invokes the compile, I had an array
assignment error in line 67 on pcap_binding.cc which I
also corrected.

This version records http traffic on OS X 10.8.2, tested with mnot's
hdrgrab tool.

@ujjwalt ujjwalt merged commit 2d4765f into mranney:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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']
Something went wrong with that request. Please try again.