Changeset 191
- Timestamp:
- 04/25/10 17:52:37 (15 years ago)
- Files:
-
- 30 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
SConstruct
r189 r191 1 cflags = '-std=gnu99 -pedantic -Wall' 1 2 2 build_cmds=''' 3 libiconv_path='win32/libiconv/' 4 libpthreads_path='win32/libpthreads/' 5 libpthread_name='pthreadGC2' 6 7 source_targets=('reglookup-trunk.tar.gz',) 8 win32_targets=('reglookup-trunk-win32.zip',) 9 10 def target2version(target): 11 return target.split('-')[1].split('.')[0] 12 13 def version2input(version): 14 if version == 'trunk': 15 return 'trunk/' 16 else: 17 return 'releases/%s/' % version 18 19 20 source_cmds=''' 3 21 rm -rf .release; 4 22 svn export svn+ssh://sentinelchicken.org/home/projects/subversion/reglookup/$SOURCE .release/%s; 5 #XXX: Can this be less of a hack?6 23 cd .release/%s && scons doc 7 24 cd .release && tar cf %s.tar %s && gzip -9 %s.tar; … … 9 26 ''' 10 27 11 buildable_files=('reglookup-trunk.tar.gz',) 28 win32_cmds=''' 29 rm -rf .release && mkdir -p .release/%s 30 cp %s/src/*.exe .release/%s 31 cp win32/libiconv/bin/*.dll win32/libpthreads/bin/*.dll .release/%s 32 cd .release && zip -r %s.zip %s 33 mv .release/%s.zip . && rm -rf .release 34 ''' 12 35 13 36 def generate_cmds(source, target, env, for_signature): 14 37 ret_val = '' 15 38 for t in target: 16 if str(t) in buildable_files: 17 t_base = str(t).split('.')[0] 18 ret_val += build_cmds % (t_base,t_base,t_base, 19 t_base,t_base,t_base) 39 t = str(t) 40 t_base = t.split('.tar.gz')[0].split('.zip')[0] 41 if t in source_targets: 42 ret_val += source_cmds % (t_base,t_base,t_base, 43 t_base,t_base,t_base) 44 elif t in win32_targets: 45 version = target2version(t) 46 input_prefix = version2input(version) 47 48 env['platform']='cygwin' 49 env['CC']='i586-mingw32msvc-cc' 50 env['AR']='i586-mingw32msvc-ar' 51 env['RANLIB']='i586-mingw32msvc-ranlib' 52 53 env['CFLAGS']=cflags 54 env['CPPPATH']=[input_prefix+'include', 55 libiconv_path+'include', 56 libpthreads_path+'include'] 57 env['LIBPATH']=[input_prefix+'lib', 58 libiconv_path+'lib', 59 libpthreads_path+'lib'] 60 env['LIBS']=['m', libpthread_name, 'iconv', 'regfi'] 61 62 63 # Libraries 64 lib_src = [input_prefix+'lib/regfi.c', 65 input_prefix+'lib/talloc.c', 66 input_prefix+'lib/winsec.c', 67 input_prefix+'lib/range_list.c', 68 input_prefix+'lib/lru_cache.c', 69 input_prefix+'lib/void_stack.c'] 70 libregfi_static = env.Library(lib_src) 71 72 extra_obj=['%s/lib/lib%s.a' % (libpthreads_path, libpthread_name), 73 libiconv_path+'/lib/libiconv.dll.a', 74 input_prefix+'lib/libregfi.a'] 75 76 # Executables 77 reglookup = env.Program(input_prefix+'src/reglookup.exe', 78 [input_prefix+'src/reglookup.c']+extra_obj) 79 reglookup_recover = env.Program(input_prefix+'src/reglookup-recover.exe', 80 [input_prefix+'src/reglookup-recover.c']+extra_obj) 81 82 ret_val += win32_cmds % (t_base,input_prefix, 83 t_base,t_base,t_base,t_base,t_base) 84 20 85 else: 21 86 return '#ERROR: cannot build "%s". Acceptable targets: %s' % (t, repr(buildable_files)) 87 88 return ret_val 22 89 23 return ret_val24 90 25 91 … … 29 95 prefix='reglookup-') 30 96 97 31 98 env = Environment() 32 99 env['BUILDERS']['Release'] = release_builder 33 100 34 101 35 env.Release(Dir('trunk')) 36 #env.Release('reglookup-0.13.0.tar.gz', Dir('releases/0.13.0')) 102 for target in source_targets: 103 env.Release(target, Dir(version2input(target2version(target)))) 104 105 for target in win32_targets: 106 env.Release(target, Dir(version2input(target2version(target)))) 107 37 108 38 109 Default(None) -
trunk/SConstruct
r190 r191 2 2 cflags = '-std=gnu99 -pedantic -Wall -ggdb' 3 3 4 if False:5 # XXX: get mingw build working again with pthreads6 libiconv_path='/usr/local/src/libiconv-1.13-mingw32-dev'7 env = Environment(CC='i586-mingw32msvc-cc',8 CFLAGS=cflags,9 CPPPATH=['include', '/usr/local/include',10 libiconv_path+'/include'],11 LIBPATH=['lib', '/usr/local/lib',12 libiconv_path+'/lib'],13 LIBS=['m', 'pthread', 'regfi'])14 else:15 env = Environment(CFLAGS=cflags,16 CPPPATH=['include', '/usr/local/include'],17 LIBPATH=['lib', '/usr/local/lib'],18 LIBS=['m', 'pthread', 'regfi'])19 20 4 21 5 lib_src = ['lib/regfi.c', … … 26 10 'lib/void_stack.c'] 27 11 12 env = Environment(CFLAGS=cflags, 13 CPPPATH=['include', '/usr/local/include'], 14 LIBPATH=['lib', '/usr/local/lib'], 15 LIBS=['m', 'pthread', 'regfi']) 16 17 28 18 # Libraries 29 19 libregfi_static = env.Library(lib_src) … … 32 22 33 23 # Executables 34 reglookup = env.Program( 'src/reglookup.c')35 reglookup_recover = env.Program( 'src/reglookup-recover.c')24 reglookup = env.Program(['src/reglookup.c']) 25 reglookup_recover = env.Program(['src/reglookup-recover.c']) 36 26 37 27
Note: See TracChangeset
for help on using the changeset viewer.