Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s�ddlmZyddlmZWnek
r=eZnXddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZmZed�ddlmZdd	lmZdd
lTeZeZdZejdkr�ZnFejd
kr@y ddlmZeZeZWq@ek
r<q@Xnd�Zdefd��YZestejd
kr�ddddddddddd�Z n-dZddddddddddd�Z dS(i�(t	build_extN(t	copy_file(tLibrary(tnew_compiler(tcustomize_compilertget_config_vartLDSHARED(t_config_vars(tlog(t*tsharedtdarwintnt(tRTLD_NOWcCstr
|SdS(Nt(t	have_rtld(ts((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pytif_dl"sRcBs�eZd�Zd�Zeek	r@eed�r@d�Znd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zed�ZRS(
cCs@|jd}|_tj|�||_|r<|j�ndS(s;Build extensions in build directory, then copy if --inplaceiN(tinplacet
_build_exttruntcopy_extensions_to_source(tselftold_inplace((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyR-s

	c
Cs�|jd�}x�jD]�}|j|j�}|j|�}|jd�}dj|d �}|j|�}tj	j|tj	j
|��}tj	j|j|�}	t|	|d|j
d|j�|jr|j|p�j|t�qqWdS(Ntbuild_pyt.i�tverbosetdry_run(tget_finalized_commandt
extensionstget_ext_fullnametnametget_ext_filenametsplittjointget_package_dirtostpathtbasenamet	build_libRRRt_needs_stubt
write_stubtcurdirtTrue(
RRtexttfullnametfilenametmodpathtpackagetpackage_dirt
dest_filenametsrc_filename((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyR5s!
	t
pyrex_sourcescGs+tj||�p|}tj|||�S(N(Rtswig_sourcest
_du_build_ext(Rtsourcest	otherargs((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyR5MscCs�tj||�}|j|}t|t�rYtjj|�\}}|jj	|t
�Str�|jr�tjj
|�\}}tjj|d|�S|SdS(Nsdl-(RR text_mapt
isinstanceRR$R%tsplitexttshlib_compilertlibrary_filenametlibtypet	use_stubst_links_to_dynamicR!R"(RR-R.R,tfntd((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyR Us
cCs,tj|�d|_g|_i|_dS(N(Rtinitialize_optionstNoneR<tshlibsR9(R((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRCas
		cCs�tj|�|jpg|_|j|j�g|jD]}t|t�r9|^q9|_|jrs|j�nx&|jD]}|j|j	�|_
q}Wx|jD]�|j
}||j|<|jr�|j|�p�t
}|_|otot|t�|_|j|�}|_tjjtjj|j|��}|rh||jkrh|jj|�n|r�tr�tj|jkr�|jjtj�q�q�WdS(N(Rtfinalize_optionsRtcheck_extensions_listR:RREtsetup_shlib_compilerRRt
_full_nameR9tlinks_to_dynamictFalseR@R?R(R t
_file_nameR$R%tdirnameR"R'tlibrary_dirstappendR*truntime_library_dirs(RR,R-tltdR.tlibdir((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRFgs(
	
	
%$cCs�td|jd|jd|j�}|_tjdkr�tj�}z,dtd<dtd<d	td
<t	|�Wdtj
�tj|�Xn
t	|�|jdk	r�|j|j�n|jdk	r�|jD]\}}|j||�q�Wn|jdk	r+x!|jD]}|j|�qWn|jdk	rM|j|j�n|jdk	ro|j|j�n|jdk	r�|j|j�n|jdk	r�|j|j�ntj|�|_dS(NtcompilerRtforceRs0gcc -Wl,-x -dynamiclib -undefined dynamic_lookupRs -dynamiclibtCCSHAREDs.dylibtSO(RRSRRTR<tsystplatformRtcopyRtcleartupdatetinclude_dirsRDtset_include_dirstdefinetdefine_macrotundeftundefine_macrot	librariest
set_librariesRNtset_library_dirstrpathtset_runtime_library_dirstlink_objectstset_link_objectstlink_shared_objectt__get__(RRSttmpRtvaluetmacro((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRH~s:%




cCs&t|t�r|jStj||�S(N(R:Rtexport_symbolsRtget_export_symbols(RR,((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRo�scCst|j}zZt|t�r*|j|_ntj||�|jrb|j|jd�j	|�nWd||_XdS(NR(
RSR:RR<Rtbuild_extensionR(R)RR'(RR,t	_compiler((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRp�s		cCsztjg|jD]}|j^q�}dj|jjd�d dg�}x%|jD]}|||krXtSqXWtS(s?Return true if 'ext' links to a dynamic lib in the same packageRi�R(	tdicttfromkeysRERIR"R!RbR+RK(RR,tlibtlibnamestpkgtlibname((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRJ�s(&cCs�tj|�}|jd�j}x}|jD]r}|jr+tjj|j	|j
jd��}|j|d�|j|d�|r�|j|d�q�q+q+W|S(NRRs.pys.pycs.pyo(
Rtget_outputsRtoptimizeRR(R$R%R"R'RIR!RO(RtoutputsRyR,tbase((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRx�s	$cCs�tjd|j|�tjj||jjd��d}|rftjj|�rft|d��n|j	st
|d�}|jdjddd	td
�dtjj
|j�dd
dtd�dddtd�ddtd�dddg��|j�n|r�ddlm}||gdddtd|j	�|jd �j}|dkr�||gd|dtd|j	�ntjj|�r�|j	r�tj|�q�ndS(!Ns writing stub loader for %s to %sRs.pys already exists! Please delete.tws
sdef __bootstrap__():s-   global __bootstrap__, __file__, __loader__s%   import sys, os, pkg_resources, imps, dls:   __file__ = pkg_resources.resource_filename(__name__,%r)s   del __bootstrap__s    if '__loader__' in globals():s       del __loader__s#   old_flags = sys.getdlopenflags()s   old_dir = os.getcwd()s   try:s(     os.chdir(os.path.dirname(__file__))s$     sys.setdlopenflags(dl.RTLD_NOW)s(     imp.load_dynamic(__name__,__file__)s   finally:s"     sys.setdlopenflags(old_flags)s     os.chdir(old_dir)s__bootstrap__()Ri�(tbyte_compileRyiRTRtinstall_lib(RtinfoRIR$R%R"R!texiststDistutilsErrorRtopentwriteRR&RLtclosetdistutils.utilR}R+RRytunlink(Rt
output_dirR,tcompilet	stub_filetfR}Ry((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyR)�sJ%	
			

(t__name__t
__module__RRRR6thasattrR5R RCRFRHRoRpRJRxRKR)(((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyR,s						)		
		ic

Cs8|j|j|||||||||	|
||�dS(N(tlinktSHARED_LIBRARY(
Rtobjectstoutput_libnameR�RbRNRPRntdebugt
extra_preargstextra_postargst
build_tempttarget_lang((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRi�s
tstaticc
Csrtjj|�\}}
tjj|
�\}}|jd�jd�rU|d}n|j|||||�dS(NtxRti(R$R%R!R;R=t
startswithtcreate_static_lib(RR�R�R�RbRNRPRnR�R�R�R�R�R.R&R,((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyRi
s
(!tdistutils.command.build_extRR6tPyrex.Distutils.build_extRtImportErrorR$RWtdistutils.file_utilRt$distutils.tests.setuptools_extensionRtdistutils.ccompilerRtdistutils.sysconfigRRRt	distutilsRtdistutils.errorsRKRR?R>RXR+RtdlR
RRDRi(((s:/sys/lib/python2.7/distutils/tests/setuptools_build_ext.pyt<module>sJ



	

	
�					

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].