https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/numpy/distutils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/numpy/distutils/__pycache__/mingw32ccompiler.cpython-310.pyc
o

6��aJc�@s�dZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlZddl
mZddlmZddlmZddlmZddlmZmZmZmZd	d
�Zeej_e�d�Ze�d�Z Gd
d�dejj!�Z"dd�Z#dd�Z$dd�Z%dd�Z&d>dd�Z'dd�Z(dd�Z)dd�Z*d d!�Z+iZ,ejd"kr�z/ddl-Z-d#e,d$<d%e,d&<d'e,d(<d)e,d*<e.e-d+�r�e-j/�0d,d-�\Z1Z2Z3e-j/e,e1e2<[1[2[3Wne4y�e
�5d.�Ynwd/d0�Z6d?d2d3�Z7d4d5�Z8d6d7�Z9d8d9�Z:d:d;�Z;d<d=�Z<dS)@a
Support code for building Python extensions on Windows.

    # NT stuff
    # 1. Make sure libpython<version>.a exists for gcc.  If not, build it.
    # 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
    # 3. Force windows to use g77

�N)�log)�
StrictVersion)�
UnixCCompiler)�get_build_version)�UnknownFileError)�msvc_runtime_library�msvc_runtime_version�msvc_runtime_major�get_build_architecturecCst�}|dur	gS|gS)zBReplacement for outdated version of get_msvcr from cygwinccompilerN)r)�msvcr�r�B/usr/lib/python3/dist-packages/numpy/distutils/mingw32ccompiler.py�get_msvcr_replacement$srz\[Ordinal/Name Pointer\] Tablez$^\s+\[([\s*[0-9]*)\] ([a-zA-Z0-9_]*)c@sHeZdZdZdZ			ddd�Z						d
dd�Z			dd
d�ZdS)�Mingw32CCompilerzH A modified MingW32 compiler compatible with an MSVC built Python.

    �mingw32rc
	Cs�tjj�||||�|jdur6z	t�ddg�}Wn
