This repository has been archived by the owner on Aug 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
wscript
105 lines (72 loc) · 2.33 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#! /usr/bin/env python3
# encoding: utf-8
VERSION = '0.1.3'
LIBNAME = 'goatplot'
top = '.'
out = 'build'
import os
from waflib import Logs as logs
from waflib import Utils as utils
recurse = ['src','catalog','meta','tests']
def options(opt):
opt.recurse(recurse)
opt.load('compiler_c gnu_dirs glib2')
opt.load('unites', tooldir='.wafcustom')
def configure(cfg):
cfg.env.LIBNAME = LIBNAME
cfg.env.VERSION = VERSION
cfg.recurse(recurse)
cfg.load('compiler_c gnu_dirs glib2')
cfg.load('unites', tooldir='.wafcustom')
cfg.define('VERSION', VERSION)
cfg.define('GETTEXT_PACKAGE', LIBNAME)
cfg.check_cc(lib='m', uselib_store='M', mandatory=True)
cfg.check_cfg(atleast_pkgconfig_version='0.26')
cfg.check_cfg(package='glib-2.0', uselib_store='GLIB', args=['glib-2.0 >= 2.24', '--cflags', '--libs'], mandatory=True)
cfg.check_cfg(package='gobject-2.0', uselib_store='GOBJECT', args=['--cflags', '--libs'], mandatory=True)
cfg.check_cfg(package='gtk+-3.0', uselib_store='GTK3', args=['--cflags', '--libs'], mandatory=True)
cfg.check_large_file(mandatory=False)
cfg.check_endianness(mandatory=False)
cfg.check_inline(mandatory=False)
# -ggdb vs -g -- http://stackoverflow.com/questions/668962
cfg.setenv('debug', env=cfg.env.derive())
cfg.env.CFLAGS = ['-ggdb', '-Wall']
cfg.define('DEBUG',1)
cfg.setenv('release', env=cfg.env.derive())
cfg.env.CFLAGS = ['-O2', '-Wall']
cfg.define('RELEASE',1)
def dist(bld):
bld.base_name = LIBNAME+'-'+VERSION
bld.algo = 'tar.xz'
bld.excl = ['.*', '*~','./build','*.'+bld.algo],
bld.files = bld.path.ant_glob('**/wscript')
def pre(bld):
if bld.cmd != 'install':
logs.info ('Variant: \'' + bld.variant + '\'')
def build(bld):
bld.load('compiler_c gnu_dirs glib2')
bld.recurse(recurse)
bld.add_pre_fun(pre)
from waflib.Build import BuildContext
class release(BuildContext):
"""compile release binary"""
cmd = 'release'
variant = 'release'
class debug(BuildContext):
"""compile debug binary"""
cmd = 'debug'
variant = 'debug'
from waflib.Context import Context
def codestyle_fun(ctx):
ctx.recurse(['src','tests'])
class codestyle(Context):
"""format code properly"""
cmd = 'codestyle'
fun = 'codestyle_fun'
from waflib.Context import Context
def version_fun(ctx):
print(VERSION)
class version(Context):
"""get current goatplot version"""
cmd = 'version'
fun = 'version_fun'