forked from elovalo/elovalo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exporter.scons
39 lines (29 loc) · 1.18 KB
/
exporter.scons
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
# -*- mode: python; coding: utf-8 -*-
import os
from generators.build import exporter_source_files
env = Environment(ENV=os.environ)
# TODO move pkgconfig and configure boilerplate to another file
def CheckPKGConfig(context, version):
context.Message( 'Checking for pkg-config... ' )
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
context.Result( ret )
return ret
def CheckPKG(context, name):
context.Message( 'Checking for %s... ' % name )
ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
context.Result( ret )
return ret
conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig,
'CheckPKG' : CheckPKG })
if not conf.CheckPKGConfig('0.15.0'):
print 'pkg-config >= 0.15.0 not found.'
Exit(1)
if not conf.CheckPKG('jansson >= 2.2.1'):
print 'jansson >= 2.2.1 not found.'
Exit(1)
env = conf.Finish()
env.Append(CCFLAGS = "-O2 -g -Wall -std=gnu99")
env.ParseConfig('pkg-config --cflags --libs jansson')
env.Append(LIBS='m')
# Make just common code and exporter source, not the AVR code
env.Program('exporter', exporter_source_files())