Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2013-12-05 16:16:51 -0500
committerJeff Johnston2013-12-05 17:28:40 -0500
commitbd84e07bc62eb24a354c659d5ebf618fcc5bcf60 (patch)
tree3aa28c88634ac0bf5be8966eec2a47b926c7f108 /build/org.eclipse.cdt.autotools.core/src
parent4dab99404c4652336af7c74662304a1a40a6f29b (diff)
downloadorg.eclipse.cdt-bd84e07bc62eb24a354c659d5ebf618fcc5bcf60.tar.gz
org.eclipse.cdt-bd84e07bc62eb24a354c659d5ebf618fcc5bcf60.tar.xz
org.eclipse.cdt-bd84e07bc62eb24a354c659d5ebf618fcc5bcf60.zip
Bug 423192 - Fix AutotoolsNewMakeGenerator getWinOSType method
- Fix AutotoolsNewMakeGenerator.getWinOSType method to use the build env variables when invoking the sh command because the path to "sh" may be specified there Change-Id: Ibcde5de924c50b6557fb4264572ddd59b02bb99a Reviewed-on: https://git.eclipse.org/r/19400 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> IP-Clean: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
Diffstat (limited to 'build/org.eclipse.cdt.autotools.core/src')
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
index 10e703376f..2d3c410651 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
@@ -996,10 +996,24 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
try {
CommandLauncher launcher = new CommandLauncher();
ByteArrayOutputStream out = new ByteArrayOutputStream();
+ // Fix Bug 423192 - use environment variables when checking the Win OS Type using
+ // a shell command as the path to sh may be specified there
+ IEnvironmentVariable variables[] =
+ CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true);
+ String[] env = new String[0];
+ ArrayList<String> envList = new ArrayList<String>();
+ if (variables != null) {
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName()
+ + "=" + variables[i].getValue()); //$NON-NLS-1$
+ }
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+
launcher.execute(
new Path(SHELL_COMMAND), //$NON-NLS-1$
new String[] { "-c", "echo $OSTYPE" }, //$NON-NLS-1$ //$NON-NLS-2$
- new String[0],
+ env,
new Path("."), //$NON-NLS-1$
new NullProgressMonitor());
if (launcher.waitAndRead(out, out) == CommandLauncher.OK)

Back to the top