Ñò §ÚêLc @ s‹ d Z d Z d d k Z d d k Z d d k Td d k l Z d d k Td d k l Z d d k l Z d „ Z d e f d „ ƒ YZ d S( s´ distutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.s6 $Id: build_clib.py 37828 2004-11-10 22:23:15Z loewis $iÿÿÿÿN( t *( t Command( t customize_compiler( t logc C s d d k l } | ƒ d S( Niÿÿÿÿ( t show_compilers( t distutils.ccompilerR ( R ( ( s4 /usr/lib64/python2.6/distutils/command/build_clib.pyR s t build_clibc B sƒ e Z d Z d d d d d g Z d d g Z d d d e f g Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( s/ build C/C++ libraries used by Python extensionss build-clibt bs% directory to build C/C++ libraries tos build-tempt ts, directory to put temporary build by-productst debugt gs" compile with debugging informationt forcet fs2 forcibly build everything (ignore file timestamps)s compiler=t cs specify the compiler types help-compilers list available compilersc C sU d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _ d S( Ni ( t NoneR t build_tempt librariest include_dirst definet undefR R t compiler( t self( ( s4 /usr/lib64/python2.6/distutils/command/build_clib.pyt initialize_options9 s c C s¬ | i d d d d d d ƒ | i i | _ | i o | i | i ƒ n | i d j o | i i p g | _ n t | i ƒ t j o t i | i t i ƒ | _ n d S( Nt buildR R R R R ( s build_temps build_clib( s build_temps build_temp( s compilers compiler( s debugs debug( s forces force( t set_undefined_optionst distributionR t check_library_listR R t typet StringTypet stringt splitt ost pathsep( R ( ( s4 /usr/lib64/python2.6/distutils/command/build_clib.pyt finalize_optionsK s c C s | i p d Sd d k l } | d | i d | i d | i ƒ | _ t | i ƒ | i d j o | i i | i ƒ n | i d j o1 x. | i D] \ } } | i i | | ƒ q” Wn | i d j o( x% | i D] } | i i | ƒ qÕ Wn | i | i ƒ d S( Niÿÿÿÿ( t new_compilerR t dry_runR ( R R R" R R# R R R R t set_include_dirsR t define_macroR t undefine_macrot build_libraries( R R" t namet valuet macro( ( s4 /usr/lib64/python2.6/distutils/command/build_clib.pyt runi s$ c C s t | ƒ t j o t d ‚ n xß | D]× } t | ƒ t j o t | ƒ d j o t d ‚ n t | d ƒ t j o t d d ‚ n d | d j p$ t i d j o- t i | d j o t d d | d ‚ n t | d ƒ t j o t d d ‚ q' q' Wd S( s: Ensure that the list of libraries (presumably provided as a command option 'libraries') is valid, i.e. it is a list of 2-tuples, where the tuples are (library_name, build_info_dict). Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise.s+ 'libraries' option must be a list of tuplesi s* each element of 'libraries' must a 2-tuplei s+ first element of each tuple in 'libraries' s# must be a string (the library name)t /s bad library name '%s': s$ may not contain directory separatorsi s, second element of each tuple in 'libraries' s! must be a dictionary (build info)N( R t ListTypet DistutilsSetupErrort TupleTypet lenR R t sept DictionaryType( R R t lib( ( s4 /usr/lib64/python2.6/distutils/command/build_clib.pyR „ s* & 5c C s@ | i p d Sg } x$ | i D] \ } } | i | ƒ q W| S( N( R R t append( R t lib_namest lib_namet build_info( ( s4 /usr/lib64/python2.6/distutils/command/build_clib.pyt get_library_namesª s c C s‡ | i | i ƒ g } xj | i D]_ \ } } | i d ƒ } | d j p t | ƒ t t f j o t d | ‚ n | i | ƒ q W| S( Nt sourcessf in 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames( R R t getR R R- R/ R. t extend( R t filenamesR6 R7 R9 ( ( s4 /usr/lib64/python2.6/distutils/command/build_clib.pyt get_source_files¹ s c C sø xñ | D]é \ } } | i d ƒ } | d j p t | ƒ t t f j o t d d d | ‚ n t | ƒ } t i d | ƒ | i d ƒ } | i d ƒ } | i i | d | i d | d | d | i ƒ} | i i | | d | i d | i ƒq Wd S( NR9 s&