ttfy%d}Ynwt	�
d|�}|r6t|�d��|_|jdkr>d}nd}|j
dkrId|_n|j
dkrQd	|_t�t�}td
d�}|s`|re|�d�t�}	|	rr|�d
d|	�t�dkr�|jdkr�|jddddd�n6|jddddd�n,|jdkr�|jdddd|j|fd�n|jdkr�|jdd dd!d�n	|jd"d#d$d%d�d	g|_dS)&N�gccz-dumpversion�z
(\d+\.\d+)�z2.91.57z--entry _DllMain@12�dllwrapzg++T)�debug�NPY_MINGW_USE_CUSTOM_MSVCR�__MSVCRT_VERSION__z0x%04i�AMD64z4.0z/gcc -g -DDEBUG -DMS_WIN64 -mno-cygwin -O0 -WallzCgcc -g -DDEBUG -DMS_WIN64 -mno-cygwin -O0 -Wall -Wstrict-prototypeszgcc -g -mno-cygwinzgcc -g -mno-cygwin -shared)�compiler�compiler_so�
linker_exe�	linker_soz#gcc -g -DDEBUG -DMS_WIN64 -O0 -Wallz7gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypeszgcc -gzgcc -g -shared�3.0.0zgcc -mno-cygwin -O2 -wz0gcc -mno-cygwin -mdll -O2 -w -Wstrict-prototypeszg++ -mno-cygwinz%s -mno-cygwin -mdll -static %szgcc -mno-cygwin -O2 -Wallz-gcc -mno-cygwin -O2 -Wall -Wstrict-prototypeszg++ -mno-cygwin -sharedz
gcc -O2 -Wallz!gcc -O2 -Wall -Wstrict-prototypeszg++ zg++ -shared)�	distutils�cygwinccompiler�CygwinCCompiler�__init__�gcc_version�
subprocess�check_output�OSError�CalledProcessError�re�searchr�group�
linker_dll�linker�build_import_library�build_msvcr_library�define_macrorr
�set_executables�compiler_cxx)
�self�verbose�dry_run�force�
out_string�result�entry_point�
msvcr_success�msvcr_dbg_success�
msvcr_versionrrr
r!9s��
�






��
��
��zMingw32CCompiler.__init__NcCspt�}|r|s	g}|�|�||||||||d|	|
|||
f}|jdkr)tjjj}ntj}||d|jj	��dS)Nr)
r�appendr"rrr �linkr�__code__�co_argcount)r1�target_desc�objects�output_filename�
output_dir�	libraries�library_dirs�runtime_library_dirs�export_symbolsr�
extra_preargs�extra_postargs�
build_temp�target_lang�runtime_library�args�funcrrr
r<�s2
�
zMingw32CCompiler.linkrc	Cs�|durd}g}|D]\}tj�tj�|��\}}tj�|�\}}|r(|dd�}||jddgvr9td||f��|rAtj�|�}|dksI|dkrY|�tj�	||||j
��q
|�tj�	|||j
��q
|S)Nrr�.rcz.resz"unknown file type '%s' (from '%s'))�os�path�splitext�normcase�
splitdrive�src_extensionsr�basenamer;�join�
obj_extension)	r1�source_filenames�	strip_dirrB�	obj_names�src_name�base�ext�drvrrr
�object_filenames�s.����z!Mingw32CCompiler.object_filenames)rrr)NrNNNN)rr)�__name__�
__module__�__qualname__�__doc__�
compiler_typer!r<r_rrrr
r2s"
�u
�,�rc
Cs@tjg}ttd�rtjtjkr|�tj�nttd�r'tjtjkr'|�tj�gd�}g}|D]}|D]}|�tj�||��q3q/dtj	vrS|�tj�tj	dd��t
tjdd��\}}t�
�}|dkrod|�|�d	�}n
|d
krzd|�d�}nd
}td|�|D]}tj�||�}	tj�|	�r�|	Sq�td||f��)N�base_prefix�real_prefix)r�lib�bin�
SYSTEMROOT�System32��CPython�python�.dll�PyPy�libpypyz-c.dllz!Unknown platform {implementation}zLooking for %sz%s not found in %s)�sys�prefix�hasattrrer;rfrOrPrV�environ�tuple�version_info�platform�python_implementation�print�exists�
ValueError)
�stems�sub_dirs�lib_dirs�stem�folder�
major_version�
minor_version�implementation�dllname�dllrrr
�find_python_dll�s6�
�r�cCst�dd|g�}|�d�S)Nzobjdump.exez-p�
)r#r$�split)r��strrr
�
dump_tables
r�c	Cs(t|�}tt|��D]
}t�||���rnq
td��g}t|dt|��D]}t�||���}|rF|�t	|�
d����|�
d�f�q't|�dkrTt�
d|�t|d��1}|�dtj�|��|�d�|�d	�|�d
�|D]}|�d|d�qvWd�dS1s�wYdS)
z�Given a dll file location,  get all its exported symbols and dump them
    into the given def file.

    The .def file will be overwrittenzSymbol table not foundrrkrzNo symbols found in %s�wzLIBRARY        %s
z,;CODE          PRELOAD MOVEABLE DISCARDABLE
z;DATA          PRELOAD SINGLE
z	
EXPORTS
z%s
N)r��range�len�_START�match�decoder{�_TABLEr;�intr)�stripr�warn�open�writerOrPrU)	r��dfile�dump�i�syms�j�m�d�srrr
�generate_def s.�$


�"�r�cs4ddd�t���fdd�}dd�}||�p||�S)N�amd64�x86)r�Intelcsdtj�tj�dd�d�}tj�|�sdSt�|�D]\}}}||vr/�|vr/tj�||�SqdS)N�WINDIRz
C:\WINDOWS�winsxs)rOrPrVrt�getrz�walk)�dll_name�winsxs_path�root�dirs�files��archrr
�_find_dll_in_winsxsEs��z%find_dll.<locals>._find_dll_in_winsxscSsLtjgtjd�d�D]}tj�||�}tj�|�r#tj�|�SqdS)N�PATH�;)	rqrrrOrtr�rPrVrz�abspath)r�rP�filepathrrr
�_find_dll_in_pathPs��z#find_dll.<locals>._find_dll_in_path)r
)r�r�r�rr�r
�find_dll@s��r�FcCstjdkrdSt�}|durt�d�dS|dkr t�d�dSt�}|r)|d7}d|}tj�tj	d|�}tj�
|�rFt�d	|f�d
S|d}t|�}|sYt�d|�dSd
|}tj�tj	d|�}t�
d||f�t||�dd|d|g}	t�|	�}
t�|�|
S)N�ntFz?Skip building import library: Runtime is not compiled with MSVC�Pz=Skip building msvcr library: custom functionality not presentr�zlib%s.a�libsz(Skip building msvcr library: "%s" existsTrnz*Cannot build msvcr library: "%s" not foundz	lib%s.defz&Building msvcr library: "%s" (from %s)�dlltool�-d�-l)rO�namer	rrrrPrVrqrr�isfiler�r��infor�r#�call�remove)r�	msvcr_ver�
msvcr_name�out_name�out_file�msvcr_dll_name�dll_file�def_name�def_file�cmd�retcoderrr
r-ZsH


���


r-cCs<tjdkrdSt�}|dkrt�S|dkrt�Std|��)Nr�rr�zUnhandled arch %s)rOr�r
�_build_import_library_amd64�_build_import_library_x86r{r�rrr
r,�s
r,c
Cs�ttjdd��\}}gd�}tjg}ttd�r%tjtjkr%|�tj�nttd�r6tjtjkr6|�tj�ddg}g}|D]}|||f}|D]}|D]
}	|�tj	�
||	|��qLqHq>|D]}
tj	�|
�rld|
fSq^d	|d
fS)zACheck if an import library for the Python runtime already exists.Nrk)zlibpython%d%d.azlibpython%d%d.dll.azlibpython%d.%d.dll.arerfr�rgTFr)rurqrvrrrsrer;rfrOrPrVr�)r�r��patternsr|r}�
candidates�pat�filename�stem_dirr��fullnamerrr
�_check_for_import_lib�s*���r�cCs�t�\}}|rt�d|�dSt�}t�d||f�dttjdd��}tj	�
tjd|�}t||�dd|d|g}t
�|�dS)	N�)Skip building import library: "%s" existsz4Building import library (arch=AMD64): "%s" (from %s)�python%d%d.defrkr�r�r�r�)r�rrr�r�rurqrvrOrPrVrrr�r#�
check_call)�
out_existsr�r�r�r�r�rrr
r��s
�
r�cCs�t�\}}|rt�d|�dSdttjdd��}tj�tj	d|�}tj�
|�sZttd�r8tj�tjd|�}nttd�rGtj�tj
d|�}nd}tj�
|�rR|}nt�d	|�dSt�d
|�ddlm}d
ttjdd��}tj�tj	d|�}|j|j|gdd�}|�|�\}	}
t|d��}|�|	|
|j|�Wd�n1s�wYt�}dd|d|d|g}
t�|
�}|r�t�d�dS)z; Build the import libraries for Mingw32-gcc on Windows
    r�Nzpython%d%d.librkr�rerfrz+Cannot build import library: "%s" not foundz(Building import library (ARCH=x86): "%s"r)�lib2defr�F)�shellr�r�z	--dllnamez--defz--output-libz:Failed to build import library for gcc. Linking will fail.)r�rrrurqrvrOrPrVrrr�rsrerfr�r��numpy.distutilsr��getnm�
DEFAULT_NM�parse_nmr��
output_def�
DEF_HEADERr�r#r$)r�r��lib_name�lib_file�base_libr�r�r��	nm_output�dlist�flist�fidr�r��statusrrr
r��sJ


���

r��win32z8.0.50727.42�80z9.0.21022.8�90z10.0.30319.460�100z
14.15.26726.0�140�CRT_ASSEMBLY_VERSION�.rkz9Cannot import msvcrt: using manifest will not be possiblecCsTztt|d|�}Wntytd||f�d�wt�d�}||||d�S)zUGiven a major and minor version of the MSVCR, returns the
    corresponding XML file.�
z)Version %d,%d of MSVCRT not supported yetNa�        <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
          <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
            <security>
              <requestedPrivileges>
                <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
              </requestedPrivileges>
            </security>
          </trustInfo>
          <dependency>
            <dependentAssembly>
              <assemblyIdentity type="win32" name="Microsoft.VC%(maj)d%(min)d.CRT" version="%(fullver)s" processorArchitecture="*" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
            </dependentAssembly>
          </dependency>
        </assembly>)�fullver�maj�min)�_MSVCRVER_TO_FULLVER�str�KeyErrorr{�textwrap�dedent)r�r�r��templaterrr
�msvc_manifest_xml2s���
	r�r�cCs4|dkrd}n
|dkrd}ntd|��d||fS)aWReturn the rc file used to generate the res file which will be embedded
    as manifest for given manifest file name, of given type ('dll' or
    'exe').

    Parameters
    ----------
    name : str
            name of the manifest file to embed
    type : str {'dll', 'exe'}
            type of the binary which will embed the manifest

    r�rk�exerzType %s not supportedz&#include "winuser.h"
%d RT_MANIFEST %s)r{)r��type�rctyperrr
�manifest_rcRs
�r�cCs2t�}|r|t|�kstdt|�|f��dSdS)z6msver is the ms runtime version used for the MANIFEST.zKDiscrepancy between linked msvcr (%d) and the one about to be embedded (%d)N)r	r�r{)�msverr�rrr
�!check_embedded_msvcr_match_linkedjs
���r�cCs&tj�|�dgd��}tj�|�dS)N�yo�cr)rOrPrU�_gen_temp_sourcefilerQ)�configr\rrr
�configtest_namevsrcCst|�}|jj}||dS)Nz	.manifest)rr�
exe_extension)rr��exextrrr
�
manifest_namezsrcCst|�}|dS)NrN)r)rr�rrr
�rc_name�srcCs�t�}|durH|dkrJt|�t|��d�\}}tt|�t|��}tt|�d��}|j�	t|��|�
|�Wd�dS1sAwYdSdSdS)N�r�r�)�get_build_msvc_versionr�r�r�r�r�r�r�
temp_filesr;r�)rr��ma_str�mi_str�manxml�manrrr
�generate_manifest�s"��r)F)r�)=rcrOrwrqr#r'r��numpy.distutils.ccompiler�numpyr�r�distutils.cygwinccompilerr�distutils.versionr�distutils.unixccompilerr�distutils.msvccompilerrr	�distutils.errorsr�numpy.distutils.misc_utilrrr	r
rr�	get_msvcr�compiler�r�r rr�r�r�r�r-r,r�r�r�r��msvcrtrsr�r��major�minor�rest�ImportErrorr�r�r�r�rrrrrrrr
�<module>sj	

B) 
;$B

��
 

https://t.me/RX1948 - 2025