3 \@sddlZddlZddlmZmZddlmZddlmZdddZ dd Z dd d Z ej d krrdd lm Z dadadddZdddZdS)N)DistutilsPlatformErrorDistutilsExecError)DEBUG)logcCsNt|}tjdkr"t|||dn(tjdkresz _spawn_posix...cSsg|] }t|qSr)r()r)r*rrrr+kszF$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configure)r&zunable to execute %r: %s rz(unable to execute %r for unknown reasonszcommand %r failed: %sz"command %r terminated by signal %dz%command %r failed with exit status %dz1unknown error executing %r: termination status %dr)"rrrr execvpexecvsysplatform _cfg_targetr%get_config_varsplit_cfg_target_splitenvirongetrdictexecvpeexecveforkr!rstderrwritestrerror_exitwaitpidrr WIFSIGNALEDWTERMSIG WIFEXITED WEXITSTATUS WIFSTOPPED)rrrrr"Zexec_fnenvZ cur_targetZmy_msgpideZstatusr#Z exit_statusrrrr Xs     &     r cCs|dkrtjjdtj}|jtj}tjj|\}}tj dkrN|dkrN|d}tjj |sx*|D]"}tjj ||}tjj |r`|Sq`WdS|SdS)NPATHZwin32z.exe) r r5r6defpathr3pathseppathsplitextr/r0isfiler)r"rKpathsbaseZextpfrrrrs    r)rrr)rrr)rrr)N)r/r Zdistutils.errorsrrZdistutils.debugrZ distutilsrrrrr0r%r1r4r rrrrr s       Q