the correct waf and wscript.
diff --git a/waf b/waf
index ef85684..69fb819 100755
--- a/waf
+++ b/waf
Binary files differ
diff --git a/waf-tools/ccnx.py b/waf-tools/ccnx.py
deleted file mode 100644
index 5338b5f..0000000
--- a/waf-tools/ccnx.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#! /usr/bin/env python
-# encoding: utf-8
-
-'''
-
-When using this tool, the wscript will look like:
-
- def options(opt):
- opt.tool_options('ccnx', tooldir=["waf-tools"])
-
- def configure(conf):
- conf.load('compiler_cxx ccnx')
-
- def build(bld):
- bld(source='main.cpp', target='app', use='CCNX')
-
-Options are generated, in order to specify the location of ccnx includes/libraries.
-
-
-'''
-import sys
-import re
-from waflib import Utils,Logs,Errors
-from waflib.Configure import conf
-CCNX_DIR=['/usr','/usr/local','/opt/local','/sw']
-CCNX_VERSION_FILE='ccn/ccn.h'
-CCNX_VERSION_CODE='''
-#include <iostream>
-#include <ccn/ccn.h>
-int main() { std::cout << ((CCN_API_VERSION/100000) % 100) << "." << ((CCN_API_VERSION/1000) % 100) << "." << (CCN_API_VERSION % 1000); }
-'''
-
-def options(opt):
- opt.add_option('--ccnx',type='string',default='',dest='ccnx_dir',help='''path to where CCNx is installed, e.g. /usr/local''')
-@conf
-def __ccnx_get_version_file(self,dir):
- # Logs.pprint ('CYAN', ' + %s/%s/%s' % (dir, 'include', CCNX_VERSION_FILE))
- try:
- return self.root.find_dir(dir).find_node('%s/%s' % ('include', CCNX_VERSION_FILE))
- except:
- return None
-@conf
-def ccnx_get_version(self,dir):
- val=self.check_cxx(fragment=CCNX_VERSION_CODE,includes=['%s/%s' % (dir, 'include')],execute=True,define_ret = True, mandatory=True)
- return val
-@conf
-def ccnx_get_root(self,*k,**kw):
- root=k and k[0]or kw.get('path',None)
- # Logs.pprint ('RED', ' %s' %root)
- if root and self.__ccnx_get_version_file(root):
- return root
- for dir in CCNX_DIR:
- if self.__ccnx_get_version_file(dir):
- return dir
- if root:
- self.fatal('CCNx not found in %s'%root)
- else:
- self.fatal('CCNx not found, please provide a --ccnx argument (see help)')
-@conf
-def check_ccnx(self,*k,**kw):
- if not self.env['CXX']:
- self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
-
- var=kw.get('uselib_store','CCNX')
- self.start_msg('Checking CCNx')
- root = self.ccnx_get_root(*k,**kw);
- self.env.CCNX_VERSION=self.ccnx_get_version(root)
-
- self.env['INCLUDES_%s'%var]= '%s/%s' % (root, "include");
- self.env['LIB_%s'%var] = "ccn"
- self.env['LIBPATH_%s'%var] = '%s/%s' % (root, "lib")
-
- self.end_msg(self.env.CCNX_VERSION)
- if Logs.verbose:
- Logs.pprint('CYAN',' ccnx include : %s'%self.env['INCLUDES_%s'%var])
- Logs.pprint('CYAN',' ccnx lib : %s'%self.env['LIB_%s'%var])
- Logs.pprint('CYAN',' ccnx libpath : %s'%self.env['LIBPATH_%s'%var])
diff --git a/waf-tools/protobuf.py b/waf-tools/protobuf.py
deleted file mode 100644
index 684a945..0000000
--- a/waf-tools/protobuf.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-#! /usr/bin/env python
-# encoding: utf-8
-
-'''
-
-When using this tool, the wscript will look like:
-
-def options(opt):
- opt.tool_options("protobuf", tooldir=["waf-tools"])
-
-def configure(conf):
- conf.load("compiler_cxx protobuf")
-
-def build(bld):
- bld(source="main.cpp", target="app", use="PROTOBUF")
-
-Options are generated, in order to specify the location of protobuf includes/libraries.
-
-'''
-
-from waflib import Utils, TaskGen, Task, Logs
-
-from waflib import Utils,Logs,Errors
-from waflib.Configure import conf
-
-def options(opt):
- pass
-
-def configure(conf):
- """
- """
- conf.check_cfg(package='protobuf', args=['--cflags', '--libs'], uselib_store='PROTOBUF', mandatory=True)
-
- conf.find_program ('protoc', var='PROTOC', path_list = conf.env['PATH'], mandatory = True)
-
-@TaskGen.extension('.proto')
-def add_proto(self, node):
- """
- Compile PROTOBUF protocol specifications
- """
- prototask = self.create_task ("protobuf", node, node.change_ext (".pb"))
- try:
- self.compiled_tasks.append (prototask)
- except AttributeError:
- self.compiled_tasks = [prototask]
-
-class protobuf(Task.Task):
- """
- Task for compiling PROTOBUF protocol specifications
- """
- run_str = '${PROTOC} --cpp_out ${TGT[0].parent.abspath()} --proto_path ${SRC[0].parent.abspath()} ${SRC[0].abspath()} -o${TGT[0].abspath()}'
- color = 'BLUE'
-
-@TaskGen.feature('cxxshlib')
-@TaskGen.before_method('process_source')
-def dynamic_post(self):
- if not getattr(self, 'dynamic_source', None):
- return
- self.source = Utils.to_list(self.source)
-
- src = self.bld.path.get_bld().ant_glob (Utils.to_list(self.dynamic_source))
-
- for cc in src:
- # Signature for the source
- cc.sig = Utils.h_file (cc.abspath())
- # Signature for the header
- h = cc.change_ext (".h")
- h.sig = Utils.h_file (h.abspath())
-
- self.source.extend (src)
diff --git a/wscript b/wscript
index bd877cd..ede09a8 100644
--- a/wscript
+++ b/wscript
@@ -10,23 +10,21 @@
opt.add_option('--debug',action='store_true',default=False,dest='debug',help='''debugging mode''')
opt.add_option('--test', action='store_true',default=False,dest='_test',help='''build unit tests''')
opt.add_option('--yes',action='store_true',default=False) # for autoconf/automake/make compatibility
- opt.load('compiler_c')
- opt.load('compiler_cxx')
- opt.load('boost')
- opt.load('gnu_dirs')
- opt.load('ccnx protobuf', tooldir=["waf-tools"])
+
+ opt.load('compiler_cxx boost ccnx protoc')
def configure(conf):
conf.load("compiler_cxx")
- conf.load('gnu_dirs')
conf.check_cfg(package='sqlite3', args=['--cflags', '--libs'], uselib_store='SQLITE3', mandatory=True)
if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False):
- libcrypto = conf.check_cc(lib='crypto',
- header_name='openssl/crypto.h',
- define_name='HAVE_SSL',
- uselib_store='SSL')
+ libcrypto = conf.check_cc(lib='crypto',
+ header_name='openssl/crypto.h',
+ define_name='HAVE_SSL',
+ uselib_store='SSL')
+ else:
+ conf.define ("HAVE_SSL", 1)
if not conf.get_define ("HAVE_SSL"):
conf.fatal ("Cannot find SSL libraries")
@@ -51,23 +49,11 @@
if conf.options._test:
conf.define('_TEST', 1)
- conf.load('protobuf')
+ conf.load('protoc')
conf.write_config_header('src/config.h')
def build (bld):
- bld.post_mode = Build.POST_LAZY
-
- bld.add_group ("protobuf")
-
-# x = bld (
-# features = ["protobuf"],
-# source = ["model/sync-state.proto"],
-# target = ["model/sync-state.pb"],
-# )
-
- bld.add_group ("code")
-
libccnx = bld (
target=CCNXLIB,
features=['cxx', 'cxxshlib'],
@@ -91,12 +77,8 @@
includes = ['include', ],
)
-
-
-
-
chronoshare = bld (
- target=APPNAME,
+ target="tmp",
features=['cxx', 'cxxprogram'],
# source = bld.path.ant_glob(['src/**/*.cc']),
source = ['src/main.cc', 'src/sqlite-helper.cc'],