Skip to content

Commit

Permalink
Finalization of new build system setup
Browse files Browse the repository at this point in the history
Split the project into subprojects:
- base - creates a static library libbase.a; supplies serialization
protocol definitions parsing
- dumper - a dumper that dumps the traffic into a file or sends it over
network to a client
- analyzer - GUI analyzer of captured traffic
  • Loading branch information
Tomek Obrebski committed Mar 18, 2015
1 parent 9eb2217 commit 4d46fc3
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 39 deletions.
4 changes: 2 additions & 2 deletions src/analyzer/wlanalyzer.cpp
Expand Up @@ -25,8 +25,8 @@
#include <vector>
#include <string>
#include <string.h>
#include "common.h"
#include "parser.h"
#include "../base/common.h"
#include "../base/parser.h"

using namespace std;

Expand Down
11 changes: 9 additions & 2 deletions src/analyzer/wscript
Expand Up @@ -2,8 +2,15 @@

target = 'wlanalyzer'

def options(opt):
opt.load('compiler_cxx qt5')


def configure(ctx):
ctx.load('qt5')
ctx.load('compiler_cxx qt5')


def build(bld):
print('Building ' + target)
source_files = bld.path.ant_glob('*.cpp')
bld(source = source_files, target='wlanalyzer', features='qt5 cxx cxxprogram', use = [ 'QT5CORE', 'QT5GUI', 'QT5WIDGETS', 'base' ])

8 changes: 6 additions & 2 deletions src/base/wscript
Expand Up @@ -2,7 +2,12 @@

out = 'build'

def options(ctx):
ctx.load('compiler_cxx')


def configure(ctx):
ctx.load('compiler_cxx')
# Check for libev
ctx.check_cxx(header_name='ev++.h')
ctx.check_cxx(lib='ev', uselib_store='EV')
Expand All @@ -12,5 +17,4 @@ def configure(ctx):

def build(bld):
source_files = bld.path.ant_glob('**/*.cpp')
bld.stlib(source=source_files, use=['EV', 'PUGI'], target='base')
print("Building base")
bld.stlib(source=source_files, use=['EV', 'PUGI'], target='base', install_path=bld.env.PREFIX + '/lib')
7 changes: 6 additions & 1 deletion src/dumper/wscript
Expand Up @@ -2,8 +2,13 @@

target = 'wldumper'

def options(ctx):
ctx.load('compiler_cxx')


def configure(ctx):
print('Configuring in ' + ctx.path.abspath())
ctx.load('compiler_cxx')


def build(bld):
print('Building ' + target)
Expand Down
20 changes: 20 additions & 0 deletions src/wscript
@@ -0,0 +1,20 @@
#! /usr/bin/env python

def options(opt):
opt.recurse('base')
opt.recurse('dumper')
opt.recurse('analyzer')


def configure(ctx):
ctx.recurse('base')
ctx.recurse('dumper')
if ctx.options.analyzer:
ctx.recurse('analyzer')


def build(bld):
bld.recurse('base')
bld.recurse('dumper')
if bld.options.analyzer:
bld.recurse('analyzer')
10 changes: 5 additions & 5 deletions waf

Large diffs are not rendered by default.

37 changes: 10 additions & 27 deletions wscript
@@ -1,48 +1,31 @@
#! /usr/bin/env python

APPNAME = 'wlanalyzer'
VERSION = '0.3'

top = '.'
out = 'build'
DUMPER = 'wldump'
ANALYZER = 'wlanalyzer'
VERSION = '0.1'

def options(ctx):
ctx.load('compiler_cxx')
ctx.add_option('-d', '--debug', action='store_true', default=False, help='Compile with debug symbols')
ctx.add_option('--analyzer', action='store_true', default=False, help='Build the protocol analyzer. It is required to have qt5 libs installed on the system')
ctx.recurse('src')


def configure(ctx):
ctx.load('compiler_cxx')
if ctx.options.analyzer:
ctx.load('qt5')
ctx.env.CXXFLAGS += ['-Wall', '-fPIC']
if ctx.options.debug:
ctx.env.CXXFLAGS += ['-g', '-O0', '-DDEBUG_BUILD']
# Check for libev
#ctx.check_cxx(header_name='ev++.h')
#ctx.check_cxx(lib='ev', uselib_store='EV')
# Check for pugixml
#ctx.check_cxx(lib='pugixml', uselib_store='PUGI')

ctx.recurse('src')
ctx.recurse('src')

if ctx.env.LIB_QT5QUICK and ctx.env.INCLUDES_QT5QUICK:
ctx.env.BUILD_WLANALYZER = True
print("Building a GUI analyzer")


def build(bld):
bld.recurse('src')
#source_files = bld.path.ant_glob('^src/**/*.cpp$', excl=['^src/**/wldump.cpp', '^src/**/wlanalyzer.cpp'])
#wldumper = [bld.path.make_node('/src/wldump.cpp')]
#wlanalyzer = [bld.path.make_node('/src/wlanalyzer.cpp')]
#bld.program(source=source_files + wldumper, target=DUMPER, use=['EV', 'PUGI'])

#usage = [ 'EV', 'PUGI' ]
#feature_set = 'cxx cxxprogram'

#if bld.env.BUILD_WLANALYZER:
# usage += [ 'QT5QUICK', 'QT5CORE', 'QT5WIDGETS' ]
# feature_set += 'qt5'

#if bld.env.BUILD_WLANALYZER:
# bld.program(source=source_files + wlanalyzer, target=ANALYZER, use=usage, features=feature_set)
bld.recurse('src/base')
bld.recurse('src/dumper')
bld.recurse('src/analyzer')

0 comments on commit 4d46fc3

Please sign in to comment.