
    ;ȋh                         d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ g d	g d
g ddZg d	g d
g ddZ	g dg g dZ
g ddgddgdZ G d dej                  ZdS )a  distutils.zosccompiler

Contains the selection of the c & c++ compilers on z/OS. There are several
different c compilers on z/OS, all of them are optional, so the correct
one needs to be chosen based on the users input. This is compatible with
the following compilers:

IBM C/C++ For Open Enterprise Languages on z/OS 2.0
IBM Open XL C/C++ 1.1 for z/OS
IBM XL C/C++ V2.4.1 for z/OS 2.4 and 2.5
IBM z/OS XL C/C++
    N   )	sysconfig)DistutilsExecError   )unix)CompileError)z-m64z-fvisibility=defaultz-fzos-le-char-mode=asciiz-fno-short-enums)
-q64-qexportall-qascii-qstrict	-qnocsect-Wa,asa,goff
-Wa,xplink
-qgonumber
-qenum=int-Wc,DLL)r	   r
   r   r   r   r   r   r   r   r   z-qlanglvl=extc99)
ibm-openxlibm-xlclangibm-xlc)r	   r
   r   r   r   r   r   r   r   r   z-qlanglvl=extended0x)z-fasmz-fno-integrated-asz	-Wa,--ASAz
-Wa,--GOFFz-Wl,dllr	   c                   h     e Zd Zg dZg dZdgZd Zd fd	Zd Zd Z		 	 	 	 	 	 	 	 	 	 d fd
	Z
 xZS )Compiler)z.c.C.cc.cxx.cppz.m.s)r   r   r   r   r   c                     fddD             }t          |          dk    rdS i }dD ]}d||<   dD ]}d||<   dD ]}d	||<   |                    |d         d          S )
Nc                     g | ]C}t           j                            |d           x$t           j                                      DS N)osenvirongetpathbasename).0envvarbinarys     b/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/setuptools/_distutils/compilers/C/zos.py
<listcomp>z3Compiler._get_zos_compiler_name.<locals>.<listcomp>o   sT     
 
 
*..666
GV$$
 
 
    )CCCXXLDSHAREDr   r   )z	ibm-clangzibm-clang64zibm-clang++zibm-clang++64clangzclang++zclang-14)xlclangz	xlclang++njscznjsc++r   )xlcxlCzxlc++r   )lenr"   )selfzos_compiler_nameszos_compilerscompilerr'   s       @r(   _get_zos_compiler_namezCompiler._get_zos_compiler_namen   s    
 
 
 
3
 
 

 !""a''<
 		3 		3H '3M(##B 	4 	4H&3M(##/ 	0 	0H&/M(##  !3A!6EEEr*   Fc                     t                                          |||           |                                 | _        t	          j        |            d S r   )super__init__r8   zos_compilerr   customize_compiler)r4   verbosedry_runforce	__class__s       r(   r;   zCompiler.__init__   sJ    '5111 7799$T*****r*   c                 4   g }|| j         v r-| j        }|                    t          | j                            n|| j        v rR| j        }|                    t          | j                            |                    t          | j                            n,| j        }|                    t          | j                            |                    |           	 | 	                    ||z   |d|gz   |z              d S # t          $ r}	t          |	          d }	~	ww xY w)Nz-o)_cpp_extensionscompiler_cxxextend	_cxx_argsr<   _asm_extensionscompiler_so_cc_args	_asm_argsspawnr   r   )
r4   objsrcextcc_argsextra_postargspp_opts
local_argsr7   msgs
             r(   _compilezCompiler._compile   s%   
$&&&(Hi(9:;;;;D((('Hht'89:::i(9:;;;;'Hht'89:::'"""	$JJx*,T3/??.PQQQQQ! 	$ 	$ 	$s###	$s   !C9 9
DDDc                     d|z   S )Nz-L )r4   dirs     r(   runtime_library_dir_optionz#Compiler.runtime_library_dir_option   s    czr*   Nc                 d   t          j        d          }t           j        r7t          j                            t          j        d          d| d          }nIt          j                            t          j        d          t          j        d          d| d          }t          j                            |          r|r|                    |           n|g}|r|D ]}}|d d          D ]p}t          j                            || d          }t          j                            |          r,|                    |           |                    |            nq~|	                    t          | j                            t                                          |||||||||	|
|||           d S )N	LDVERSIONabs_builddir	libpythonz.xinstalled_base
platlibdir)r   get_config_varpython_buildr    r#   joinexistsappendremoverE   _ld_argsr<   r:   link)r4   target_descobjectsoutput_filename
output_dir	librarieslibrary_dirsruntime_library_dirsexport_symbolsdebugextra_preargsrP   
build_temptarget_lang	ldversionside_deck_pathrW   librarylibrary_side_deckrA   s                      r(   rf   zCompiler.link   s   $ ,[99	! 
	W\\(88)I))) NN
  W\\()9::(66)I))) N 7>>.)) 	2 2%%n5555"0!1   	+  (|  G(*SW...(I(I%w~~&788 !((111&--.?@@@ 	ht'89::: 	
 	
 	
 	
 	
r*   )FFF)
NNNNNFNNNN)__name__
__module____qualname__src_extensionsrC   rG   r8   r;   rT   rX   rf   __classcell__)rA   s   @r(   r   r   i   s        DDDN333OfOF F F:+ + + + + +
$ $ $&   !@
 @
 @
 @
 @
 @
 @
 @
 @
 @
r*   r   )__doc__r     r   errorsr   r   r   rI   rF   rJ   re   r   rV   r*   r(   <module>r      sU    
			       ( ( ( ( ( (                        '   F      '   	F MLL 	 v&6" }
 }
 }
 }
 }
t} }
 }
 }
 }
 }
r*   