� �V~gc@s{dZdZddlZddlmZddlmZddlmZddl m Z d�Z d efd ��YZ dS( 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.s$Id$i����N(tCommand(tDistutilsSetupError(tcustomize_compiler(tlogcCsddlm}|�dS(Ni����(tshow_compilers(tdistutils.ccompilerR(R((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pyRst build_clibcBs�eZdZdddddgZdd gZdddefgZd�Zd�Z d�Z d�Z d�Z d�Z d�ZRS(s/build C/C++ libraries used by Python extensionss build-clib=tbs%directory to build C/C++ libraries tos build-temp=tts,directory to put temporary build by-productstdebugtgs"compile with debugging informationtforcetfs2forcibly build everything (ignore file timestamps)s compiler=tcsspecify the compiler types help-compilerslist available compilerscCsUd|_d|_d|_d|_d|_d|_d|_d|_d|_ dS(Ni( tNoneRt build_tempt librariest include_dirstdefinetundefR R tcompiler(tself((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pytinitialize_options6s        cCs�|jdddd d d �|jj|_|jrG|j|j�n|jdkrn|jjpeg|_nt|jt�r�|jjt j �|_ndS( NtbuildRRRR R (RR(RR(RR(R R (R R ( tset_undefined_optionst distributionRtcheck_library_listRRt isinstancetstrtsplittostpathsep(R((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pytfinalize_optionsFs  cCs�|js dSddlm}|d|jd|jd|j�|_t|j�|jdk rv|jj |j�n|j dk r�x-|j D]\}}|jj ||�q�Wn|j dk r�x$|j D]}|jj |�q�Wn|j|j�dS(Ni����(t new_compilerRtdry_runR (RRR!RR"R RRRtset_include_dirsRt define_macroRtundefine_macrotbuild_libraries(RR!tnametvaluetmacro((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pytrun_s    cCs�t|t�std�nx�|D]�}t|t� rVt|�dkrVtd�n|\}}t|t�s�tdd�nd|ks�tjdkr�tj|kr�tdd|d �nt|t�s"td d �q"q"Wd S( s`Ensure that the list of libraries is valid. `library` is presumably provided as a command option 'libraries'. This method checks that 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 tuplesis*each element of 'libraries' must a 2-tuples+first element of each tuple in 'libraries' s#must be a string (the library name)t/sbad library name '%s': s$may not contain directory separatorsis,second element of each tuple in 'libraries' s!must be a dictionary (build info)N( RtlistRttupletlenRRtseptdict(RRtlibR't build_info((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pyRws*   "   *cCs>|js dSg}x$|jD]\}}|j|�qW|S(N(RRtappend(Rt lib_namestlib_nameR2((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pytget_library_names�s  cCs�|j|j�g}xe|jD]Z\}}|jd�}|dks]t|ttf� rmtd|�n|j|�q W|S(Ntsourcessfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames( RRtgetRRR,R-Rtextend(Rt filenamesR5R2R7((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pytget_source_files�s" c Cs�x�|D]�\}}|jd�}|dksDt|ttf� r\tddd|�nt|�}tjd|�|jd�}|jd�}|jj |d|j d|d|d |j �}|jj ||d|j d |j �qWdS( NR7s&in 'libraries' option (library '%s'), s&'sources' must be present and must be sa list of source filenamessbuilding '%s' librarytmacrosRt output_dirR (R8RRR,R-RRtinfoRtcompileRR tcreate_static_libR(RRR5R2R7R<Rtobjects((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pyR&�s$"    (s build-clib=Rs%directory to build C/C++ libraries to(s build-temp=Rs,directory to put temporary build by-products(R R s"compile with debugging information(R R s2forcibly build everything (ignore file timestamps)(s compiler=R sspecify the compiler typeN(t__name__t __module__t descriptiont user_optionstboolean_optionsRRt help_optionsRR R*RR6R;R&(((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pyRs*      $ ( t__doc__t __revision__Rtdistutils.coreRtdistutils.errorsRtdistutils.sysconfigRt distutilsRRR(((sA/opt/alt/python27/lib64/python2.7/distutils/command/build_clib.pyt<module>s