Your IP : 3.141.32.252


Current Path : /opt/alt/python33/lib64/python3.3/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/distutils/__pycache__/cygwinccompiler.cpython-33.pyc

�
��f}@c@sadZddlZddlZddlZddlmZmZmZddlZddl	m
Z
mZddlm
Z
ddlmZddlmZmZmZddlmZdd	lmZdd
lmZdd�ZGd
d�de
�ZGdd�de�ZdZdZdZdd�Z ej!d�Z"dd�Z#dd�Z$dd�Z%dS(udistutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
iN(uPopenuPIPEucheck_output(ugen_preprocess_optionsugen_lib_options(u
UnixCCompiler(u
write_file(uDistutilsExecErroruCompileErroruUnknownFileError(ulog(uLooseVersion(ufind_executablecCs�tjjd�}|dkr�tj|d|d�}|dkrLdgS|dkr_dgS|d	krrd
gS|dkr�dgS|d
kr�dgStd|��ndS(uaInclude the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    uMSC v.iii
u1300umsvcr70u1310umsvcr71u1400umsvcr80u1500umsvcr90u1600umsvcr100uUnknown MS Compiler version %s Ni����(usysuversionufindu
ValueError(umsc_posumsc_ver((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyu	get_msvcr>su	get_msvcrcBs�|EeZdZdZdZdZdZdZdZdZ	dZ
d	d	d	d
d�Zdd
�Zdddddd	dddddd�
Zd	ddd�ZdS(uCygwinCCompileru? Handles the Cygwin port of the GNU C compiler to Windows.
    ucygwinu.ou.au.dllulib%s%su%s%su.exeic
CsStj||||�t�\}}|jd||f�|tk	r\|jd|�nt�\|_|_|_	|j|j
d|j|j|j	f�|jdkr�d|_n	d|_|jdkr�d}nd	}|jd
ddd
dddddd|j|f�|jdkrCdg|_
|jd�nt�|_
dS(Nu%Python's GCC status: %s (details: %s)u�Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.u: gcc %s, ld %s, dllwrap %s
u2.10.90ugccudllwrapu2.13u-sharedu
-mdll -staticucompilerugcc -mcygwin -O -Wallucompiler_sougcc -mcygwin -mdll -O -Wallucompiler_cxxug++ -mcygwin -O -Wallu
linker_exeugcc -mcygwinu	linker_sou%s -mcygwin %su2.91.57umsvcrtu,Consider upgrading to a newer version of gcc(u
UnixCCompileru__init__ucheck_config_hudebug_printuCONFIG_H_OKuwarnuget_versionsugcc_versionu
ld_versionudllwrap_versionu
compiler_typeu
linker_dlluset_executablesu
dll_librariesu	get_msvcr(uselfuverboseudry_runuforceustatusudetailsu
shared_option((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyu__init__cs<			
uCygwinCCompiler.__init__cCs�|dks|dkroy |jdd|d|g�Wq�tk
rk}zt|��WYdd}~Xq�Xn]y)|j|j||d|g|�Wn1tk
r�}zt|��WYdd}~XnXdS(u:Compiles the source by spawning GCC and windres if needed.u.rcu.resuwindresu-iu-oN(uspawnuDistutilsExecErroruCompileErrorucompiler_so(uselfuobjusrcuextucc_argsuextra_postargsupp_optsumsg((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyu_compile�s "uCygwinCCompiler._compilecCs�tj|
pg�}
tj|p$g�}tj|p9g�}|j|j�|d
k	r�||jksy|jdkr�tjj|d�}tjj	tjj
|��\}}tjj||d�}tjj|d|d�}dtjj
|�dg}x|D]}|j|�qW|j
t||fd|�|jd	krx|
jd
|g�|
jd|g�q�|j|�n|	s�|
jd�ntj||||||||d
|	|
|||
�d
S(uLink the objects.ugcciu.defulibu.au
LIBRARY %suEXPORTSu
writing %sudllwrapu--output-libu--defu-sN(ucopyuextendu
dll_librariesuNoneu
EXECUTABLEu
linker_dlluosupathudirnameusplitextubasenameujoinuappenduexecuteu
write_fileu
UnixCCompilerulink(uselfutarget_descuobjectsuoutput_filenameu
output_diru	librariesulibrary_dirsuruntime_library_dirsuexport_symbolsudebugu
extra_preargsuextra_postargsu
build_temputarget_langutemp_dirudll_nameu
dll_extensionudef_fileulib_fileucontentsusym((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyulink�s:			
	uCygwinCCompiler.linkucCs�|dkrd}ng}x�|D]�}tjjtjj|��\}}||jddgkr~td||f��n|r�tjj|�}n|dkr�|jtjj	||||j
