
    <h=                    >   % S SK Jr  S SKJr  S SKrS SKrS SKJr  SSK	J
r
  SSK
JrJr  SSK	Jr  S S	KJr  \R                   (       a  SS
KJr  Sr/ SQr0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS _S!S"_S#S$_S%S&_S'S(_S)S*_S+S,_S-S._S/S00ErS1\S2'   0 S3S4_S5S6_S7S8_S9S:_S;S<_S=S>_S?S@_SASB_SCSD_SESF_SGSH_SISJ_SKSL_SMSN_SOSP_SQSR_SSST_SUSV0ErS1\SW'   0 \E\ErSXSYSZS[S\.rS1\S]'    " S^ S_\5      r " S` Sa5      r\" SbSc9 " Sd Se\5      5       r " Sf Sg5      r " Sh Si5      rg)j    )annotations)	dataclassN)Enum   )mesonlib)EnvironmentExceptionHoldableObject)mlog)Path)ElementaryOptionValues)%aarch64alphaarcarmavrc2000c6000cskydspice2kft32ia64loongarch64m68k
microblazemipsmips64msp430pariscpic24ppcppc64riscv32riscv64rl78rxs390s390xsh4sparcsparc64sw_64wasm32wasm64x86x86_64tricore)r   r   r   r   r   r"   r$   r(   r+   r,   r.   r0   cCCcppCXXcsCSCcythonCYTHONdDCfortranFCobjcOBJCobjcppOBJCXXrustRUSTCvalaVALACnasmNASMc_ldCC_LDcpp_ldCXX_LDd_ldDC_LD
fortran_ldFC_LDobjc_ldOBJC_LD	objcpp_ld	OBJCXX_LDrust_ldRUSTC_LDzT.Mapping[str, str]ENV_VAR_COMPILER_MAParARasASldLDnmNMobjcopyOBJCOPYobjdumpOBJDUMPranlibRANLIBreadelfREADELFsizeSIZEstringsSTRINGSstripSTRIPwindresWINDREScmakeCMAKEqmakeQMAKE
pkg-config
PKG_CONFIGmakeMAKEvapigenVAPIGENzllvm-configLLVM_CONFIGENV_VAR_TOOL_MAPD_LDF_LDRUST_LD	OBJCPP_LD)rL   rN   rT   rR   DEPRECATED_ENV_PROG_MAPc                       \ rS rSrSrSrSrSrg)CMakeSkipCompilerTest   alwaysneverdep_only N)__name__
__module____qualname____firstlineno__ALWAYSNEVERDEP_ONLY__static_attributes__r       u/mnt/mint/home/seanl/mnt/public/Repos/ladybird/Build/vcpkg/downloads/tools/meson-1.9.0-d1fcc2/mesonbuild/envconfig.pyr   r      s    FEHr   r   c                      \ rS rSr S SS jjrSS jrSS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSS jrSS jrSS jrSS jrSS jrSS jrS S jrSS!S jjrSrg)"
Properties   Nc                $    U=(       d    0 U l         g N
properties)selfr   s     r   __init__Properties.__init__   s     %*r   c                &    US-   U R                   ;   $ N_stdlibr   )r   languages     r   
has_stdlibProperties.has_stdlib   s    )#t66r   c                    U R                   US-      n[        U[        5      (       a  U$ [        U[        5      (       d   eU H  n[        U[        5      (       a  M   e   U$ r   )r   
isinstancestrlist)r   r   stdlibis       r   
get_stdlibProperties.get_stdlib   s\    I!56fc""M&$''''Aa%%%% r   c                r    U R                   R                  SS 5      nUb  [        U[        5      (       d   eU$ )Nrootr   getr   r   )r   r   s     r   get_rootProperties.get_root   s4    ""640|z$4444r   c                r    U R                   R                  SS 5      nUb  [        U[        5      (       d   eU$ )Nsys_rootr   )r   r   s     r   get_sys_rootProperties.get_sys_root   s5    ??&&z48:h#<#<<<r   c                    U R                   R                  SS 5      nUc  U$ [        R                  " U5      nU H  n[	        U[
        5      (       a  M   e   U$ )Npkg_config_libdir)r   r   r   listifyr   r   )r   presr   s       r   get_pkg_config_libdir Properties.get_pkg_config_libdir   sU    OO 3T:9Hq!Aa%%%% 
r   c                t    SU R                   ;  a  gU R                   S   n[        U[        5      (       d   eU$ )Ncmake_defaultsTr   r   boolr   r   s     r   get_cmake_defaultsProperties.get_cmake_defaults   s8    4??2oo./#t$$$$
r   c                    SU R                   ;  a  g U R                   S   n[        U[        5      (       d   e[        U5      nUR	                  5       (       d  [        SU S35      eU$ )Ncmake_toolchain_filezcmake_toolchain_file (z) is not absolute)r   r   r   r   is_absoluter   )r   rawr   s      r   get_cmake_toolchain_file#Properties.get_cmake_toolchain_file   sh    !8oo45#s#####Cy#//11&)?uDU'VWW##r   c           
     @   SU R                   ;  a  [        R                  $ U R                   S   n[        U[        5      (       d   e [        U5      $ ! [
         a@    [        SR                  U[         Vs/ s H  o"R                  PM     Os  snf sn5      5      ef = f)Ncmake_skip_compiler_testzO"{}" is not a valid value for cmake_skip_compiler_test. Supported values are {})	r   r   r   r   r   
ValueErrorr   formatvalue)r   r   es      r   get_cmake_skip_compiler_test'Properties.get_cmake_skip_compiler_test   s    %T__<(111oo89#s####	H(-- 	H&a/DE/D!gg/DEFH H	Hs   
A #B6BBc                t    SU R                   ;  a  gU R                   S   n[        U[        5      (       d   eU$ )Ncmake_use_exe_wrapperTr   r   s     r   get_cmake_use_exe_wrapper$Properties.get_cmake_use_exe_wrapper   s8    "$//9oo56#t$$$$
r   c                    [         R                  " SU R                  R                  S5      5      nU(       a  [	        U5      $ S $ )NT.Optional[str]	java_home)Tcastr   r   r   r   r   s     r   get_java_homeProperties.get_java_home   s3    ($//*=*=k*JK#tE{--r   c                    [         R                  " U R                  R                  S/ 5      5      n[	        S U 5       5      (       d  [        S5      e[        R                  " SU5      $ )Nbindgen_clang_argumentsc              3  B   #    U  H  n[        U[        5      v   M     g 7fr   r   r   .0vs     r   	<genexpr>4Properties.get_bindgen_clang_args.<locals>.<genexpr>   s     5u!:a%%u   z?bindgen_clang_arguments must be a string or an array of stringsT.List[str])r   r   r   r   allr   r   r   r   s     r   get_bindgen_clang_args!Properties.get_bindgen_clang_args   sS      !4!45NPR!ST5u555&'hiivvmU++r   c                t    [        U[        U 5      5      (       a  U R                  UR                  :H  $ [        $ r   )r   typer   NotImplemented)r   others     r   __eq__Properties.__eq__   s.    eT$Z((??e&6&666r   c                     U R                   U   $ r   r   )r   keys     r   __getitem__Properties.__getitem__   s    s##r   c                    XR                   ;   $ r   r   )r   items     r   __contains__Properties.__contains__   s    &&r   c                8    U R                   R                  X5      $ r   )r   r   )r   r   defaults      r   r   Properties.get  s    ""300r   r   r   )r   z/T.Optional[T.Dict[str, ElementaryOptionValues]])r   r   returnr   )r   r   r   T.Union[str, T.List[str]])r   r   )r   T.Optional[T.List[str]]r   r   )r   zT.Optional[Path])r   r   r   r   )r   objectr   r   )r   r   r   0T.Optional[T.Union[str, bool, int, T.List[str]]])r   z$T.Union[str, bool, int, T.List[str]]r   r   )r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      sg     KO+G+7

$
H.,$'1 1r   r   T)unsafe_hashc                  $   \ rS rSr% S\S'   S\S'   S\S'   S\S'   S\S'   S\S	'   S S
 jrS!S jr\S"S j5       rS#S jr	S#S jr
S#S jrS#S jrS#S jrS#S jrS#S jrS#S jrS#S jrS#S jrS#S jrS#S jrS#S jrS#S jrS!S jrS!S jrS#S jrSrg)$MachineInfoi  r   system
cpu_familycpuendianr   kernel	subsystemc                4    U R                   [        ;   U l        g r   )r  CPU_FAMILIES_64_BIT	is_64_bitr   s    r   __post_init__MachineInfo.__post_init__  s    #2EEr   c                V    SU R                    SU R                   SU R                   S3$ )Nz<MachineInfo:  z (z)>)r  r  r  r  s    r   __repr__MachineInfo.__repr__  s*    }Adoo->b
"MMr   c           	        [        S UR                  5        5       5      (       d   S5       e[        R                  " SU5      n1 SknU[	        U5      -
  (       a-  [        SU S3SR                  U[	        U5      -
  5      -   5      eUS   nU[        ;  a  [        R                  " S	U S
35        US   nUS;  a  [        R                  " SU 35        US   nUR                  SS 5      nUR                  SS 5      nU " XdUS   XWU5      $ )Nc              3  B   #    U  H  n[        U[        5      v   M     g 7fr   r   r   s     r   r   +MachineInfo.from_literal.<locals>.<genexpr>  s     <|!:a%%|r   zfor mypyzT.Dict[str, str]>   r  r  r  r  zMachine info is currently 
zbut is missing {}.r  zUnknown CPU family zF, please report this at https://github.com/mesonbuild/meson/issues/newr  )littlebigzUnknown endian r  r  r	  r  )r   valuesr   r   setr   r   known_cpu_familiesr
   warningr   )	clsr   literalminimum_literalr  r  r  r  r	  s	            r   from_literalMachineInfo.from_literal  s    <szz|<<<HjH<&&+S1CS\)&,WIR8$++Oc'l,JKLM M \*
//LL.zl  ;A  B  C"**LL?6(34"Xt,KKT2	6wu~vyQQr   c                     U R                   S:H  $ )z
Machine is windows?
windowsr  r  s    r   
is_windowsMachineInfo.is_windows/       {{i''r   c                     U R                   S:H  $ )z
Machine is cygwin?
cygwinr%  r  s    r   	is_cygwinMachineInfo.is_cygwin5       {{h&&r   c                     U R                   S:H  $ )z
Machine is linux?
linuxr%  r  s    r   is_linuxMachineInfo.is_linux;       {{g%%r   c                     U R                   S;   $ )z6
Machine is Darwin (macOS/iOS/tvOS/visionOS/watchOS)?
>   iostvosdarwinwatchosvisionosr%  r  s    r   	is_darwinMachineInfo.is_darwinA  s     {{NNNr   c                     U R                   S:H  $ )z
Machine is Android?
androidr%  r  s    r   
is_androidMachineInfo.is_androidG  r(  r   c                     U R                   S:H  $ )z
Machine is Haiku?
haikur%  r  s    r   is_haikuMachineInfo.is_haikuM  r2  r   c                     U R                   S:H  $ )z
Machine is NetBSD?
netbsdr%  r  s    r   	is_netbsdMachineInfo.is_netbsdS  r-  r   c                     U R                   S:H  $ )z
Machine is OpenBSD?
openbsdr%  r  s    r   
is_openbsdMachineInfo.is_openbsdY  r(  r   c                     U R                   S:H  $ )zMachine is DragonflyBSD?	dragonflyr%  r  s    r   is_dragonflybsdMachineInfo.is_dragonflybsd_  s    {{k))r   c                     U R                   S:H  $ )zMachine is FreeBSD?freebsdr%  r  s    r   
is_freebsdMachineInfo.is_freebsdc  s    {{i''r   c                     U R                   S:H  $ )zMachine is illumos or Solaris?sunosr%  r  s    r   is_sunosMachineInfo.is_sunosg  s    {{g%%r   c                     U R                   S:H  $ )z
Machine is GNU/Hurd?
gnur%  r  s    r   is_hurdMachineInfo.is_hurdk       {{e##r   c                     U R                   S:H  $ )z
Machine is aix?
aixr%  r  s    r   is_aixMachineInfo.is_aixq  r[  r   c                8    U R                   R                  S5      $ )zMachine is IRIX?irix)r  
startswithr  s    r   is_irixMachineInfo.is_irixw  s    {{%%f--r   c                Z    U R                  5       (       d  U R                  5       (       a  gg)Nexe r&  r+  r  s    r   get_exe_suffixMachineInfo.get_exe_suffix~  s!    ?? 0 0r   c                0    U R                  5       (       a  gg)Nobjo)r&  r  s    r   get_object_suffixMachineInfo.get_object_suffix  s    ??r   c                P    U R                  5       =(       d    U R                  5       $ r   rh  r  s    r   libdir_layout_is_win MachineInfo.libdir_layout_is_win  s     4DNN$44r   )r  N)r   None)r   r   )r   z#T.Dict[str, ElementaryOptionValues]r   z'MachineInfo'r   )r   r   r   r   __annotations__r  r  classmethodr!  r&  r+  r0  r9  r=  rA  rE  rI  rM  rQ  rU  rY  r^  rc  ri  rn  rq  r   r   r   r   r  r    s    KO	HKFN R R6('&O(&'(*(&$$.5r   r  c                      \ rS rSr S
 SS jjr\SS j5       r\SS j5       r\SS j5       r\	SS j5       r
SS jrS	rg)BinaryTablei  Nc                >   0 U l         U(       Ga  UR                  5        Hb  u  p#[        U[        [        45      (       d  [
        R                  " SU< SU< S35      e[
        R                  " U5      U R                   U'   Md     SU R                   ;   a  SU R                   ;  a2  [        R                  " SSS9  U R                   S   U R                   S'   O7U R                   S   U R                   S   :w  a  [
        R                  " S	5      e U R                   S	 g g g )
NzInvalid type z for entry z in cross file	pkgconfigrs   zF"pkgconfig" entry is deprecated and should be replaced by "pkg-config"F)fatalzAMismatched pkgconfig and pkg-config binaries in the machine file.)
binariesitemsr   r   r   r   MesonExceptionr   r
   deprecation)r   r{  namecommands       r   r   BinaryTable.__init__  s     35!)!1!'D#;77"11'{+dX^TV V&.&6&6w&?d#	 "2
 dmm+t}}4$$%muz{26--2LDMM,/]];/4==3NN"112uvv MM+. , r   c                      [         R                  " SS/[         R                  [         R                  S9  S/$ ! [        [         R                  4 a    / s $ f = f)Nccache	--versionstdoutstderr
subprocess
check_callPIPEOSErrorCalledProcessErrorr   r   r   detect_ccacheBinaryTable.detect_ccache  sT    	!!8["9*//ZdZiZij z 667 	I	   49 AAc                      [         R                  " SS/[         R                  [         R                  S9  S/$ ! [        [         R                  4 a    / s $ f = f)Nsccacher  r  r  r   r   r   detect_sccacheBinaryTable.detect_sccache  sT    	!!9k"::??[e[j[jk { 667 	I	r  c                 d    [         R                  5       n U (       a  U $ [         R                  5       $ r   )rw  r  r  )caches    r   detect_compiler_cache!BinaryTable.detect_compiler_cache  s)     **,L((**r   c                    [         R                  " U5      nUS   S:X  a  USS  nU R                  5       nO#US   S:X  a  USS  nU R                  5       nOUn/ nU(       d  [	        SUS    35      eX44$ )Nr   r  r   r  z+Compiler cache specified without compiler: )r   stringlistifyr  r  r   )r  entrypartscompilerr  s        r   parse_entryBinaryTable.parse_entry  s    &&u-8xQRyH&&(F1X"QRyH'')FHF&)TUZ[\U]T^'_``r   c                ~    U R                   R                  U5      nU(       d  gUS   R                  5       (       d  gU$ )zLookup binary in cross/native file and fallback to environment.

Returns command with args as list if found, Returns `None` if nothing is
found.
Nr   )r{  r   rk   )r   r  r  s      r   lookup_entryBinaryTable.lookup_entry  s9     --##D)!!##r   )r{  r   )r{  z2T.Optional[T.Mapping[str, ElementaryOptionValues]]r   )r  r   r   z!T.Tuple[T.List[str], T.List[str]])r  r   r   r   )r   r   r   r   r   staticmethodr  r  r  ru  r  r  r   r   r   r   rw  rw    sk     LP/H/4     + +    "r   rw  c                  ,    \ rS rSrSSS jjrSS jrSrg)	CMakeVariablesi  Nc                .   U=(       d    0 n0 U l         UR                  5        Ho  u  p#[        R                  " U5      nU H@  n[	        U[
        5      (       a  M  [        SU SU S[        U5      R                   S35      e   X0R                   U'   Mq     g )NzValue 'z' of CMake variable 'z!' defined in a machine file is a z and not a str)		variablesr|  r   r   r   r   r   r   r   )r   r  r   r   r   s        r   r   CMakeVariables.__init__  s    O	35#//+JC$$U+E!!S)).;PQTPUUvw{|}w~  xH  xH  wI  IW  0X  Y  Y  #(NN3 ,r   c                    U R                   $ r   r  r  s    r   get_variablesCMakeVariables.get_variables  s    ~~r   r  r   )r  zT.Optional[T.Dict[str, T.Any]]r   rs  )r   zT.Dict[str, T.List[str]])r   r   r   r   r   r  r   r   r   r   r  r    s    	(r   r  )
__future__r   dataclassesr   r  typingr   enumr   rg  r   r   r	   r
   pathlibr   TYPE_CHECKINGoptionsr   r  r  rV   rt  rz   ENV_VAR_PROG_MAPr   r   r   r  rw  r  r   r   r   <module>r     s   # !     :  ??/ & T  -- 
5- 	%	-
 h- - t- F- h- G- G- F- G-  h!-" G#-$ '%-& y'-( )-* z+- ) 2)$) 	$) 	$	)
 	$) y) y) h) y) F) y) W) y)  W!)" W#)$ ,%)& F')( y))* =+) % 0 @*?.>? 
 	0 , D 
f1 f1P tF5. F5 F5PQ Qf r   