-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautotools.py
42 lines (28 loc) · 912 Bytes
/
autotools.py
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
from itertools import imap
from SCons.Script import *
########################################################################
makefile_action = Action(
'CONFIG_SITE=$config_site.abspath $SOURCE.abspath/configure $configure_flags',
chdir=True,
source_scanner=DirScanner,
)
def makefile_emitter(target, source, env):
build = target[0].dir
filenames = ['config.h', 'config.log', 'config.status', 'stamp-h1']
target += imap(build.File, filenames)
config = env.get('config_site')
if config: source.append(config)
return target, source
makefile_builder = Builder(
emitter=makefile_emitter,
action=makefile_action,
)
########################################################################
def generate(env):
env.AppendUnique(
BUILDERS = {
'Makefile': makefile_builder,
},
)
def exists(env):
return True