Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'build/org.eclipse.cdt.autotools.core')
-rw-r--r--build/org.eclipse.cdt.autotools.core/plugin.properties2
-rw-r--r--build/org.eclipse.cdt.autotools.core/plugin.xml83
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java62
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java14
4 files changed, 150 insertions, 11 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/plugin.properties b/build/org.eclipse.cdt.autotools.core/plugin.properties
index 19c5089a1a5..152345d54af 100644
--- a/build/org.eclipse.cdt.autotools.core/plugin.properties
+++ b/build/org.eclipse.cdt.autotools.core/plugin.properties
@@ -22,6 +22,7 @@ Autotools.wizard.name=GNU Autotools Build Wizard
Autoconf.editor.name=Autoconf Editor
BuildProperty.value.name.default=Default;
+BuildProperty.value.name.debug=Debug
BuildProperty.type.name.autotools=GNU Autotools
PreferenceAutotools.name=Autotools
@@ -45,6 +46,7 @@ Autotools.projecttype.name=GNU Autotools
AutotoolsNature.name=Autotools Project Nature
AutotoolsNewNature.name=Autotools Project Nature V2
Configuration.build.name=Build (GNU)
+Configuration.debug.name=Debug (GNU)
Autotools.targetplatform.name=GNU Autotools Target Platform
Autotools.gnu.toolchain.name=GNU Autotools Toolchain
Configure.outputType=Configure Output (config.status)
diff --git a/build/org.eclipse.cdt.autotools.core/plugin.xml b/build/org.eclipse.cdt.autotools.core/plugin.xml
index 261d653ee3c..27493675eeb 100644
--- a/build/org.eclipse.cdt.autotools.core/plugin.xml
+++ b/build/org.eclipse.cdt.autotools.core/plugin.xml
@@ -11,6 +11,10 @@
id="org.eclipse.linuxtools.cdt.autotools.core.buildType.default"
name="%BuildProperty.value.name.default"/>
<propertyValue
+ property="org.eclipse.cdt.build.core.buildType"
+ id="org.eclipse.linuxtools.cdt.autotools.core.buildType.debug"
+ name="%BuildProperty.value.name.debug"/>
+ <propertyValue
property="org.eclipse.cdt.build.core.buildArtefactType"
id="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools"
name="%BuildProperty.type.name.autotools"/>
@@ -332,7 +336,17 @@
name="%Option.configure.user"
resourceFilter="all"
tip="%Option.configure.user.tip"
- valueType="string"/>
+ valueType="string">
+ <enablement
+ type="CONTAINER_ATTRIBUTE"
+ attribute="defaultValue"
+ value="CFLAGS=-g -O0"
+ extensionAdjustment="false">
+ <checkBuildProperty
+ property="org.eclipse.cdt.build.core.buildType"
+ value="org.eclipse.linuxtools.cdt.autotools.core.buildType.debug"/>
+ </enablement>
+ </option>
<outputType
id="org.eclipse.linuxtools.cdt.autotools.core.outputType.configure"
name="%Configure.outputType"
@@ -388,7 +402,7 @@
id="org.eclipse.linuxtools.cdt.autotools.core.projectType"
isAbstract="false">
<configuration
- buildProperties="org.eclipse.linuxtools.cdt.autotools.core.buildType.default"
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.linuxtools.cdt.autotools.core.buildType.default"
cleanCommand="rm -rf"
errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser"
id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build"
@@ -432,6 +446,65 @@
<builder
id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder"
isAbstract="false"
+ isVariableCaseSensitive="false"
+ name="%Makefile.builder.name">
+ </builder>
+ <supportedProperties>
+ <property
+ id="org.eclipse.cdt.build.core.buildArtefactType">
+ <value
+ id="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools">
+ </value>
+ </property>
+ </supportedProperties>
+ </toolChain>
+ </configuration>
+ <configuration
+ buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.linuxtools.cdt.autotools.core.buildType.debug"
+ cleanCommand="rm -rf"
+ errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser"
+ id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build.debug"
+ languageSettingsProviders="org.eclipse.cdt.ui.UserLanguageSettingsProvider;org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;${Toolchain}"
+ name="%Configuration.debug.name">
+ <toolChain
+ archList="all"
+ configurationEnvironmentSupplier="org.eclipse.cdt.internal.autotools.core.AutotoolsEnvironmentVariableSupplier"
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.debug"
+ languageSettingsProviders="org.eclipse.cdt.autotools.core.LibtoolGCCBuildCommandParser;org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector"
+ name="%Autotools.gnu.toolchain.name"
+ supportsManagedBuild="false"
+ targetTool="org.eclipse.linuxtools.cdt.autotools.core.tool.configure">
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.debug"
+ isAbstract="false"
+ natureFilter="both"
+ superClass="org.eclipse.linuxtools.cdt.autotools.core.tool.configure"/>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.debug"
+ isAbstract="false"
+ natureFilter="both"
+ superClass="org.eclipse.linuxtools.cdt.autotools.core.tool.autogen">
+ </tool>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.debug"
+ isAbstract="false"
+ superClass="cdt.managedbuild.tool.gnu.c.compiler">
+ </tool>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.debug"
+ isAbstract="false"
+ superClass="cdt.managedbuild.tool.gnu.cpp.compiler">
+ </tool>
+ <targetPlatform
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform.debug"
+ isAbstract="false"
+ name="%Autotools.targetplatform.name"
+ superClass="org.eclipse.linuxtools.cdt.autotools.core.targetPlatform">
+ </targetPlatform>
+ <builder
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder.debug"
+ superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder"
+ isAbstract="false"
isVariableCaseSensitive="false">
</builder>
<supportedProperties>
@@ -441,6 +514,12 @@
id="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools">
</value>
</property>
+ <property
+ id="org.eclipse.cdt.build.core.buildType">
+ <value
+ id="org.eclipse.linuxtools.cdt.autotools.core.buildType.debug">
+ </value>
+ </property>
</supportedProperties>
</toolChain>
</configuration>
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
index 9e26fb89a80..a9a71b43681 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
@@ -18,6 +18,14 @@ import java.util.List;
import java.util.Map;
import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants;
+import org.eclipse.cdt.core.CCProjectNature;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.managedbuilder.core.IBuildObjectProperties;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
public class AutotoolsConfiguration implements IAConfiguration {
@@ -25,6 +33,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
public static class Option {
private String name;
private String transformedName;
+ private String superClassId;
private int type;
private String defaultValue;
@@ -45,6 +54,14 @@ public class AutotoolsConfiguration implements IAConfiguration {
this.defaultValue = defaultValue;
}
+ public Option(String name, String transformedName, String defaultValue, String superClassId, int type) {
+ this.name = name;
+ this.transformedName = transformedName;
+ this.type = type;
+ this.defaultValue = defaultValue;
+ this.superClassId = superClassId;
+ }
+
public String getName() {
return name;
}
@@ -57,6 +74,10 @@ public class AutotoolsConfiguration implements IAConfiguration {
return defaultValue;
}
+ public String getSuperClassId() {
+ return superClassId;
+ }
+
public String getDescription() {
return ConfigureMessages.getConfigureDescription(transformedName);
}
@@ -121,15 +142,21 @@ public class AutotoolsConfiguration implements IAConfiguration {
private String id;
private boolean isDirty;
private boolean isParmsDirty;
+ private IProject project;
private Map<String, IConfigureOption> configOptions;
private ArrayList<String> configParms = new ArrayList<>();
public AutotoolsConfiguration(String name) {
- this(name, true);
+ this(null, name, true);
+ }
+
+ public AutotoolsConfiguration(IProject project, String name) {
+ this(project, name, true);
}
- private AutotoolsConfiguration(String name, boolean initialize) {
+ private AutotoolsConfiguration(IProject project, String name, boolean initialize) {
this.id = name;
+ this.project = project;
configOptions = new HashMap<>();
if (initialize)
initConfigOptions();
@@ -140,6 +167,16 @@ public class AutotoolsConfiguration implements IAConfiguration {
// Put configure options in hash map. Ignore categories.
ArrayList<Option> tools = new ArrayList<>();
FlagConfigureOption lastFlag = null;
+ IConfiguration configuration = null;
+ IBuildObjectProperties buildProperties = null;
+ if (project != null) {
+ ICConfigurationDescription cfgd = CoreModel.getDefault().getProjectDescription(project)
+ .getConfigurationById(id);
+
+ configuration = ManagedBuildManager.getConfigurationForDescription(cfgd);
+ if (configuration != null)
+ buildProperties = configuration.getBuildProperties();
+ }
for (int i = 0; i < configOpts.length; ++i) {
Option opt = configOpts[i];
String defaultValue = opt.getDefaultValue();
@@ -165,6 +202,23 @@ public class AutotoolsConfiguration implements IAConfiguration {
break;
case IConfigureOption.MULTIARG:
MultiArgConfigureOption m = new MultiArgConfigureOption(opt.name, opt.transformedName, this);
+ if (buildProperties != null) {
+ // Check to see if we have a Debug configuration in which
+ // case, default the compiler flags
+ // appropriately (for C or C/C++).
+ if (opt.name.equals("user")) { //$NON-NLS-1$
+ if (buildProperties.containsValue("org.eclipse.cdt.build.core.buildType", //$NON-NLS-1$
+ "org.eclipse.linuxtools.cdt.autotools.core.buildType.debug")) { //$NON-NLS-1$
+ defaultValue = "CFLAGS='-g -O0'"; //$NON-NLS-1$
+ try {
+ if (project.hasNature(CCProjectNature.CC_NATURE_ID))
+ defaultValue += " CXXFLAGS='-g -O0'"; //$NON-NLS-1$
+ } catch (CoreException e) {
+ // do nothing
+ }
+ }
+ }
+ }
if (defaultValue != null)
m.setValue(defaultValue);
configOptions.put(opt.name, m);
@@ -251,12 +305,12 @@ public class AutotoolsConfiguration implements IAConfiguration {
@Override
public IAConfiguration copy() {
- return copy(id);
+ return copy(this.id);
}
@Override
public IAConfiguration copy(String newId) {
- AutotoolsConfiguration cfg = new AutotoolsConfiguration(newId, false);
+ AutotoolsConfiguration cfg = new AutotoolsConfiguration(project, newId, false);
Collection<IConfigureOption> oldValues = configOptions.values();
for (Iterator<IConfigureOption> i = oldValues.iterator(); i.hasNext();) {
IConfigureOption opt = i.next();
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
index fc1428746b5..c63fce0a565 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
@@ -100,6 +100,10 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
return new AutotoolsConfiguration(id);
}
+ public synchronized IAConfiguration createDefaultConfiguration(IProject project, String id) {
+ return new AutotoolsConfiguration(project, id);
+ }
+
public synchronized IAConfiguration findCfg(IProject p, String id) {
Map<String, IAConfiguration> cfgs = getConfigurations(p);
return cfgs.get(id);
@@ -112,7 +116,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
public synchronized IAConfiguration getConfiguration(IProject p, String cfgId, boolean persist) {
IAConfiguration cfg = findCfg(p, cfgId);
if (cfg == null) {
- cfg = createDefaultConfiguration(cfgId);
+ cfg = createDefaultConfiguration(p, cfgId);
if (persist) {
addConfiguration(p, cfg);
}
@@ -223,7 +227,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
else
continue; // have to punt, this doesn't map to real cfg
}
- IAConfiguration cfg = new AutotoolsConfiguration(cfgId);
+ IAConfiguration cfg = new AutotoolsConfiguration(project, cfgId);
NodeList l = n.getChildNodes();
for (int y = 0; y < l.getLength(); ++y) {
Node child = l.item(y);
@@ -304,7 +308,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
if (savedList != null)
oldCfg = savedList.get(oldId);
if (oldCfg != null) {
- IAConfiguration newCfg = oldCfg.copy(cfgd.getId());
+ IAConfiguration newCfg = oldCfg.copy(newId);
tmpList.put(cfgd.getId(), newCfg);
// Check to see if the new configuration is already stored as part of the project description.
// If yes, it should already be saved. This can occur if the configuration was added as part of
@@ -394,7 +398,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
String id = cfgd.getId();
IAConfiguration cfg = cfgs.get(id);
if (cfg == null) {
- cfg = createDefaultConfiguration(id);
+ cfg = createDefaultConfiguration(project, id);
}
p.println("<configuration id=\"" + cfg.getId() + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
for (int j = 0; j < optionList.length; ++j) {
@@ -626,7 +630,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
// Get set of configuration options and convert to set of IAutotoolOptions
Map<String, IConfigureOption> cfgOptions = cfg.getOptions();
- IAConfiguration dummyCfg = createDefaultConfiguration(createDummyId());
+ IAConfiguration dummyCfg = createDefaultConfiguration(project, createDummyId());
for (Iterator<Entry<String, IConfigureOption>> i = cfgOptions.entrySet().iterator(); i.hasNext();) {
Map.Entry<String, IConfigureOption> entry = i.next();
String name = entry.getKey();

Back to the top