Changeset 29

Show
Ignore:
Timestamp:
02/07/04 16:50:06 (5 years ago)
Author:
ug
Message:

Make build script use distutils to build extension

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 04/tools/build.py

    r27 r29  
    6363    # compile C++ extension 
    6464 
    65     for python_version in ['/usr/include/python2.1', 
    66                            '/usr/local/include/python2.0', '/usr/local/include/python2.2']: 
     65    for python_version in ['2.1', '2.2', '2.3']: 
    6766        os.chdir(targetdir) 
    68         filelist = ['matchC', 'sgfparserC'] 
     67        filelist = ['matchC.so'] 
    6968 
    7069        for file in filelist: 
    71             os.system('gcc %s.cc -O2 -I%s -fpic -shared -o %s.so' % (file, python_version, file)) 
     70            os.system('python%s setup-ext.py build' % (python_version)) 
    7271 
    73         os.system('tar cf Cext%s.tar %s' % (python_version[-3:], join([f + '.so' for f in filelist], ' '))) 
    74         os.system('gzip -f Cext%s.tar' % python_version[-3:]
    75         os.system('cp Cext%s.tar.gz %s' % (python_version[-3:], htmldir)) 
     72        os.system('tar cf Cext%s-%s.tar -C build/lib.linux-i686-%s %s' % (version, python_version, python_version, join([f for f in filelist], ' '))) 
     73        os.system('gzip -f Cext%s-%s.tar' % (version,python_version)
     74        os.system('cp Cext%s-%s.tar.gz %s' % (version,python_version[-3:], htmldir)) 
    7675 
    7776def windows(): 
     
    144143        print 'built others' 
    145144    elif target == 'html': 
    146         os.system('cp %skombilo%s/doc/tutorial.html %s' % (base, version, htmldir)) 
    147         os.system('cp %skombilo%s/doc/*.jpg %s' % (base, version, htmldir)) 
     145        os.system('cp %s/doc/tutorial.html %s' % (sourcedir, version, htmldir)) 
     146        os.system('cp %s/doc/*.jpg %s' % (sourcedir, version, htmldir)) 
    148147        print 'copied tutorial to html'