Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2011-11-30 10:48:18 -0500
committerAndrew Gvozdev2011-11-30 10:48:48 -0500
commit3099ae40a1d83721e3ac4b2b2d49985449443cc1 (patch)
tree4bb1b5ad1b2ab99f59687bf20e941076544f511e /build/org.eclipse.cdt.make.core
parent6e0560d4f59e2091b15bc5359774fff628108f2d (diff)
downloadorg.eclipse.cdt-3099ae40a1d83721e3ac4b2b2d49985449443cc1.tar.gz
org.eclipse.cdt-3099ae40a1d83721e3ac4b2b2d49985449443cc1.tar.xz
org.eclipse.cdt-3099ae40a1d83721e3ac4b2b2d49985449443cc1.zip
bug 304139: [Scanner Discovery] Compiler inspection does not work for
gcc with non-english locale
Diffstat (limited to 'build/org.eclipse.cdt.make.core')
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java25
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java17
2 files changed, 11 insertions, 31 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
index 1b8d8b8d14..9d482eb606 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -58,7 +58,6 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
private static final String EXTERNAL_SI_PROVIDER_ERROR = "ExternalScannerInfoProvider.Provider_Error"; //$NON-NLS-1$
private static final String GMAKE_ERROR_PARSER_ID = "org.eclipse.cdt.core.GmakeErrorParser"; //$NON-NLS-1$
private static final String PREF_CONSOLE_ENABLED = "org.eclipse.cdt.make.core.scanner.discovery.console.enabled"; //$NON-NLS-1$
- private static final String LANG_ENV_VAR = "LANG"; //$NON-NLS-1$
private static final String NEWLINE = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
private static final String PATH_ENV = "PATH"; //$NON-NLS-1$
@@ -262,21 +261,19 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
private Properties getEnvMap(ICommandLauncher launcher, Properties initialEnv) {
// Set the environmennt, some scripts may need the CWD var to be set.
- Properties props = initialEnv != null ? initialEnv : launcher.getEnvironment();
-
- if (fWorkingDirectory != null) {
+ Properties props = initialEnv != null ? initialEnv : launcher.getEnvironment();
+
+ if (fWorkingDirectory != null) {
props.put("CWD", fWorkingDirectory.toOSString()); //$NON-NLS-1$
props.put("PWD", fWorkingDirectory.toOSString()); //$NON-NLS-1$
}
- // On POSIX (Linux, UNIX) systems reset LANG variable to English with
- // UTF-8 encoding
- // since GNU compilers can handle only UTF-8 characters. English language is chosen
- // beacuse GNU compilers inconsistently handle different locales when generating
- // output of the 'gcc -v' command. Include paths with locale characters will be
- // handled properly regardless of the language as long as the encoding is set to UTF-8.
- if (props.containsKey(LANG_ENV_VAR)) {
- props.put(LANG_ENV_VAR, "en_US.UTF-8"); //$NON-NLS-1$
- }
+ // On POSIX (Linux, UNIX) systems reset LANG variable to English with
+ // UTF-8 encoding since GNU compilers can handle only UTF-8 characters.
+ // Include paths with locale characters will be handled properly regardless
+ // of the language as long as the encoding is set to UTF-8.
+ // English language is chosen because parser relies on English messages
+ // in the output of the 'gcc -v' command.
+ props.put("LC_ALL", "en_US.UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$
return props;
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java
index e7257b4790..8ecb3e935e 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/GCCSpecsRunSIProvider.java
@@ -11,11 +11,9 @@
package org.eclipse.cdt.make.internal.core.scannerconfig2;
import java.util.List;
-import java.util.Properties;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
-import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCScannerConfigUtil;
@@ -28,21 +26,6 @@ import org.eclipse.core.runtime.CoreException;
* @author vhirsl
*/
public class GCCSpecsRunSIProvider extends DefaultRunSIProvider {
- /**
- * Override LC_ALL so {@link org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser}
- * understands the diagnostics generated when non-English locale is active.
- *
- * @see org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser
- */
- @Override
- protected String[] setEnvironment(ICommandLauncher launcher, Properties initialEnv) {
- Properties extendedEnv = new Properties();
- extendedEnv.putAll(initialEnv);
- extendedEnv.put("LC_ALL", "C"); //$NON-NLS-1$ //$NON-NLS-2$
-
- return super.setEnvironment(launcher, extendedEnv);
- }
-
/* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig2.DefaultRunSIProvider#initialize()
*/

Back to the top