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
RevLine 
[211]1import sys
[212]2import os
[211]3
[225]4cflags = '-std=gnu99 -pedantic -Wall -D_FILE_OFFSET_BITS=64 -fvisibility=hidden'
5cflags += ' -ggdb'
[187]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
[191]13env = Environment(CFLAGS=cflags,
14                  CPPPATH=['include', '/usr/local/include'],
15                  LIBPATH=['lib', '/usr/local/lib'],
[195]16                  LIBS=['m', 'pthread', 'regfi', 'talloc'])
[191]17
[194]18
[187]19# Libraries
20libregfi_static = env.Library(lib_src)
[203]21libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread', 'talloc'])
[187]22
[189]23
[187]24# Executables
[191]25reglookup = env.Program(['src/reglookup.c'])
26reglookup_recover = env.Program(['src/reglookup-recover.c'])
[187]27
[189]28
[187]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',
[189]35                      src_suffix = '.docbook')
[187]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
[189]42# Installation
43prefix='/usr/local/'
[212]44install_items = [prefix+'bin',
45                 prefix+'lib',
46                 prefix+'include/regfi',
47                 prefix+'man']
48
[189]49env.Install(prefix+'bin', [reglookup, reglookup_recover, 'bin/reglookup-timeline'])
50env.Install(prefix+'lib', [libregfi, libregfi_static])
[193]51env.Install(prefix+'include/regfi', Glob('include/*.h'))
[189]52env.Install(prefix+'man/man1', [man_reglookup, man_reglookup_recover,
53                                man_reglookup_timeline])
54
[212]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")
[189]59
[212]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
[187]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])
[212]73env.Alias('install', install_items)
[187]74
75Default('bin', libregfi)
Note: See TracBrowser for help on using the repository browser.