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
Dave Dopson
committed
Dec 1, 2011
1 parent
1dbeb60
commit 089c83b
Showing
1 changed file
with
13 additions
and
18 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 |
---|---|---|
|
@@ -4,29 +4,20 @@ import platform | |
srcdir = "." | ||
blddir = "build" | ||
APPNAME = "zookeeper" | ||
VERSION = "3.3.3-1" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ddopson
Collaborator
|
||
VERSION = "3.4.0" | ||
OSTYPE = platform.system() | ||
|
||
|
||
includes = ['/usr/local/include/c-client-src'] | ||
libpaths = ['/usr/local/lib'] | ||
|
||
def set_options(opt): | ||
opt.add_option('-z','--zookeeper', action='store', default='zookeeper-3.3.3', help='build zookeeper', dest='zookeeper') | ||
opt.add_option('-z','--zookeeper', action='store', default='zookeeper-' + VERSION, help='build zookeeper', dest='zookeeper') | ||
opt.tool_options("compiler_cxx") | ||
|
||
def configure(conf): | ||
conf.check_tool("compiler_cxx") | ||
conf.check_tool("node_addon") | ||
|
||
def zookeeper(ctx, z): | ||
global includes | ||
global libpaths | ||
t = ctx.bdir + '/zk' | ||
includes = [t + "/include/c-client-src"] | ||
libpaths = [t + "/lib"] | ||
if z == None: | ||
z = 'zookeeper-3.3.3' | ||
if z.find('/') == -1: | ||
tgz = z + '.tar.gz' | ||
r = ctx.exec_command("if [ ! -d '%s' -a ! -f '%s' ] ; then curl --silent --write-out '%%{http_code}' --output %s 'http://apache.mirrors.tds.net/zookeeper/%s/%s' | grep -v 404 ; fi" % (z,tgz,tgz,z,tgz)) | ||
|
@@ -37,19 +28,23 @@ def zookeeper(ctx, z): | |
ctx.exec_command("if [ ! -d '%s' ] ; then tar -xzvf %s ; fi" % (z,tgz)) | ||
|
||
# We use "--without-shared" to force building/linking only the static libzookeeper.a library, else we would have unresolved runtime dependencies | ||
# We also use "--disable-shared" because on a newer version of the zk source (maybe 3.3.1 vs 3.3.0???), "--without-shared" is no longer recognized. no idea why / wtf is going on here. but it works. and the other one gets silently ignored. keeping both in the code to cover all our bases | ||
# We also use "--disable-shared" because on a newer version of the zk source (maybe 3.3.1 vs 3.3.0???), "--without-shared" is no longer recognized. | ||
# no idea why / wtf is going on here. but it works. and the other one gets silently ignored. keeping both in the code to cover all our bases | ||
# We use "--with-pic" to make position-independent code that can be statically linked into a shared object file (zookeeper.node) | ||
ctx.exec_command("mkdir -p zk ; cd %s/src/c && ./configure --without-syncapi --without-shared --disable-shared --with-pic --prefix=%s && make clean install"%(z,t)) | ||
|
||
def build(bld): | ||
global includes | ||
global libpaths | ||
# for quicker development, run with "--zookeeper=" to skip rebuilding the zookeeper source (99% of build time) | ||
if Options.options.zookeeper != '': | ||
zookeeper(bld, Options.options.zookeeper) | ||
else: | ||
# for quicker development, run with "--zookeeper=" to skip rebuilding the zookeeper source (99% of build time) | ||
includes = [bld.bdir + '/zk/include/c-client-src'] | ||
libpaths = [bld.bdir + '/zk/lib'] | ||
|
||
includes = [ | ||
bld.bdir + '/zk/include/zookeeper', # zookeeper 3.4.x (local) | ||
bld.bdir + '/zk/include/c-client-src', # zookeeper 3.3.x (local) | ||
# '/usr/local/include/zookeeper', # zookeeper 3.4.x (system) | ||
# '/usr/local/include/c-client-src' # zookeeper 3.3.x (system) | ||
] | ||
libpaths = [bld.bdir + '/zk/lib', '/usr/local/lib'] | ||
|
||
obj = bld.new_task_gen("cxx", "shlib", "node_addon") | ||
if OSTYPE == 'Darwin': | ||
|
You've changed the meaning of VERSION from version of the module, to version of zookeeper library.
it was never used, so i guess it was kind of ambiguous, i think it was just not knowing if node-waf needed that variable for some reason or what.
anyway, it should be named ZVERSION or something to indicate that it is, in fact, not the module version, but the zk lib version.