home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 October / maximum-cd-2011-10.iso / DiscContents / digsby_setup.exe / lib / distutils / ccompiler.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-06-22  |  20.4 KB  |  659 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. __revision__ = '$Id: ccompiler.py 67896 2008-12-21 17:01:26Z benjamin.peterson $'
  5. import sys
  6. import os
  7. import re
  8. from types import *
  9. from copy import copy
  10. from distutils.errors import *
  11. from distutils.spawn import spawn
  12. from distutils.file_util import move_file
  13. from distutils.dir_util import mkpath
  14. from distutils.dep_util import newer_pairwise, newer_group
  15. from distutils.util import split_quoted, execute
  16. from distutils import log
  17.  
  18. class CCompiler:
  19.     compiler_type = None
  20.     src_extensions = None
  21.     obj_extension = None
  22.     static_lib_extension = None
  23.     shared_lib_extension = None
  24.     static_lib_format = None
  25.     shared_lib_format = None
  26.     exe_extension = None
  27.     language_map = {
  28.         '.c': 'c',
  29.         '.cc': 'c++',
  30.         '.cpp': 'c++',
  31.         '.cxx': 'c++',
  32.         '.m': 'objc' }
  33.     language_order = [
  34.         'c++',
  35.         'objc',
  36.         'c']
  37.     
  38.     def __init__(self, verbose = 0, dry_run = 0, force = 0):
  39.         self.dry_run = dry_run
  40.         self.force = force
  41.         self.verbose = verbose
  42.         self.output_dir = None
  43.         self.macros = []
  44.         self.include_dirs = []
  45.         self.libraries = []
  46.         self.library_dirs = []
  47.         self.runtime_library_dirs = []
  48.         self.objects = []
  49.         for key in self.executables.keys():
  50.             self.set_executable(key, self.executables[key])
  51.         
  52.  
  53.     
  54.     def set_executables(self, **args):
  55.         for key in args.keys():
  56.             if key not in self.executables:
  57.                 raise ValueError, "unknown executable '%s' for class %s" % (key, self.__class__.__name__)
  58.             key not in self.executables
  59.             self.set_executable(key, args[key])
  60.         
  61.  
  62.     
  63.     def set_executable(self, key, value):
  64.         if type(value) is StringType:
  65.             setattr(self, key, split_quoted(value))
  66.         else:
  67.             setattr(self, key, value)
  68.  
  69.     
  70.     def _find_macro(self, name):
  71.         i = 0
  72.         for defn in self.macros:
  73.             if defn[0] == name:
  74.                 return i
  75.             i = i + 1
  76.         
  77.  
  78.     
  79.     def _check_macro_definitions(self, definitions):
  80.         for defn in definitions:
  81.             if type(defn) is TupleType:
  82.                 if len(defn) == 1 or len(defn) == 2:
  83.                     if not (type(defn[1]) is StringType or defn[1] is None) and type(defn[0]) is StringType:
  84.                         raise TypeError, "invalid macro definition '%s': " % defn + 'must be tuple (string,), (string, string), or ' + '(string, None)'
  85.                     type(defn[0]) is StringType
  86.                 return None
  87.  
  88.     
  89.     def define_macro(self, name, value = None):
  90.         i = self._find_macro(name)
  91.         if i is not None:
  92.             del self.macros[i]
  93.         
  94.         defn = (name, value)
  95.         self.macros.append(defn)
  96.  
  97.     
  98.     def undefine_macro(self, name):
  99.         i = self._find_macro(name)
  100.         if i is not None:
  101.             del self.macros[i]
  102.         
  103.         undefn = (name,)
  104.         self.macros.append(undefn)
  105.  
  106.     
  107.     def add_include_dir(self, dir):
  108.         self.include_dirs.append(dir)
  109.  
  110.     
  111.     def set_include_dirs(self, dirs):
  112.         self.include_dirs = copy(dirs)
  113.  
  114.     
  115.     def add_library(self, libname):
  116.         self.libraries.append(libname)
  117.  
  118.     
  119.     def set_libraries(self, libnames):
  120.         self.libraries = copy(libnames)
  121.  
  122.     
  123.     def add_library_dir(self, dir):
  124.         self.library_dirs.append(dir)
  125.  
  126.     
  127.     def set_library_dirs(self, dirs):
  128.         self.library_dirs = copy(dirs)
  129.  
  130.     
  131.     def add_runtime_library_dir(self, dir):
  132.         self.runtime_library_dirs.append(dir)
  133.  
  134.     
  135.     def set_runtime_library_dirs(self, dirs):
  136.         self.runtime_library_dirs = copy(dirs)
  137.  
  138.     
  139.     def add_link_object(self, object):
  140.         self.objects.append(object)
  141.  
  142.     
  143.     def set_link_objects(self, objects):
  144.         self.objects = copy(objects)
  145.  
  146.     
  147.     def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra):
  148.         if outdir is None:
  149.             outdir = self.output_dir
  150.         elif type(outdir) is not StringType:
  151.             raise TypeError, "'output_dir' must be a string or None"
  152.         
  153.         if macros is None:
  154.             macros = self.macros
  155.         elif type(macros) is ListType:
  156.             if not self.macros:
  157.                 pass
  158.             macros = macros + []
  159.         else:
  160.             raise TypeError, "'macros' (if supplied) must be a list of tuples"
  161.         if macros is None is None:
  162.             incdirs = self.include_dirs
  163.         elif type(incdirs) in (ListType, TupleType):
  164.             if not self.include_dirs:
  165.                 pass
  166.             incdirs = list(incdirs) + []
  167.         else:
  168.             raise TypeError, "'include_dirs' (if supplied) must be a list of strings"
  169.         if macros is None is None is None:
  170.             extra = []
  171.         
  172.         objects = self.object_filenames(sources, strip_dir = 0, output_dir = outdir)
  173.         if self.force:
  174.             skip_source = { }
  175.             for source in sources:
  176.                 skip_source[source] = 0
  177.             
  178.         elif depends is None:
  179.             skip_source = { }
  180.             for source in sources:
  181.                 skip_source[source] = 1
  182.             
  183.             (n_sources, n_objects) = newer_pairwise(sources, objects)
  184.             for source in n_sources:
  185.                 skip_source[source] = 0
  186.             
  187.         else:
  188.             skip_source = { }
  189.             L = depends[:] + [
  190.                 None]
  191.             for i in range(len(objects)):
  192.                 source = sources[i]
  193.                 L[-1] = source
  194.                 if newer_group(L, objects[i]):
  195.                     skip_source[source] = 0
  196.                     continue
  197.                 skip_source[source] = 1
  198.             
  199.         pp_opts = gen_preprocess_options(macros, incdirs)
  200.         build = { }
  201.         for i in range(len(sources)):
  202.             src = sources[i]
  203.             obj = objects[i]
  204.             ext = os.path.splitext(src)[1]
  205.             self.mkpath(os.path.dirname(obj))
  206.             if skip_source[src]:
  207.                 log.debug('skipping %s (%s up-to-date)', src, obj)
  208.                 continue
  209.             build[obj] = (src, ext)
  210.         
  211.         return (macros, objects, extra, pp_opts, build)
  212.  
  213.     
  214.     def _get_cc_args(self, pp_opts, debug, before):
  215.         cc_args = pp_opts + [
  216.             '-c']
  217.         if debug:
  218.             cc_args[:0] = [
  219.                 '-g']
  220.         
  221.         if before:
  222.             cc_args[:0] = before
  223.         
  224.         return cc_args
  225.  
  226.     
  227.     def _fix_compile_args(self, output_dir, macros, include_dirs):
  228.         if output_dir is None:
  229.             output_dir = self.output_dir
  230.         elif type(output_dir) is not StringType:
  231.             raise TypeError, "'output_dir' must be a string or None"
  232.         
  233.         if macros is None:
  234.             macros = self.macros
  235.         elif type(macros) is ListType:
  236.             if not self.macros:
  237.                 pass
  238.             macros = macros + []
  239.         else:
  240.             raise TypeError, "'macros' (if supplied) must be a list of tuples"
  241.         if macros is None is None:
  242.             include_dirs = self.include_dirs
  243.         elif type(include_dirs) in (ListType, TupleType):
  244.             if not self.include_dirs:
  245.                 pass
  246.             include_dirs = list(include_dirs) + []
  247.         else:
  248.             raise TypeError, "'include_dirs' (if supplied) must be a list of strings"
  249.         return (macros is None is None, macros, include_dirs)
  250.  
  251.     
  252.     def _prep_compile(self, sources, output_dir, depends = None):
  253.         objects = self.object_filenames(sources, output_dir = output_dir)
  254.         if self.force:
  255.             skip_source = { }
  256.             for source in sources:
  257.                 skip_source[source] = 0
  258.             
  259.         elif depends is None:
  260.             skip_source = { }
  261.             for source in sources:
  262.                 skip_source[source] = 1
  263.             
  264.             (n_sources, n_objects) = newer_pairwise(sources, objects)
  265.             for source in n_sources:
  266.                 skip_source[source] = 0
  267.             
  268.         else:
  269.             skip_source = { }
  270.             L = depends[:] + [
  271.                 None]
  272.             for i in range(len(objects)):
  273.                 source = sources[i]
  274.                 L[-1] = source
  275.                 if newer_group(L, objects[i]):
  276.                     skip_source[source] = 0
  277.                     continue
  278.                 skip_source[source] = 1
  279.             
  280.         return (objects, skip_source)
  281.  
  282.     
  283.     def _fix_object_args(self, objects, output_dir):
  284.         if type(objects) not in (ListType, TupleType):
  285.             raise TypeError, "'objects' must be a list or tuple of strings"
  286.         type(objects) not in (ListType, TupleType)
  287.         objects = list(objects)
  288.         if output_dir is None:
  289.             output_dir = self.output_dir
  290.         elif type(output_dir) is not StringType:
  291.             raise TypeError, "'output_dir' must be a string or None"
  292.         
  293.         return (objects, output_dir)
  294.  
  295.     
  296.     def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
  297.         if libraries is None:
  298.             libraries = self.libraries
  299.         elif type(libraries) in (ListType, TupleType):
  300.             if not self.libraries:
  301.                 pass
  302.             libraries = list(libraries) + []
  303.         else:
  304.             raise TypeError, "'libraries' (if supplied) must be a list of strings"
  305.         if libraries is None is None:
  306.             library_dirs = self.library_dirs
  307.         elif type(library_dirs) in (ListType, TupleType):
  308.             if not self.library_dirs:
  309.                 pass
  310.             library_dirs = list(library_dirs) + []
  311.         else:
  312.             raise TypeError, "'library_dirs' (if supplied) must be a list of strings"
  313.         if libraries is None is None is None:
  314.             runtime_library_dirs = self.runtime_library_dirs
  315.         elif type(runtime_library_dirs) in (ListType, TupleType):
  316.             if not self.runtime_library_dirs:
  317.                 pass
  318.             runtime_library_dirs = list(runtime_library_dirs) + []
  319.         else:
  320.             raise TypeError, "'runtime_library_dirs' (if supplied) " + 'must be a list of strings'
  321.         return (libraries is None is None is None, library_dirs, runtime_library_dirs)
  322.  
  323.     
  324.     def _need_link(self, objects, output_file):
  325.         if self.force:
  326.             return 1
  327.         if self.dry_run:
  328.             newer = newer_group(objects, output_file, missing = 'newer')
  329.         else:
  330.             newer = newer_group(objects, output_file)
  331.         return newer
  332.  
  333.     
  334.     def detect_language(self, sources):
  335.         if type(sources) is not ListType:
  336.             sources = [
  337.                 sources]
  338.         
  339.         lang = None
  340.         index = len(self.language_order)
  341.         for source in sources:
  342.             (base, ext) = os.path.splitext(source)
  343.             extlang = self.language_map.get(ext)
  344.             
  345.             try:
  346.                 extindex = self.language_order.index(extlang)
  347.                 if extindex < index:
  348.                     lang = extlang
  349.                     index = extindex
  350.             continue
  351.             except ValueError:
  352.                 continue
  353.             
  354.  
  355.         
  356.         return lang
  357.  
  358.     
  359.     def preprocess(self, source, output_file = None, macros = None, include_dirs = None, extra_preargs = None, extra_postargs = None):
  360.         pass
  361.  
  362.     
  363.     def compile(self, sources, output_dir = None, macros = None, include_dirs = None, debug = 0, extra_preargs = None, extra_postargs = None, depends = None):
  364.         (macros, objects, extra_postargs, pp_opts, build) = self._setup_compile(output_dir, macros, include_dirs, sources, depends, extra_postargs)
  365.         cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
  366.         for obj in objects:
  367.             
  368.             try:
  369.                 (src, ext) = build[obj]
  370.             except KeyError:
  371.                 continue
  372.  
  373.             self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  374.         
  375.         return objects
  376.  
  377.     
  378.     def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
  379.         pass
  380.  
  381.     
  382.     def create_static_lib(self, objects, output_libname, output_dir = None, debug = 0, target_lang = None):
  383.         pass
  384.  
  385.     SHARED_OBJECT = 'shared_object'
  386.     SHARED_LIBRARY = 'shared_library'
  387.     EXECUTABLE = 'executable'
  388.     
  389.     def link(self, target_desc, objects, output_filename, output_dir = None, libraries = None, library_dirs = None, runtime_library_dirs = None, export_symbols = None, debug = 0, extra_preargs = None, extra_postargs = None, build_temp = None, target_lang = None):
  390.         raise NotImplementedError
  391.  
  392.     
  393.     def link_shared_lib(self, objects, output_libname, output_dir = None, libraries = None, library_dirs = None, runtime_library_dirs = None, export_symbols = None, debug = 0, extra_preargs = None, extra_postargs = None, build_temp = None, target_lang = None):
  394.         self.link(CCompiler.SHARED_LIBRARY, objects, self.library_filename(output_libname, lib_type = 'shared'), output_dir, libraries, library_dirs, runtime_library_dirs, export_symbols, debug, extra_preargs, extra_postargs, build_temp, target_lang)
  395.  
  396.     
  397.     def link_shared_object(self, objects, output_filename, output_dir = None, libraries = None, library_dirs = None, runtime_library_dirs = None, export_symbols = None, debug = 0, extra_preargs = None, extra_postargs = None, build_temp = None, target_lang = None):
  398.         self.link(CCompiler.SHARED_OBJECT, objects, output_filename, output_dir, libraries, library_dirs, runtime_library_dirs, export_symbols, debug, extra_preargs, extra_postargs, build_temp, target_lang)
  399.  
  400.     
  401.     def link_executable(self, objects, output_progname, output_dir = None, libraries = None, library_dirs = None, runtime_library_dirs = None, debug = 0, extra_preargs = None, extra_postargs = None, target_lang = None):
  402.         self.link(CCompiler.EXECUTABLE, objects, self.executable_filename(output_progname), output_dir, libraries, library_dirs, runtime_library_dirs, None, debug, extra_preargs, extra_postargs, None, target_lang)
  403.  
  404.     
  405.     def library_dir_option(self, dir):
  406.         raise NotImplementedError
  407.  
  408.     
  409.     def runtime_library_dir_option(self, dir):
  410.         raise NotImplementedError
  411.  
  412.     
  413.     def library_option(self, lib):
  414.         raise NotImplementedError
  415.  
  416.     
  417.     def has_function(self, funcname, includes = None, include_dirs = None, libraries = None, library_dirs = None):
  418.         import tempfile
  419.         if includes is None:
  420.             includes = []
  421.         
  422.         if include_dirs is None:
  423.             include_dirs = []
  424.         
  425.         if libraries is None:
  426.             libraries = []
  427.         
  428.         if library_dirs is None:
  429.             library_dirs = []
  430.         
  431.         (fd, fname) = tempfile.mkstemp('.c', funcname, text = True)
  432.         f = os.fdopen(fd, 'w')
  433.         for incl in includes:
  434.             f.write('#include "%s"\n' % incl)
  435.         
  436.         f.write('main (int argc, char **argv) {\n    %s();\n}\n' % funcname)
  437.         f.close()
  438.         
  439.         try:
  440.             objects = self.compile([
  441.                 fname], include_dirs = include_dirs)
  442.         except CompileError:
  443.             return False
  444.  
  445.         
  446.         try:
  447.             self.link_executable(objects, 'a.out', libraries = libraries, library_dirs = library_dirs)
  448.         except (LinkError, TypeError):
  449.             return False
  450.  
  451.         return True
  452.  
  453.     
  454.     def find_library_file(self, dirs, lib, debug = 0):
  455.         raise NotImplementedError
  456.  
  457.     
  458.     def object_filenames(self, source_filenames, strip_dir = 0, output_dir = ''):
  459.         if output_dir is None:
  460.             output_dir = ''
  461.         
  462.         obj_names = []
  463.         for src_name in source_filenames:
  464.             (base, ext) = os.path.splitext(src_name)
  465.             base = os.path.splitdrive(base)[1]
  466.             base = base[os.path.isabs(base):]
  467.             if ext not in self.src_extensions:
  468.                 raise UnknownFileError, "unknown file type '%s' (from '%s')" % (ext, src_name)
  469.             ext not in self.src_extensions
  470.             if strip_dir:
  471.                 base = os.path.basename(base)
  472.             
  473.             obj_names.append(os.path.join(output_dir, base + self.obj_extension))
  474.         
  475.         return obj_names
  476.  
  477.     
  478.     def shared_object_filename(self, basename, strip_dir = 0, output_dir = ''):
  479.         if strip_dir:
  480.             basename = os.path.basename(basename)
  481.         
  482.         return os.path.join(output_dir, basename + self.shared_lib_extension)
  483.  
  484.     
  485.     def executable_filename(self, basename, strip_dir = 0, output_dir = ''):
  486.         if strip_dir:
  487.             basename = os.path.basename(basename)
  488.         
  489.         if not self.exe_extension:
  490.             pass
  491.         return os.path.join(output_dir, basename + '')
  492.  
  493.     
  494.     def library_filename(self, libname, lib_type = 'static', strip_dir = 0, output_dir = ''):
  495.         if lib_type not in ('static', 'shared', 'dylib'):
  496.             raise ValueError, '\'lib_type\' must be "static", "shared" or "dylib"'
  497.         lib_type not in ('static', 'shared', 'dylib')
  498.         fmt = getattr(self, lib_type + '_lib_format')
  499.         ext = getattr(self, lib_type + '_lib_extension')
  500.         (dir, base) = os.path.split(libname)
  501.         filename = fmt % (base, ext)
  502.         if strip_dir:
  503.             dir = ''
  504.         
  505.         return os.path.join(output_dir, dir, filename)
  506.  
  507.     
  508.     def announce(self, msg, level = 1):
  509.         log.debug(msg)
  510.  
  511.     
  512.     def debug_print(self, msg):
  513.         DEBUG = DEBUG
  514.         import distutils.debug
  515.         if DEBUG:
  516.             print msg
  517.         
  518.  
  519.     
  520.     def warn(self, msg):
  521.         sys.stderr.write('warning: %s\n' % msg)
  522.  
  523.     
  524.     def execute(self, func, args, msg = None, level = 1):
  525.         execute(func, args, msg, self.dry_run)
  526.  
  527.     
  528.     def spawn(self, cmd):
  529.         spawn(cmd, dry_run = self.dry_run)
  530.  
  531.     
  532.     def move_file(self, src, dst):
  533.         return move_file(src, dst, dry_run = self.dry_run)
  534.  
  535.     
  536.     def mkpath(self, name, mode = 511):
  537.         mkpath(name, mode, dry_run = self.dry_run)
  538.  
  539.  
  540. _default_compilers = (('cygwin.*', 'unix'), ('os2emx', 'emx'), ('posix', 'unix'), ('nt', 'msvc'), ('mac', 'mwerks'))
  541.  
  542. def get_default_compiler(osname = None, platform = None):
  543.     if osname is None:
  544.         osname = os.name
  545.     
  546.     if platform is None:
  547.         platform = sys.platform
  548.     
  549.     for pattern, compiler in _default_compilers:
  550.         if re.match(pattern, platform) is not None or re.match(pattern, osname) is not None:
  551.             return compiler
  552.     
  553.     return 'unix'
  554.  
  555. compiler_class = {
  556.     'unix': ('unixccompiler', 'UnixCCompiler', 'standard UNIX-style compiler'),
  557.     'msvc': ('msvccompiler', 'MSVCCompiler', 'Microsoft Visual C++'),
  558.     'cygwin': ('cygwinccompiler', 'CygwinCCompiler', 'Cygwin port of GNU C Compiler for Win32'),
  559.     'mingw32': ('cygwinccompiler', 'Mingw32CCompiler', 'Mingw32 port of GNU C Compiler for Win32'),
  560.     'bcpp': ('bcppcompiler', 'BCPPCompiler', 'Borland C++ Compiler'),
  561.     'mwerks': ('mwerkscompiler', 'MWerksCompiler', 'MetroWerks CodeWarrior'),
  562.     'emx': ('emxccompiler', 'EMXCCompiler', 'EMX port of GNU C Compiler for OS/2') }
  563.  
  564. def show_compilers():
  565.     FancyGetopt = FancyGetopt
  566.     import distutils.fancy_getopt
  567.     compilers = []
  568.     for compiler in compiler_class.keys():
  569.         compilers.append(('compiler=' + compiler, None, compiler_class[compiler][2]))
  570.     
  571.     compilers.sort()
  572.     pretty_printer = FancyGetopt(compilers)
  573.     pretty_printer.print_help('List of available compilers:')
  574.  
  575.  
  576. def new_compiler(plat = None, compiler = None, verbose = 0, dry_run = 0, force = 0):
  577.     if plat is None:
  578.         plat = os.name
  579.     
  580.     
  581.     try:
  582.         if compiler is None:
  583.             compiler = get_default_compiler(plat)
  584.         
  585.         (module_name, class_name, long_description) = compiler_class[compiler]
  586.     except KeyError:
  587.         msg = "don't know how to compile C/C++ code on platform '%s'" % plat
  588.         if compiler is not None:
  589.             msg = msg + " with '%s' compiler" % compiler
  590.         
  591.         raise DistutilsPlatformError, msg
  592.  
  593.     
  594.     try:
  595.         module_name = 'distutils.' + module_name
  596.         __import__(module_name)
  597.         module = sys.modules[module_name]
  598.         klass = vars(module)[class_name]
  599.     except ImportError:
  600.         raise DistutilsModuleError, "can't compile C/C++ code: unable to load module '%s'" % module_name
  601.     except KeyError:
  602.         raise DistutilsModuleError, ("can't compile C/C++ code: unable to find class '%s' " + "in module '%s'") % (class_name, module_name)
  603.  
  604.     return klass(None, dry_run, force)
  605.  
  606.  
  607. def gen_preprocess_options(macros, include_dirs):
  608.     pp_opts = []
  609.     for macro in macros:
  610.         if type(macro) is TupleType:
  611.             if len(macro) <= len(macro):
  612.                 pass
  613.             elif not len(macro) <= 2:
  614.                 raise TypeError, ("bad macro definition '%s': " + "each element of 'macros' list must be a 1- or 2-tuple") % macro
  615.             
  616.         if len(macro) == 1:
  617.             pp_opts.append('-U%s' % macro[0])
  618.             continue
  619.         1
  620.         if len(macro) == 2:
  621.             if macro[1] is None:
  622.                 pp_opts.append('-D%s' % macro[0])
  623.             else:
  624.                 pp_opts.append('-D%s=%s' % macro)
  625.         macro[1] is None
  626.     
  627.     for dir in include_dirs:
  628.         pp_opts.append('-I%s' % dir)
  629.     
  630.     return pp_opts
  631.  
  632.  
  633. def gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries):
  634.     lib_opts = []
  635.     for dir in library_dirs:
  636.         lib_opts.append(compiler.library_dir_option(dir))
  637.     
  638.     for dir in runtime_library_dirs:
  639.         opt = compiler.runtime_library_dir_option(dir)
  640.         if type(opt) is ListType:
  641.             lib_opts = lib_opts + opt
  642.             continue
  643.         lib_opts.append(opt)
  644.     
  645.     for lib in libraries:
  646.         (lib_dir, lib_name) = os.path.split(lib)
  647.         if lib_dir:
  648.             lib_file = compiler.find_library_file([
  649.                 lib_dir], lib_name)
  650.             if lib_file:
  651.                 lib_opts.append(lib_file)
  652.             else:
  653.                 compiler.warn("no library file corresponding to '%s' found (skipping)" % lib)
  654.         lib_file
  655.         lib_opts.append(compiler.library_option(lib))
  656.     
  657.     return lib_opts
  658.  
  659.