Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-01-05 15:11:03 -0500
committerJeff Johnston2018-01-10 19:47:29 -0500
commit1ae56d435a608f068c66a203fcfbe9965dcd2a99 (patch)
treed2015c4f6de72c2e3adc0a64ff4f666d864eb2af /build/org.eclipse.cdt.autotools.core
parent7627e275ef3604b179fe8c92ca8c4ad461824a67 (diff)
downloadorg.eclipse.cdt-1ae56d435a608f068c66a203fcfbe9965dcd2a99.tar.gz
org.eclipse.cdt-1ae56d435a608f068c66a203fcfbe9965dcd2a99.tar.xz
org.eclipse.cdt-1ae56d435a608f068c66a203fcfbe9965dcd2a99.zip
Bug 528169 - Run autotools commands within containers
- add new optional build property to run all Autotool commands in Container - for Autotool nature projects only, add a checkbox to the ContainerPropertyTab to turn this new option on/off - change the AbstractAutotoolsHandler class to look at the optional build properties for the project to determine if the fallback CommandLauncher used to run commands should come from the CommandLauncherManager to run in Container or to a local CommandLauncher - change AutotoolsNewMakeGenerator the same way - add new messages as needed (add a tooltip to warn user that choosing new option may cause inconsistencies for files shared among configurations) Change-Id: Id828ec3015f32f320d2247bd0577944164c71df8
Diffstat (limited to 'build/org.eclipse.cdt.autotools.core')
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java25
1 files changed, 19 insertions, 6 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 0959319658..1f2687866a 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
@@ -51,6 +51,7 @@ import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.makefile.IMakefile;
import org.eclipse.cdt.make.core.makefile.ITarget;
import org.eclipse.cdt.make.core.makefile.ITargetRule;
+import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
import org.eclipse.cdt.managedbuilder.core.IBuilder;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@@ -114,6 +115,9 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private static final String TARGET = "buildTarget"; //$NON-NLS-1$
private static final String DEFAULT_AUTORECONF = "autoreconf"; //$NON-NLS-1$
+ public static final String RUN_IN_CONFIGURE_LAUNCHER = "org.eclipse.cdt.autotools.core.property.launchAutotoolsInContainer"; //$NON-NLS-1$
+
+
private IProject project;
private IProgressMonitor monitor;
@@ -341,6 +345,15 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
initializeBuildConfigDirs(icfg, toolsCfg);
ICommandLauncher configureLauncher = CommandLauncherManager.getInstance().getCommandLauncher(project);
+ IOptionalBuildProperties props = icfg.getOptionalBuildProperties();
+ boolean runInCfgLauncher = false;
+ if (props != null) {
+ String runInCfgLauncherProperty = props.getProperty(RUN_IN_CONFIGURE_LAUNCHER);
+ if (runInCfgLauncherProperty != null) {
+ runInCfgLauncher = Boolean.parseBoolean(runInCfgLauncherProperty);
+ }
+ }
+
// Create the top-level directory for the build output
if (!createDirectory(buildDir)) {
@@ -397,7 +410,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length);
}
makeargs[makeargs.length - 1] = target;
- rc = runCommand(localCommandLauncher, makeCmd,
+ rc = runCommand(runInCfgLauncher ? configureLauncher : localCommandLauncher, makeCmd,
getProjectLocation(),
makeargs,
AutotoolsPlugin.getResourceString("MakeGenerator.clean.topdir"), //$NON-NLS-1$
@@ -447,7 +460,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length);
}
makeargs[makeargs.length - 1] = target;
- rc = runCommand(localCommandLauncher, makeCmd,
+ rc = runCommand(runInCfgLauncher ? configureLauncher : localCommandLauncher, makeCmd,
buildLocation,
makeargs,
AutotoolsPlugin.getFormattedString("MakeGenerator.clean.builddir", new String[]{buildDir}), //$NON-NLS-1$
@@ -509,7 +522,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
configStatus.delete();
// Get any user-specified arguments for autogen.
String[] autogenArgs = getAutogenArgs(autogenCmdParms);
- rc = runScript(localCommandLauncher, autogenPath,
+ rc = runScript(runInCfgLauncher ? configureLauncher : localCommandLauncher, autogenPath,
autogenPath.removeLastSegments(1), autogenArgs,
AutotoolsPlugin.getFormattedString("MakeGenerator.autogen.sh", new String[]{buildDir}), //$NON-NLS-1$
errMsg, console, autogenEnvs, consoleStart);
@@ -532,7 +545,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
reconfCmd = DEFAULT_AUTORECONF;
IPath reconfCmdPath = new Path(reconfCmd);
reconfArgs[0] = "-i"; //$NON-NLS-1$
- rc = runScript(localCommandLauncher, reconfCmdPath,
+ rc = runScript(runInCfgLauncher ? configureLauncher : localCommandLauncher, reconfCmdPath,
getSourcePath(),
reconfArgs,
AutotoolsPlugin.getFormattedString("MakeGenerator.autoreconf", new String[]{buildDir}), //$NON-NLS-1$
@@ -565,7 +578,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
String[] makeargs = new String[1];
IPath makeCmd = builder.getBuildCommand();
makeargs[0] = "-f" + getMakefileCVSPath().toOSString(); //$NON-NLS-1$
- rc = runCommand(localCommandLauncher, makeCmd,
+ rc = runCommand(runInCfgLauncher ? configureLauncher : localCommandLauncher, makeCmd,
getProjectLocation().append(buildDir),
makeargs,
AutotoolsPlugin.getFormattedString("MakeGenerator.makefile.cvs", new String[]{buildDir}), //$NON-NLS-1$
@@ -597,7 +610,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
reconfCmd = DEFAULT_AUTORECONF;
IPath reconfCmdPath = new Path(reconfCmd);
reconfArgs[0] = "-i"; //$NON-NLS-1$
- rc = runScript(localCommandLauncher, reconfCmdPath,
+ rc = runScript(runInCfgLauncher ? configureLauncher : localCommandLauncher, reconfCmdPath,
getSourcePath(),
reconfArgs,
AutotoolsPlugin.getFormattedString("MakeGenerator.autoreconf", new String[]{buildDir}), //$NON-NLS-1$

Back to the top