source: trunk/SConstruct @ 225

Last change on this file since 225 was 225, checked in by tim, 13 years ago

added test case for python callback read/seek
began adding windows support in pyregfi
improved win32 build target

File size: 2.6 KB
Line 
1import sys
2import os
3
4cflags = '-std=gnu99 -pedantic -Wall -D_FILE_OFFSET_BITS=64 -fvisibility=hidden'
5cflags += ' -ggdb'
6
7lib_src = ['lib/regfi.c',
8           'lib/winsec.c',
9           'lib/range_list.c',
10           'lib/lru_cache.c',
11           'lib/void_stack.c']
12
13env = Environment(CFLAGS=cflags,
14                  CPPPATH=['include', '/usr/local/include'],
15                  LIBPATH=['lib', '/usr/local/lib'],
16                  LIBS=['m', 'pthread', 'regfi', 'talloc'])
17
18
19# Libraries
20libregfi_static = env.Library(lib_src)
21libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread', 'talloc'])
22
23
24# Executables
25reglookup = env.Program(['src/reglookup.c'])
26reglookup_recover = env.Program(['src/reglookup-recover.c'])
27
28
29# Documentation
30#  This only needs to be run during the release/packaging process
31man_fixup = "|sed 's/.SH DESCRIPTION/\\n.SH DESCRIPTION/'"
32man_builder = Builder(action='docbook2x-man --to-stdout $SOURCE'
33                      + man_fixup + '| gzip -9 > $TARGET',
34                      suffix = '.gz',
35                      src_suffix = '.docbook')
36env['BUILDERS']['ManPage'] = man_builder
37
38man_reglookup = env.ManPage('doc/reglookup.1.docbook')
39man_reglookup_recover = env.ManPage('doc/reglookup-recover.1.docbook')
40man_reglookup_timeline = env.ManPage('doc/reglookup-timeline.1.docbook')
41
42# Installation
43prefix='/usr/local/'
44install_items = [prefix+'bin',
45                 prefix+'lib',
46                 prefix+'include/regfi',
47                 prefix+'man']
48
49env.Install(prefix+'bin', [reglookup, reglookup_recover, 'bin/reglookup-timeline'])
50env.Install(prefix+'lib', [libregfi, libregfi_static])
51env.Install(prefix+'include/regfi', Glob('include/*.h'))
52env.Install(prefix+'man/man1', [man_reglookup, man_reglookup_recover,
53                                man_reglookup_timeline])
54
55if sys.version_info[0] == 2:
56   install_items.append('pyregfi2-install.log')
57   env.Command('pyregfi2-install.log', ['python/pyregfi/__init__.py', 'python/pyregfi/structures.py'],
58               "python pyregfi-distutils.py install | tee pyregfi2-install.log")
59
60python_path = os.popen('which python3').read()
61if python_path != '':
62   install_items.append('pyregfi3-install.log')
63   env.Command('pyregfi3-install.log', ['python/pyregfi/__init__.py', 'python/pyregfi/structures.py'],
64               "python3 pyregfi-distutils.py install | tee pyregfi3-install.log")
65
66
67# User Friendly Targets
68env.Alias('libregfi', libregfi)
69env.Alias('reglookup', reglookup)
70env.Alias('reglookup-recover', reglookup_recover)
71env.Alias('bin', [reglookup_recover, reglookup])
72env.Alias('doc', [man_reglookup,man_reglookup_recover,man_reglookup_timeline])
73env.Alias('install', install_items)
74
75Default('bin', libregfi)
Note: See TracBrowser for help on using the repository browser.