1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

Update Autotools core with missing fixes made after initial move.

- Bug 371277 [autotools] - use sh -c to run scripts
- Bug 372557 [autotools] - out of range exception on unknown env var
This commit is contained in:
Jeff Johnston 2012-03-30 17:59:58 -04:00
parent b2a7ca7238
commit 6272193b34
2 changed files with 39 additions and 15 deletions

View file

@ -1,3 +1,17 @@
2012-03-30 Jeff Johnston <jjohnstn@redhat.com>
Bug #371277
* src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
(regenerateMakefiles): Fix setting of status on error.
(runScript): Switch to use sh -c for all script execution.
2012-03-30 Jeff Johnston <jjohnstn@redhat.com>
Bug #372557
* src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
(runScript): Fix index out of range exception when environment variable is
unknown.
2012-03-29 Jeff Johnston <jjohnstn@redhat.com> 2012-03-29 Jeff Johnston <jjohnstn@redhat.com>
* src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java: Fix old nature id to contain the .core specifier. * src/org/eclipse/cdt/autotools/core/AutotoolsNewProjectNature.java: Fix old nature id to contain the .core specifier.

View file

@ -301,7 +301,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
} }
private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException { private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException {
Status status; MultiStatus status;
int rc = IStatus.OK; int rc = IStatus.OK;
String errMsg = new String(); String errMsg = new String();
boolean needFullConfigure = false; boolean needFullConfigure = false;
@ -614,7 +614,14 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
} finally { } finally {
// getGenerationProblems().clear(); // getGenerationProblems().clear();
status = new MultiStatus(AutotoolsPlugin status = new MultiStatus(AutotoolsPlugin
.getUniqueIdentifier(), rc, errMsg, null); .getUniqueIdentifier(), rc, errMsg, null);
if (rc != IStatus.OK)
status.add(new Status (
rc,
AutotoolsPlugin.getUniqueIdentifier(),
0,
errMsg,
null));
} }
return status; return status;
} }
@ -1032,21 +1039,24 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
} }
configTargets[0] = getPathString(commandPath); configTargets[0] = getPathString(commandPath);
// Fix for bug #343731 // Fix for bug #343879
if (Platform.getOS().equals(Platform.OS_WIN32) if (Platform.getOS().equals(Platform.OS_WIN32)
|| Platform.getOS().equals(Platform.OS_MACOSX)) { || Platform.getOS().equals(Platform.OS_MACOSX))
removePWD = true; removePWD = true;
// Neither Mac or Windows support calling scripts directly.
String command = null; // Fix for bug #343731 and bug #371277
for (String arg : configTargets) { // Always use sh -c for executing autotool scripts which should
// TODO check for spaces in args // work on all Linux POSIX compliant shells including bash, dash, as
if (command == null) // well as Windows and Mac OSX.
command = arg; String command = null;
else for (String arg : configTargets) {
command += " " + arg; // TODO check for spaces in args
} if (command == null)
configTargets = new String[] { "-c", command }; command = arg;
else
command += " " + arg;
} }
configTargets = new String[] { "-c", command };
for (int i = 0; i < configTargets.length; ++i) { for (int i = 0; i < configTargets.length; ++i) {
// try to resolve the build macros in any argument // try to resolve the build macros in any argument
@ -1060,7 +1070,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
cfg); cfg);
// strip any env-var settings from options // strip any env-var settings from options
// fix for bug #356278 // fix for bug #356278
if (resolved.charAt(0) != '-') if (resolved.length() > 0 && resolved.charAt(0) != '-')
resolved = stripEnvVarsFromOption(resolved, additionalEnvs); resolved = stripEnvVarsFromOption(resolved, additionalEnvs);
configTargets[i] = resolved; configTargets[i] = resolved;
} catch (BuildMacroException e) { } catch (BuildMacroException e) {