��q"|jtjj	|||j
��q"W|S(u#Adds supports for rc and res files.uu.rcu.resu"unknown file type '%s' (from '%s')N(u.resu.rc(uNoneuosupathusplitextunormcaseusrc_extensionsuUnknownFileErrorubasenameuappendujoinu
obj_extension(uselfusource_filenamesu	strip_diru
output_diru	obj_namesusrc_nameubaseuext((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyuobject_filenames�s 	
$u CygwinCCompiler.object_filenamesN(u__name__u
__module__u__qualname__u__doc__u
compiler_typeu
obj_extensionustatic_lib_extensionushared_lib_extensionustatic_lib_formatushared_lib_formatu
exe_extensionu__init__u_compileuNoneulinkuobject_filenames(u
__locals__((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyuCygwinCCompilerXs;		KuCygwinCCompilercBs5|EeZdZdZdZddddd�ZdS(uMingw32CCompileru@ Handles the Mingw32 port of the GNU C compiler to Windows.
    umingw32icCs�tj||||�|jdkr.d}nd}|jdkrLd}nd}|jdksjt�rsd}nd}|jd	d
|dd|d
d|dd|dd|j|||f�g|_t�|_dS(Nu2.13u-sharedu
-mdll -staticu2.91.57u--entry _DllMain@12uu4u -mno-cygwinucompilerugcc%s -O -Wallucompiler_sougcc%s -mdll -O -Wallucompiler_cxxug++%s -O -Wallu
linker_exeugcc%su	linker_sou
%s%s %s %s(	uCygwinCCompileru__init__u
ld_versionugcc_versionuis_cygwingccuset_executablesu
linker_dllu
dll_librariesu	get_msvcr(uselfuverboseudry_runuforceu
shared_optionuentry_pointu	no_cygwin((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyu__init__s&			


		uMingw32CCompiler.__init__N(u__name__u
__module__u__qualname__u__doc__u
compiler_typeu__init__(u
__locals__((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyuMingw32CCompilersuMingw32CCompileruokunot oku	uncertaincCs�ddlm}dtjkr)tdfS|j�}yPt|�}z2d|j�krgtd|fStd|fSWd|j	�XWn<t
k
r�}ztd	||jffSWYdd}~XnXdS(
uwCheck if the current Python installation appears amenable to building
    extensions with GCC.

    Returns a tuple (status, details), where 'status' is one of the following
    constants:

    - CONFIG_H_OK: all is well, go ahead and compile
    - CONFIG_H_NOTOK: doesn't look good
    - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h

    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    i(u	sysconfiguGCCusys.version mentions 'GCC'u__GNUC__u'%s' mentions '__GNUC__'u '%s' does not mention '__GNUC__'Nucouldn't read '%s': %s(
u	distutilsu	sysconfigusysuversionuCONFIG_H_OKuget_config_h_filenameuopenureaduCONFIG_H_NOTOKucloseuIOErroruCONFIG_H_UNCERTAINustrerror(u	sysconfigufnuconfig_huexc((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyucheck_config_hHs
ucheck_config_hs(\d+\.\d+(\.\d+)*)cCs�|j�d}t|�dkr&dSt|dddt�j}z|j�}Wd|j�Xt	j
|�}|dkr~dSt|jd�j
��S(u�Find the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
    iushellustdoutNiT(usplitufind_executableuNoneuPopenuTrueuPIPEustdoutureaducloseu
RE_VERSIONusearchuLooseVersionugroupudecode(ucmdu
executableuoutu
out_stringuresult((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyu_find_exe_versionusu_find_exe_versioncCs&dddg}tdd�|D��S(ug Try to find out the versions of gcc, ld and dllwrap.

    If not possible it returns None for it.
    ugcc -dumpversionuld -vudllwrap --versioncSsg|]}t|��qS((u_find_exe_version(u.0ucmd((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyu
<listcomp>�s	u get_versions.<locals>.<listcomp>(utuple(ucommands((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyuget_versions�suget_versionscCs%tddg�}|j�jd�S(u>Try to determine if the gcc that would be used is from cygwin.ugccu-dumpmachinescygwin(ucheck_outputustripuendswith(u
out_string((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyuis_cygwingcc�suis_cygwingcc(&u__doc__uosusysucopyu
subprocessuPopenuPIPEucheck_outputureudistutils.ccompilerugen_preprocess_optionsugen_lib_optionsudistutils.unixccompileru
UnixCCompilerudistutils.file_utilu
write_fileudistutils.errorsuDistutilsExecErroruCompileErroruUnknownFileErroru	distutilsulogudistutils.versionuLooseVersionudistutils.spawnufind_executableu	get_msvcruCygwinCCompileruMingw32CCompileruCONFIG_H_OKuCONFIG_H_NOTOKuCONFIG_H_UNCERTAINucheck_config_hucompileu
RE_VERSIONu_find_exe_versionuget_versionsuis_cygwingcc(((u>/opt/alt/python33/lib64/python3.3/distutils/cygwinccompiler.pyu<module>s.)�2+

?>