-í
ì¶<c       sË     d  Z   	 d Z  d k Z d k Z d k Z d k Z  d k T d k l Z  d k	 T d k
 l Z  d k l Z  d k l Z  e i d ƒ Z  d	 „  Z  d
 e f d „  ƒ  YZ d S(   s¶   distutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).s9   $Id: build_ext.py,v 1.77 2001/12/06 22:59:54 fdrake Exp $N(   s   *(   s   Command(   s   customize_compiler(   s   newer_group(   s	   Extensions3   ^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$c     s!     d k  l }   |  ƒ  d  S(   N(   s   show_compilers(   s   distutils.ccompilers   show_compilers(   s   show_compilers(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   show_compilers s   s	   build_extc      s¶   t  Z   d Z 4 d e i Z 5 d d d f d d d f d	 d
 d d f d d d e f d d d f d d d f d d d f d d d e f d d d f d d  d! f d" d# d$ f d% d& d' f d( d) d* f d+ e d, f g Z U d	 d" d% d+ g Z W d- e d. e	 f g Z
 \ d/ „  Z p d0 „  Z Æ d1 „  Z d2 „  Z [d3 „  Z fd4 „  Z yd5 „  Z d6 „  Z éd7 „  Z d8 „  Z 7d9 „  Z =d: „  Z Kd; „  Z Wd< „  Z RS(=   Ns8   build C/C++ extensions (compile/link to build directory)s    (separated by '%s')s
   build-lib=s   bs(   directory for compiled extension moduless   build-temp=s   ts1   directory for temporary files (build by-products)s   inplaces   is=   ignore build-lib and put compiled extensions into the source s,   directory alongside your pure Python moduless   include-dirs=s   Is.   list of directories to search for header filess   define=s   Ds   C preprocessor macros to defines   undef=s   Us!   C preprocessor macros to undefines
   libraries=s   ls!   external C libraries to link withs   library-dirs=s   Ls.   directories to search for external C librariess   rpath=s   Rs7   directories to search for shared C libraries at runtimes   link-objects=s   Os2   extra explicit link objects to include in the links   debugs   gs'   compile/link with debugging informations   forces   fs2   forcibly build everything (ignore file timestamps)s	   compiler=s   cs   specify the compiler types   swig-cpps)   make SWIG create C++ files (default is C)s   help-compilers   list available compilersc    sÇ   \ ] t  |  _ ^ t  |  _ _ t  |  _ ` d |  _ a t  |  _ c t  |  _ d t  |  _ e t  |  _	 f t  |  _
 g t  |  _ h t  |  _ i t  |  _ j t  |  _ k t  |  _ l t  |  _ m t  |  _ d  S(   Ni    (   s   Nones   selfs
   extensionss	   build_libs
   build_temps   inplaces   packages   include_dirss   defines   undefs	   librariess   library_dirss   rpaths   link_objectss   debugs   forces   compilers   swig_cpp(   s   self(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   initialize_options\ s    c    sõ  p q d k  l } s |  i d t d d f u d d f v d d f w d d f x d d f ƒ z |  i t j o { |  i i |  _ n } |  i i |  _	 ‚ | i
 ƒ  } ƒ | i
 d d	 ƒ } „ |  i t j o … |  i i p g  |  _ n † t |  i ƒ t j o" ‡ t i |  i t i ƒ |  _ n ‹ |  i i | ƒ Œ | | j o  |  i i | ƒ n  t |  i ƒ t j o  |  i g |  _ n ” |  i t j o • g  |  _ n – |  i t j o — g  |  _ n< ˜ t |  i ƒ t j o" ™ t i |  i t i ƒ |  _ n › |  i t j o œ g  |  _ n<  t |  i ƒ t j o" ž t i |  i t i ƒ |  _ n £ t i d
 j ov ¤ |  i i t i i t i d ƒ ƒ ¥ |  i o" ¦ t i i |  i d ƒ |  _ n ¨ t i i |  i d ƒ |  _ n ¬ t i d  d j os ­ t i  t i! t i ƒ d j o: ¯ |  i i t i i t i" d d t i# d  d ƒ ƒ n ² |  i i d ƒ n ¹ |  i$ o4 º t i |  i$ d ƒ } » t& d „  | ƒ |  _$ n À |  i' o Á t i |  i' d ƒ |  _' n d  S(   N(   s	   sysconfigs   builds	   build_libs
   build_temps   compilers   debugs   forces   plat_specifici   s   nts   libss   Debugs   Releasei   s   cygwiniÿÿÿÿs   libs   pythoni   s   configs   .s   ,c    s   » |  d f S(   Ns   1(   s   symbol(   s   symbol(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   <lambda>» s    ((   s	   distutilss	   sysconfigs   selfs   set_undefined_optionss   packages   Nones   distributions   ext_packages   ext_moduless
   extensionss   get_python_incs
   py_includes   plat_py_includes   include_dirss   types
   StringTypes   strings   splits   oss   pathseps   appends	   librariess   library_dirss   rpaths   names   paths   joins   syss   exec_prefixs   debugs
   build_temps   platforms   finds
   executables   prefixs   versions   defines   definess   maps   undef(   s   selfs   plat_py_includes
   py_includes	   sysconfigs   defines(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   finalize_optionsp sZ   """%""":c  	  sZ  Æ È d k  l } Ö |  i o × d  Sn Ü |  i i ƒ  oL Ý |  i d ƒ } Þ |  i i	 | i
 ƒ  p g  ƒ ß |  i i | i ƒ n ã | d |  i ä d |  i å d |  i æ d |  i ƒ |  _ ç t |  i ƒ í |  i t j	 o î |  i i |  i ƒ n ï |  i t j	 o: ñ x0 |  i Dñ ]" \ } } ò |  i i | | ƒ q$Wn ó |  i t j	 o1 ô x' |  i Dô ] } õ |  i i | ƒ qqWn ö |  i t j	 o ÷ |  i i |  i ƒ n ø |  i t j	 o ù |  i i |  i ƒ n ú |  i t j	 o û |  i i |  i ƒ n ü |  i  t j	 o ý |  i i! |  i  ƒ n  |  i" ƒ  d  S(   N(   s   new_compilers
   build_clibs   compilers   verboses   dry_runs   force(#   s   distutils.ccompilers   new_compilers   selfs
   extensionss   distributions   has_c_librariess   get_finalized_commands
   build_clibs	   librariess   extends   get_library_namess   library_dirss   appends   compilers   verboses   dry_runs   forces   customize_compilers   include_dirss   Nones   set_include_dirss   defines   names   values   define_macros   undefs   macros   undefine_macros   set_librariess   set_library_dirss   rpaths   set_runtime_library_dirss   link_objectss   set_link_objectss   build_extensions(   s   selfs   names   macros
   build_clibs   values   new_compiler(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   runÆ s>      	c 
   sï  t  | ƒ t j	 o t d ‚ n x¹t t | ƒ ƒ D]¢} | | }	 t |	 t	 ƒ o
 qB n |	 \ } } |  i d | ƒ t  |	 ƒ t j	 o t |	 ƒ d j o t d ‚ n "t  | ƒ t j o t i | ƒ o $t d ‚ n (t  | ƒ t j	 o )t d ‚ n /t	 | | d ƒ }	 3x\ d d	 d
 d d d f D3]? } 9| i | ƒ } :| t j	 o ;t |	 | | ƒ n q`W>| i d ƒ |	 _ ?| i d ƒ o @|  i d ƒ n E| i d ƒ } F| oÜ Gg  |	 _ Hg  |	 _ Ixº | DI]¯ } Jt  | ƒ t j o! d t | ƒ j o
 d j n o Lt d ‚ n Ot | ƒ d j o P|	 i i | d ƒ n. Qt | ƒ d j o R|	 i i | ƒ n q Wn T|	 | | <qB Wd S(   s¬  Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        s:   'ext_modules' option must be a list of Extension instancessu   old-style (ext_name, build_info) tuple found in ext_modules for extension '%s'-- please convert to Extension instancei   sM   each element of 'ext_modules' option must be an Extension instance or 2-tuplesR   first element of each tuple in 'ext_modules' must be the extension name (a string)sO   second element of each tuple in 'ext_modules' must be a dictionary (build info)s   sourcess   include_dirss   library_dirss	   librariess   extra_objectss   extra_compile_argss   extra_link_argss   rpaths   def_files9   'def_file' element of build info dict no longer supporteds   macrosi   s9   'macros' element of build info dict must be 1- or 2-tuplei    N(   s   types
   extensionss   ListTypes   DistutilsSetupErrors   ranges   lens   is   exts
   isinstances	   Extensions   ext_names
   build_infos   selfs   warns	   TupleTypes
   StringTypes   extension_name_res   matchs   DictionaryTypes   keys   gets   vals   Nones   setattrs   runtime_library_dirss   has_keys   macross   define_macross   undef_macross   macros   append(
   s   selfs
   extensionss   keys   ext_names
   build_infos   vals   is   macros   macross   ext(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   check_extensions_listsL   	 	
)' 	

 	;c    sW   [\|  i |  i ƒ ]g  } `x' |  i D`] } a| i | i ƒ q, Wc| Sd  S(   N(   s   selfs   check_extensions_lists
   extensionss	   filenamess   exts   extends   sources(   s   selfs   exts	   filenames(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   get_source_files[s   	 	c    s‡   fk|  i |  i ƒ pg  } qxW |  i Dq]I } r|  i | i ƒ } s| i t	 i
 i |  i t|  i | ƒ ƒ ƒ q, Wu| Sd  S(   N(   s   selfs   check_extensions_lists
   extensionss   outputss   exts   get_ext_fullnames   names   fullnames   appends   oss   paths   joins	   build_libs   get_ext_filename(   s   selfs   outputss   fullnames   ext(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   get_outputsfs   	 	c    sD   y||  i |  i ƒ ~x$ |  i D~] } |  i | ƒ q# Wd  S(   N(   s   selfs   check_extensions_lists
   extensionss   exts   build_extension(   s   selfs   ext(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   build_extensionsys    	c    s2  ƒ| i } „| t j p t | ƒ t t f j o …t d d d | i ‚ n ‰t | ƒ } ‹|  i
 | i ƒ } Œ|  i oŠ t i | d ƒ } ‘t i | d d !d ƒ } ’| d } ”|  i d ƒ } •| i | ƒ } –t i i | —|  i | ƒ ƒ } n( ™t i i |  i š|  i | ƒ ƒ } œ|  i p t | | d ƒ o" |  i d	 | i ƒ Ÿd  Sn ¡|  i d
 | i ƒ ¦|  i | ƒ } ¶| i  p g  }	 ¸| i" }
 ¹x' | i$ D¹] } º|
 i& | f ƒ qÒWÁt i' i( d ƒ o$ Â|	 i) t i t i' d ƒ ƒ n Ä|  i* i+ | Åd |  i, Æd |
 Çd | i- Èd |  i. Éd |	 ƒ} Ô| |  _0 Ù| i1 o Ú| i) | i1 ƒ n Û| i2 p g  }	 Þ|  i* i3 | | àd |  i4 | ƒ ád | i5 âd | i6 ãd |	 äd |  i7 | ƒ åd |  i. æd |  i, ƒd  S(   Ns*   in 'ext_modules' option (extension '%s'), s&   'sources' must be present and must be s   a list of source filenamess   .i    iÿÿÿÿs   build_pys   newers$   skipping '%s' extension (up-to-date)s   building '%s' extensions   CFLAGSs
   output_dirs   macross   include_dirss   debugs   extra_postargss	   librariess   library_dirss   runtime_library_dirss   export_symbolss
   build_temp(8   s   exts   sourcess   Nones   types   ListTypes	   TupleTypes   DistutilsSetupErrors   names   lists   selfs   get_ext_fullnames   fullnames   inplaces   strings   splits   modpaths   joins   packages   bases   get_finalized_commands   build_pys   get_package_dirs   package_dirs   oss   paths   get_ext_filenames   ext_filenames	   build_libs   forces   newer_groups   announces   swig_sourcess   extra_compile_argss
   extra_argss   define_macross   macross   undef_macross   undefs   appends   environs   has_keys   extends   compilers   compiles
   build_temps   include_dirss   debugs   objectss   _built_objectss   extra_objectss   extra_link_argss   link_shared_objects   get_librariess   library_dirss   runtime_library_dirss   get_export_symbols(   s   selfs   exts   sourcess   bases   modpaths   ext_filenames   undefs   build_pys   packages
   extra_argss   macross   objectss   fullnames   package_dir(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   build_extensionsZ   )! 	$		c    s  éïñg  }
 òg  } óh  } ú|  i o ûd }	 n
 ýd }	 ÿx… | Dÿ]z }  t i	 i
 | ƒ \ } } | d j o9 |
 i | |	 ƒ | i | ƒ |
 d | | <n |
 i | ƒ qN W| o 	|
 Sn |  i ƒ  } | d d d g } |  i o | i d ƒ n xU | D]J } | | } |  i d	 | | f ƒ |  i | d
 | | g ƒ q4W|
 Sd S(   sü   Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        s   .cpps   .cs   .iiÿÿÿÿs   -pythons   -dnones   -ISWIGs   -c++s   swigging %s to %ss   -oN(   s   new_sourcess   swig_sourcess   swig_targetss   selfs   swig_cpps
   target_exts   sourcess   sources   oss   paths   splitexts   bases   exts   appends	   find_swigs   swigs   swig_cmds   targets   announces   spawn(   s   selfs   sourcess   swig_sourcess   sources   swigs   swig_cmds   swig_targetss   exts   bases
   target_exts   new_sourcess   target(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   swig_sourcesés6   				
 	
 	!c    s¶   t  i d j o  d Sn !t  i d j oh &x^ d d d f D&]C } 't  i i d | d ƒ } (t  i i | ƒ o )| Sn qJ W+d Sn .t d	 t  i ‚ d
 S(   s›   Return the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        s   posixs   swigs   nts   1.3s   1.2s   1.1s	   c:\swig%ss   swig.exes>   I don't know how to find (much less run) SWIG on platform '%s'N(   s   oss   names   verss   paths   joins   fns   isfiles   DistutilsPlatformError(   s   selfs   verss   fn(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys	   find_swigs    	c    s7   78|  i t j o 9| Sn ;|  i d | Sd  S(   Ns   .(   s   selfs   packages   Nones   ext_name(   s   selfs   ext_name(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   get_ext_fullname7s   c    s—   =ACd k  l } Dt i | d ƒ } F| d ƒ } Gt i d j o |  i
 o" Ht t i i | ƒ d | Sn It t i i | ƒ | Sd S(   s¦   Convert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        (   s   get_config_vars   .s   SOs   nts   _dN(   s   distutils.sysconfigs   get_config_vars   strings   splits   ext_names   ext_paths   so_exts   oss   names   selfs   debugs   applys   paths   join(   s   selfs   ext_names   get_config_vars   so_exts   ext_path(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   get_ext_filename=s   "c    s^   KPRd t  i | i d ƒ d } S| | i j o T| i i | ƒ n U| i Sd S(   s  Return the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "init" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "init" function.
        s   inits   .iÿÿÿÿN(   s   strings   splits   exts   names   initfunc_names   export_symbolss   append(   s   selfs   exts   initfunc_name(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   get_export_symbolsKs
    c    s  W[ad k  l } bt i d j o t |  i | ƒ oa dd } e|  i o f| d } n g| t i	 d ?t i	 d ?d @f } k| i | g Sne lt i d  d	 j oC md
 } n| t i	 d ?t i	 d ?d @f } r| i | g Sn t| i Sd S(   sÓ   Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        (   s   MSVCCompilers   win32s
   python%d%ds   _di   i   iÿ   i   s   cygwins   python%d.%dN(   s   distutils.msvccompilers   MSVCCompilers   syss   platforms
   isinstances   selfs   compilers   templates   debugs
   hexversions	   pythonlibs   exts	   libraries(   s   selfs   exts   MSVCCompilers   templates	   pythonlib(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   get_librariesWs   '	%	%(   s   __name__s
   __module__s   descriptions   oss   pathseps   sep_bys   Nones   user_optionss   boolean_optionss   show_compilerss   help_optionss   initialize_optionss   finalize_optionss   runs   check_extensions_lists   get_source_filess   get_outputss   build_extensionss   build_extensions   swig_sourcess	   find_swigs   get_ext_fullnames   get_ext_filenames   get_export_symbolss   get_libraries(    (    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys	   build_ext s&   		½ V?Vh0(   s   __doc__s   __revision__s   syss   oss   strings   res   typess   distutils.cores   Commands   distutils.errorss   distutils.sysconfigs   customize_compilers   distutils.dep_utils   newer_groups   distutils.extensions	   Extensions   compiles   extension_name_res   show_compilerss	   build_ext(   s   customize_compilers   __revision__s   strings	   Extensions   oss   syss   res   Commands   show_compilerss   extension_name_res   newer_groups	   build_ext(    (    s1   /usr/lib/python2.2/distutils/command/build_ext.pys   ? s   	'

