Your IP : 3.145.107.223


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

�
��f�Ic@sdZddlZddlZddlZddddgZd0Zd1ZdZddd�Z	dd�Z
dd�Zdadd�Z
dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d�Zd-d�Zd.d�Zd/d�ZdS(2uShared OS X support functions.iNucompiler_fixupucustomize_config_varsucustomize_compileruget_platform_osxuCFLAGSuLDFLAGSuCPPFLAGSu
BASECFLAGSu	BLDSHAREDuLDSHAREDuCCuCXXu	PY_CFLAGSu
PY_LDFLAGSuPY_CPPFLAGSuPY_CORE_CFLAGSu_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}n|jtj�}tjj|�\}}tjdksdtj	dkr}|dkr}|d}ntjj
|�s�x9|D]1}tjj||�}tjj
|�r�|Sq�WdS|SdS(u�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    uPATHuwin32uos2u.exeN(uNoneuosuenvironusplitupathsepupathusplitextusysuplatformunameuisfileujoin(u
executableupathupathsubaseuextupuf((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_find_executables*

u_find_executablecCs�ddl}yddl}|j�}Wn.tk
rXtdtj�fd�}YnX|j|��F}d||jf}tj	|�s�|j
�jd�j�SdSWdQXdS(u0Output from successful command execution or NoneiNu/tmp/_osx_support.%suw+bu%s 2>/dev/null >'%s'uutf-8(u
contextlibutempfileuNamedTemporaryFileuImportErroruopenuosugetpiduclosingunameusystemureadudecodeustripuNone(u
commandstringu
contextlibutempfileufpucmd((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_read_output7s
u_read_outputcCs#t|�p"td|f�p"dS(u0Find a build tool on current path or using xcrunu/usr/bin/xcrun -find %su(u_find_executableu_read_output(utoolname((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_find_build_toolJsu_find_build_toolcCs�tdkr�daytd�}Wntk
r6Yq�Xztjd|j��}Wd|j�X|dk	r�dj|j	d�j
d�dd��aq�ntS(u*Return the OS X system version as a stringuu0/System/Library/CoreServices/SystemVersion.plistu=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>Nu.ii(u_SYSTEM_VERSIONuNoneuopenuIOErrorureusearchureaducloseujoinugroupusplit(ufum((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_get_system_versionSs

	1u_get_system_versioncCs4x-t|�D]}|jt�r
||=q
q
WdS(u-Remove original unmodified values for testingN(ulistu
startswithu_INITPRE(u_config_varsuk((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_remove_original_valuesqsu_remove_original_valuescCsM|j|d�}||kr?t||kr?||t|<n|||<dS(u@Save modified and original unmodified value of configuration varuN(ugetu_INITPRE(u_config_varsucvunewvalueuoldvalue((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_save_modified_valuexsu_save_modified_valuecCsmt�}|rSy&tdd�|jd�D��}WqStk
rOd}YqSXn|rit|dk�SdS(	u=Returns True if universal builds are supported on this systemcss|]}t|�VqdS(N(uint(u.0ui((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu	<genexpr>�su-_supports_universal_builds.<locals>.<genexpr>u.ui
i(i
iF(u_get_system_versionutupleusplitu
ValueErrorubooluFalse(uosx_version((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_supports_universal_builds�s	&
u_supports_universal_buildscCs>dtjkr|S|dj�d}}t|�sFtd�}nXtjj|�jd�r�td|j	dd�f�}d|kr�td�}q�n|s�t
d	��n||kr:xxtD]m}||kr�|tjkr�||j�}|d
kr	|n|d|d<t||dj
|��q�q�Wn|S(
u7Find appropriate C compiler for extension module buildsuCCiuclangugccu'%s' --versionu'u'"'"'ullvm-gccuCannot locate working compileruCXXu++u (uosuenvironusplitu_find_executableu_find_build_toolupathubasenameu
startswithu_read_outputureplaceuSystemErroru_COMPILER_CONFIG_VARSu_save_modified_valueujoin(u_config_varsuccuoldccudataucvucv_split((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_find_appropriate_compiler�s(
 #u_find_appropriate_compilercCs}xvtD]n}||kr|tjkr||}tjdd|tj�}tjdd|�}t|||�qqW|S(u5Remove all universal build arguments from config varsu
-arch\s+\w+\su u-isysroot [^ 	]*(u_UNIVERSAL_CONFIG_VARSuosuenvironureusubuASCIIu_save_modified_value(u_config_varsucvuflags((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_remove_universal_flags�s

u_remove_universal_flagscCs�dtjkr|Stjd|d�d	k	r�tjd|djdd�f�}|r�x^tD]S}||krb|tjkrb||}tjdd|�}t	|||�qbqbWq�n|S(
u-Remove any unsupported archs from config varsuCCu-arch\s+ppcuCFLAGSuNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullu'u'"'"'u-arch\s+ppc\w*\su N(
uosuenvironureusearchuNoneusystemureplaceu_UNIVERSAL_CONFIG_VARSusubu_save_modified_value(u_config_varsustatusucvuflags((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_remove_unsupported_archs�s	

u_remove_unsupported_archscCs�dtjkr�tjd}xmtD]b}||kr#d||kr#||}tjdd|�}|d|}t|||�q#q#Wn|S(u2Allow override of all archs with ARCHFLAGS env varu	ARCHFLAGSu-archu
-arch\s+\w+\su (uosuenvironu_UNIVERSAL_CONFIG_VARSureusubu_save_modified_value(u_config_varsuarchucvuflags((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_override_all_archss


u_override_all_archscCs�|jdd�}tjd|�}|dk	r�|jd�}tjj|�s�x^tD]S}||krX|tj	krX||}tj
dd|�}t|||�qXqXWq�n|S(u+Remove references to any SDKs not availableuCFLAGSuu-isysroot\s+(\S+)iu-isysroot\s+\S+(?:\s|$)u N(ugetureusearchuNoneugroupuosupathuexistsu_UNIVERSAL_CONFIG_VARSuenvironusubu_save_modified_value(u_config_varsucflagsumusdkucvuflags((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu_check_for_unavailable_sdks

u_check_for_unavailable_sdkc
Cs�d
}}t|�}t�s,d}}nd|k}d|k}|sYdtjkr�x@y$|jd�}|||d�=Wq\tk
r�PYq\Xq\ndtjkr�|r�|tjdj�}n|rx@y$|jd�}|||d�=Wq�tk
rPYq�Xq�nd}d|krG|jd�}||d}n,d|krs|jd�}||d}n|r�tj
j|�r�ddlm
}|jd|�|jd	�n|S(
ue
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    u-archu	-isysrootu	ARCHFLAGSiii(ulogu4Compiling with an SDK that doesn't seem to exist: %su$Please check your Xcode installationFTN(uFalseulistu_supports_universal_buildsuTrueuosuenvironuindexu
ValueErrorusplituNoneupathuisdiru	distutilsuloguwarn(ucompiler_soucc_argsu	stripArchustripSysrootuindexusysrootuidxulog((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyucompiler_fixup0sF	
	


	cCs.t�st|�nt|�t|�|S(u�Customize Python build configuration variables.

    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.

    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extension module build is
    requested (in distutils.sysconfig.customize_compiler).

    Currently called from distutils.sysconfig
    (u_supports_universal_buildsu_remove_universal_flagsu_override_all_archsu_check_for_unavailable_sdk(u_config_vars((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyucustomize_config_varsps
	


cCs"t|�t|�t|�|S(u�Customize compiler path and configuration variables.

    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler).
    (u_find_appropriate_compileru_remove_unsupported_archsu_override_all_archs(u_config_vars((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyucustomize_compiler�s	


cCs�|jdd�}t�p|}|p*|}|r�|}d}|jtd|jdd��}|ddkrQd|j�krQd}tjd	|�}ttt|���}t	|�d
kr�|d}q�|dkr�d}q�|dkr�d}q�|dkrd}q�|dkr&d}q�|dkr;d}q�t
d|f��q�|dkrxtjdkr�d}q�q�|dkr�tjd kr�d}q�d
}q�n|||fS(!u Filter values for get_platform()uMACOSX_DEPLOYMENT_TARGETuumacosxuCFLAGSu.u10.4.u-archufatu
-arch\s+(\S+)iiui386uppcux86_64uintelufat3uppc64ufat64u	universalu%Don't know machine value for archs=%rii uPowerPCuPower_Macintosh(ui386uppc(ui386ux86_64(ui386uppcux86_64(uppc64ux86_64(ui386uppcuppc64ux86_64l(uPowerPCuPower_Macintoshl(
ugetu_get_system_versionu_INITPREustripureufindallutupleusortedusetulenu
ValueErrorusysumaxsize(u_config_varsuosnameureleaseumachineumacveru
macreleaseucflagsuarchs((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyuget_platform_osx�sF


						(uCFLAGSuLDFLAGSuCPPFLAGSu
BASECFLAGSu	BLDSHAREDuLDSHAREDuCCuCXXu	PY_CFLAGSu
PY_LDFLAGSuPY_CPPFLAGSuPY_CORE_CFLAGS(u	BLDSHAREDuLDSHAREDuCCuCXX(u__doc__uosureusysu__all__u_UNIVERSAL_CONFIG_VARSu_COMPILER_CONFIG_VARSu_INITPREuNoneu_find_executableu_read_outputu_find_build_toolu_SYSTEM_VERSIONu_get_system_versionu_remove_original_valuesu_save_modified_valueu_supports_universal_buildsu_find_appropriate_compileru_remove_universal_flagsu_remove_unsupported_archsu_override_all_archsu_check_for_unavailable_sdkucompiler_fixupucustomize_config_varsucustomize_compileruget_platform_osx(((u1/opt/alt/python33/lib64/python3.3/_osx_support.pyu<module>s<	>(@)

?>