\bgdZddlZddlmZddlmZmZddlmZgdgdgd d Z gdgdgd d Z gd ggd Z gd dgd dgd Z GddeZ dS)adistutils.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) CompileErrorDistutilsExecError) UnixCCompiler)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) rr r r r r rrrrz-qlanglvl=extc99) ibm-openxl ibm-xlclangibm-xlc) rr r r r r rrrrz-qlanglvl=extended0x)z-fasmz-fno-integrated-asz -Wa,--ASAz -Wa,--GOFFz-Wl,dllrcheZdZgdZgdZdgZdZd fd ZdZdZ d fd Z xZ S) zOSCCompiler)z.c.C.cc.cxx.cppz.m.s)rrrrrcfddD}t|dkrdSi}dD]}d||<dD]}d||<dD]}d ||<||ddS) Ncg|]C}tj|dx$tjDSN)osenvirongetpathbasename).0envvarbinarys s/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/_distutils/zosccompiler.py z7zOSCCompiler._get_zos_compiler_name..nsT   *..666 G  V $ $   )CCCXXLDSHAREDrr)z ibm-clangz ibm-clang64z ibm-clang++z ibm-clang++64clangzclang++zclang-14)xlclangz xlclang++njscznjsc++r)xlcxlCzxlc++r)lenr!)selfzos_compiler_names zos_compilerscompilerr&s @r'_get_zos_compiler_namez#zOSCCompiler._get_zos_compiler_namems    3    ! " "a ' '<  3 3H'3M( # #B 4 4H&3M( # #/ 0 0H&/M( # #  !3A!6 EEEr)Fct|||||_t j|dSr)super__init__r7 zos_compilerrcustomize_compiler)r3verbosedry_runforce __class__s r'r:zzOSCCompiler.__init__sJ '5111 7799$T*****r)c4g}||jvr-|j}|t|jn||jvrR|j}|t|j|t|jn,|j}|t|j|| | ||z|d|gz|zdS#t$r} t| d} ~ wwxYw)Nz-o) _cpp_extensions compiler_cxxextend _cxx_argsr;_asm_extensions compiler_so_cc_args _asm_argsspawnrr) r3objsrcextcc_argsextra_postargspp_opts local_argsr6msgs r'_compilezzOSCCompiler._compiles% $& & &(H   i(9: ; ; ; ; D( ( ('H   ht'89 : : :   i(9: ; ; ; ;'H   ht'89 : : :'""" $ JJx*,T3/??.P Q Q Q Q Q! $ $ $s## # $s!C99 DDDc d|zS)Nz-L)r3dirs r'runtime_library_dir_optionz'zOSCCompiler.runtime_library_dir_options czr)Ncdtjd}tjr7tjtjdd|d}nItjtjdtjdd|d}tj|r| r| |n|g} |r|D]}}|ddD]p}tj||d}tj|r,||| |nq~| t|j t ||||||||| | | | | dS)N LDVERSION abs_builddir libpythonz.xinstalled_base platlibdir)rget_config_var python_buildrr"joinexistsappendremoverD_ld_argsr;r9link)r3 target_descobjectsoutput_filename output_dir libraries library_dirsruntime_library_dirsexport_symbolsdebug extra_preargsrO build_temp target_lang ldversionside_deck_pathrVlibrarylibrary_side_deckr@s r'rezzOSCCompiler.links$,[99  ! W\\(88)I)))NN  W\\()9::(66)I)))N 7>>. ) ) 2 2%%n5555"0!1  +  (|G(* SW...(I(I%w~~&788!((111&--.?@@@ ht'89:::                  r))FFF) NNNNNFNNNN) __name__ __module__ __qualname__src_extensionsrBrFr7r:rSrWre __classcell__)r@s@r'rrhsDDDN333OfOFFF:++++++ $$$&!@ @ @ @ @ @ @ @ @ @ r)r)__doc__rrerrorsrr unixccompilerrrHrErIrdrrUr)r'rsG   44444444((((((      '  F      '   FMLL   v&6"  } } } } } =} } } } } r)