# cut 'n paste. Sigh.
import os, string
-from types import *
from distutils.core import Command
from distutils.errors import *
from distutils.sysconfig import customize_compiler
"list available compilers", show_compilers),
]
- def initialize_options (self):
+ def initialize_options(self):
self.build_clib = None
self.build_temp = None
self.force = 0
self.compiler = None
- # initialize_options()
-
-
- def finalize_options (self):
+ def finalize_options(self):
# This might be confusing: both build-clib and build-temp default
# to build-temp as defined by the "build" command. This is because
# I think that C libraries are really just temporary build
# XXX same as for build_ext -- what about 'self.define' and
# 'self.undef' ?
- # finalize_options()
-
-
- def run (self):
-
+ def run(self):
if not self.libraries:
return
self.build_libraries(self.libraries)
- # run()
-
def check_library_list(self, libraries):
"""Ensure that the list of libraries is valid.
"second element of each tuple in 'libraries' " + \
"must be a dictionary (build info)"
- def get_library_names (self):
+ def get_library_names(self):
# Assume the library list is valid -- 'check_library_list()' is
# called from 'finalize_options()', so it should be!
-
if not self.libraries:
return None
lib_names.append(lib_name)
return lib_names
- # get_library_names ()
-
- def get_source_files (self):
+ def get_source_files(self):
self.check_library_list(self.libraries)
filenames = []
for (lib_name, build_info) in self.libraries:
"a list of source filenames") % lib_name
filenames.extend(sources)
-
return filenames
- # get_source_files ()
-
def build_libraries (self, libraries):
-
for (lib_name, build_info) in libraries:
sources = build_info.get('sources')
if sources is None or type(sources) not in (ListType, TupleType):
self.compiler.create_static_lib(objects, lib_name,
output_dir=self.build_clib,
debug=self.debug)
-
- # for libraries
-
- # build_libraries ()
-
-# class build_lib