Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'TooTallNate-gyp'

Conflicts:
	Makefile
  • Loading branch information...
commit 4d0c584ba81a9686e0813a64257bfdaca2b44179 2 parents 14c4636 + 3b2e809
@pietern pietern authored
View
1  .gitignore
@@ -1,3 +1,4 @@
/build
.lock-wscript
tmp
+node_modules
View
10 Makefile
@@ -1,18 +1,16 @@
-all: deps/hiredis/README.md
- cd deps/hiredis && $(MAKE) static
- node-waf configure build
+all:
+ node-gyp configure build
deps/hiredis/README.md:
git submodule init && git submodule update
clean:
- cd deps/hiredis && $(MAKE) clean
- rm -rf build
+ node-gyp clean
temp:
rm -rf tmp/hiredis
mkdir -p tmp/hiredis
- cp -r README *.{cc,h,js*} wscript Makefile deps test tmp/hiredis
+ cp -r README *.{cc,h,js*} binding.gyp wscript Makefile deps test tmp/hiredis
cd tmp/hiredis && rm -rf deps/*/.git* deps/*/*.o deps/hiredis/libhiredis.*
package: temp
View
26 binding.gyp
@@ -0,0 +1,26 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'nodehiredis',
+ 'sources': [
+ 'hiredis.cc'
+ , 'reader.cc'
+ ],
+ 'dependencies': [
+ 'deps/hiredis.gyp:hiredis'
+ ],
+ 'defines': [
+ '_GNU_SOURCE'
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'OTHER_CFLAGS': [
+ '-Wall', '-O3'
+ ]
+ }
+ }]
+ ]
+ }
+ ]
+}
View
72 deps/hiredis.gyp
@@ -0,0 +1,72 @@
+{
+ 'target_defaults': {
+ 'default_configuration': 'Debug',
+ 'configurations': {
+ 'Debug': {
+ 'defines': [ 'DEBUG', '_DEBUG' ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'RuntimeLibrary': 1, # static debug
+ },
+ },
+ },
+ 'Release': {
+ 'defines': [ 'NDEBUG' ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'RuntimeLibrary': 0, # static release
+ },
+ },
+ }
+ },
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ },
+ 'VCLibrarianTool': {
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ },
+ },
+ 'conditions': [
+ ['OS == "win"', {
+ 'defines': [
+ 'WIN32'
+ ],
+ }]
+ ],
+ },
+
+ 'targets': [
+ {
+ 'target_name': 'hiredis',
+ 'type': 'static_library',
+ #'include_dirs': [ '.' ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [ '.' ],
+ },
+ 'defines': [
+ ],
+ 'sources': [
+ './hiredis/hiredis.c',
+ './hiredis/net.c',
+ './hiredis/sds.c',
+ './hiredis/async.c',
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'GCC_C_LANGUAGE_STANDARD': 'c99'
+ }
+ }]
+ ]
+ },
+
+ {
+ 'target_name': 'test',
+ 'type': 'executable',
+ 'dependencies': [ 'hiredis' ],
+ 'sources': [ './hiredis/test.c' ]
+ }
+ ]
+}
View
3  hiredis.cc
@@ -9,6 +9,5 @@ extern "C" {
HandleScope scope;
hiredis::Reader::Initialize(target);
}
- NODE_MODULE(hiredis,init);
+ NODE_MODULE(nodehiredis, init);
}
-
View
6 hiredis.js
@@ -1,10 +1,6 @@
var hiredis, net = require("net");
-try {
- hiredis = require('./build/Release/hiredis');
-} catch (e) {
- hiredis = require('./build/default/hiredis');
-}
+hiredis = require('bindings')('nodehiredis.node');
exports.Reader = hiredis.Reader;
exports.createConnection = function(port, host) {
View
7 package.json
@@ -5,13 +5,12 @@
"homepage": "http://github.com/pietern/hiredis-node",
"author": "Pieter Noordhuis <pcnoordhuis@gmail.com>",
"main": "hiredis",
- "directories": {
- "lib": "."
- },
"scripts": {
- "preinstall": "make || gmake",
"test": "node test/reader.js"
},
+ "dependencies": {
+ "bindings": "*"
+ },
"engines": {
"node": "*"
}
View
2  reader.cc
@@ -204,7 +204,7 @@ Handle<Value> Reader::Get(const Arguments &args) {
return Undefined();
} else {
/* Complete replies should always have a root object at index 1. */
- assert((unsigned size_t)index == 1);
+ assert((size_t)index == 1);
reply = Local<Value>::New(r->handle[1]);
/* Dispose and clear used handles. */
View
2  wscript
@@ -12,4 +12,4 @@ def build(bld):
ext = bld.new_task_gen("cxx", "shlib", "node_addon", uselib="HIREDIS")
ext.cxxflags = ["-I../deps", "-g", "-Wall"]
ext.source = "hiredis.cc reader.cc"
- ext.target = "hiredis"
+ ext.target = "nodehiredis"
Please sign in to comment.
Something went wrong with that request. Please try again.