Changeset 222 for SConstruct


Ignore:
Timestamp:
04/02/11 17:27:39 (14 years ago)
Author:
tim
Message:

removed legacy Makefiles
mingw target now builds libregfi.dll

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SConstruct

    r221 r222  
    99win32_targets=('reglookup-win32-trunk.zip',)
    1010doc_targets=('reglookup-doc-trunk.tar.gz',)
     11all_targets = source_targets+win32_targets+doc_targets
    1112
    1213def target2version(target):
    13     return target.split('-')[2].split('.')[0]
     14    chunks = target.split('-')
     15    if len(chunks) != 3:
     16        return None
     17    return chunks[2].split('.')[0]
    1418
    1519def version2input(version):
     
    3135rm -rf .release && mkdir -p .release/%s
    3236cp %s/src/*.exe .release/%s
    33 cp win32/libiconv/bin/*.dll win32/libpthreads/bin/*.dll win32/libtalloc/bin/*.dll .release/%s
     37cp win32/libiconv/bin/*.dll win32/libpthreads/bin/*.dll win32/libtalloc/bin/*.dll trunk/lib/*.dll .release/%s
    3438cd .release && zip -r %s.zip %s
    3539mv .release/%s.zip . && rm -rf .release
     
    7377                            libtalloc_path+'lib']
    7478            env['LIBS']=['m', libpthread_name, 'iconv', 'regfi', 'talloc']
     79           
     80            # Third-party dependencies
     81            extra_obj=['%s/lib/lib%s.a' % (libpthreads_path, libpthread_name),
     82                       libiconv_path+'/lib/libiconv.dll.a',
     83                       libtalloc_path+'/lib/libtalloc.dll.a']
    7584
    76            
    77             # Libraries
     85            # Build libregfi.dll
     86            #   Core regfi source
    7887            lib_src = [input_prefix+'lib/regfi.c',
    7988                       input_prefix+'lib/winsec.c',
     
    8190                       input_prefix+'lib/lru_cache.c',
    8291                       input_prefix+'lib/void_stack.c']
    83             libregfi_static = env.Library(lib_src)
     92            regfi_o = env.Object(lib_src)
    8493
    85             extra_obj=['%s/lib/lib%s.a' % (libpthreads_path, libpthread_name),
    86                        libiconv_path+'/lib/libiconv.dll.a',
    87                        libtalloc_path+'/lib/libtalloc.dll.a',
    88                        input_prefix+'lib/libregfi.a',]
     94            regfi_obj = []
     95            for s in lib_src:
     96                regfi_obj.append(s[0:-1]+'o')
     97
     98            env.Command(input_prefix+'lib/libregfi.o', regfi_o+extra_obj,
     99                        'i586-mingw32msvc-dlltool --export-all-symbols'
     100                        +' --dllname libregfi.dll -e $TARGET'
     101                        +' -l %slib/libregfi.dll.a %s'
     102                        % (input_prefix, ' '.join(regfi_obj)))
     103
     104            env.Command(input_prefix+'lib/libregfi.dll',
     105                        input_prefix+'lib/libregfi.o',
     106                        'i586-mingw32msvc-gcc --shared -o $TARGET $SOURCE %s'
     107                        % ' '.join(regfi_obj+extra_obj))
    89108
    90109            # Executables
     
    99118        elif t in doc_targets:
    100119            ret_val += doc_cmds % (t_base,t_base,t_base,t_base,t_base)
    101 
    102         else:
    103             return '#ERROR: cannot build "%s".  Acceptable targets: %s'\
    104                    % (t, repr(source_targets+win32_targets+doc_targets))
    105120       
    106121    return ret_val
     
    117132env['BUILDERS']['Release'] = release_builder
    118133
     134if len(COMMAND_LINE_TARGETS) == 0:
     135    print('Acceptable targets: %s' % repr(all_targets))
    119136
    120137for target in COMMAND_LINE_TARGETS:
     138    AlwaysBuild(target)
     139    if target not in all_targets:
     140        print('ERROR: cannot build "%s".  Acceptable targets: %s'
     141              % (target, repr(all_targets)))
     142        break
    121143    env.Release(target, Dir(version2input(target2version(target))))
    122144
    123 
    124145Default(None)
Note: See TracChangeset for help on using the changeset viewer.