Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
At the moment this is an experiemental project to build external libraries | ||
into node. | ||
|
||
1. make | ||
|
||
2. make a table called "xxx" in a database called "test" on your local | ||
postgres server | ||
|
||
3. node test.js | ||
At the moment this is an experiemental project. Grab the latest node (39e6d95 | ||
or better) and do | ||
|
||
node-waf configure build | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import os | ||
|
||
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') | ||
conf.check_node_headers() | ||
|
||
pg_config = conf.find_program('pg_config', var='PG_CONFIG', mandatory=True) | ||
pg_libdir = os.popen("%s --libdir" % pg_config).readline().strip() | ||
conf.env.append_value("LIBPATH_PG", pg_libdir) | ||
conf.env.append_value("LIB_PG", "pq") | ||
pg_includedir = os.popen("%s --includedir" % pg_config).readline().strip() | ||
conf.env.append_value("CPPPATH_PG", pg_includedir) | ||
|
||
def build(bld): | ||
obj = bld.new_task_gen('cxx', 'shlib', 'node_addon') | ||
obj.target = 'binding' | ||
obj.source = "binding.cc" | ||
obj.uselib = "PG" | ||
|
||
|
||
def shutdown(): | ||
# HACK to get binding.node out of build directory. | ||
# better way to do this? | ||
import Options, shutil | ||
if not Options.commands['clean']: | ||
if os.path.exists('build/default/binding.node'): | ||
shutil.copy('build/default/binding.node', 'binding.node') | ||
else: | ||
if os.path.exists('binding.node'): | ||
os.unlink('binding.node') |