From 089c83ba179af5994871b457c63ef249960c0343 Mon Sep 17 00:00:00 2001 From: Dave Dopson Date: Wed, 30 Nov 2011 18:20:08 -0800 Subject: [PATCH] move to zookeeper 3.4.0 --- wscript | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/wscript b/wscript index cd1d33a0..9e69f3d5 100644 --- a/wscript +++ b/wscript @@ -4,15 +4,12 @@ import platform srcdir = "." blddir = "build" APPNAME = "zookeeper" -VERSION = "3.3.3-1" +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): @@ -20,13 +17,7 @@ def configure(conf): 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':