String pathStr = binPath;
//if OS is Windows (Windows specific settings)
if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) { //$NON-NLS-1$ //$NON-NLS-2$
try {
//try to find mingw or cygwin path from PATH environment variable
IBuildEnvironmentVariable envPath = llvmEnvironmentVariables
.get(ENV_VAR_NAME_PATH);
IBuildEnvironmentVariable mingwPath=null, cygwinPath=null;
//if path is empty
if (envPath == null) {
//try to find mingw path from MingwEnvironmentVariableSupplier
IConfigurationEnvironmentVariableSupplier mingwEnvironmentVariables =
new MingwEnvironmentVariableSupplier();
mingwPath = mingwEnvironmentVariables.getVariable(
ENV_VAR_NAME_PATH, null, null);
//try to find cygwin path from GnuCygwinConfigurationEnvironmentSupplier
IConfigurationEnvironmentVariableSupplier cygwinEnvironmentVariables =
new GnuCygwinConfigurationEnvironmentSupplier();
cygwinPath = cygwinEnvironmentVariables.getVariable(
ENV_VAR_NAME_PATH, null, null);
}
//if mingw found
if (mingwPath != null) {
//form full path
pathStr = pathStr + System.getProperty("path.separator") + mingwPath.getValue(); //$NON-NLS-1$
}
//if cygwin found
if (cygwinPath != null) {
//form full path
pathStr = pathStr + System.getProperty("path.separator") + cygwinPath.getValue(); //$NON-NLS-1$