Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2014-06-24 19:00:50 -0400
committerJeff Johnston2014-06-25 15:09:54 -0400
commit6592f4dc24428e0404c560505845f1b2066817b9 (patch)
tree54e71c10368932c20de0596c333c3fa53ef29376 /build/org.eclipse.cdt.autotools.core/src
parente6b392ffbc5f86d992cb5ffca98f8a294905303b (diff)
downloadorg.eclipse.cdt-6592f4dc24428e0404c560505845f1b2066817b9.tar.gz
org.eclipse.cdt-6592f4dc24428e0404c560505845f1b2066817b9.tar.xz
org.eclipse.cdt-6592f4dc24428e0404c560505845f1b2066817b9.zip
Bug 438092 - Advanced Autotools flags not set for C++ projects
- Replace previous fix with better one - Continue to use the name CFLAGS for the compiler flags but add a default value of CFLAGS|CXXFLAGS so that multiple flags will be issued on configure - enhance the FlagConfigureOption to handle multiple flags at once by using the value and splitting on the | delimiter to generate separate multiple flags if needed - Change title of Autotools compiler flag options to be Compiler Flags instead of CFLAGS (previous) and CFLAGS|CXXFLAGS (new) - Add transformed name for CFLAGS|CXXFLAGS - Add tests to verify multiple flags are used Change-Id: Ic7f8028f07469d04c9de3105f818a5e37e06246a Reviewed-on: https://git.eclipse.org/r/28943 Tested-by: Hudson CI Reviewed-by: 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/autotools/core/AutotoolsOptionConstants.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java6
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.properties2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java8
5 files changed, 12 insertions, 8 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsOptionConstants.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsOptionConstants.java
index 46c102d853..1130ec122e 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsOptionConstants.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsOptionConstants.java
@@ -43,7 +43,7 @@ public class AutotoolsOptionConstants {
/**
* @since 1.4
*/
- public final static String FLAG_CFLAGS_CXXFLAGS = "CFLAGS|CXXFLAGS"; // $NON-NLS-1$
+ public final static String FLAG_CFLAGS_FLAGS = "CFLAGS|CXXFLAGS"; // $NON-NLS-1$
public final static String OPT_CFLAGS_DEBUG = "cflags-debug"; // $NON-NLS-1$
public final static String OPT_CFLAGS_GPROF = "cflags-gprof"; // $NON-NLS-1$
public final static String OPT_CFLAGS_GCOV = "cflags-gcov"; // $NON-NLS-1$
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 93727fdd61..f45d82b32c 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
@@ -103,7 +103,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
new Option(AutotoolsOptionConstants.OPT_PROGRAM_TRANSFORM_NAME, "program_transform_name", IConfigureOption.STRING), // $NON-NLS-1$
new Option(AutotoolsOptionConstants.CATEGORY_FEATURES, IConfigureOption.CATEGORY),
new Option(AutotoolsOptionConstants.OPT_ENABLE_MAINTAINER_MODE, "enable_maintainer_mode", IConfigureOption.BIN), // $NON-NLS-1$
- new Option(AutotoolsOptionConstants.FLAG_CFLAGS_CXXFLAGS, IConfigureOption.FLAG),
+ new Option(AutotoolsOptionConstants.FLAG_CFLAGS, "cflags", AutotoolsOptionConstants.FLAG_CFLAGS_FLAGS, IConfigureOption.FLAG), // $NON-NLS-1$
new Option(AutotoolsOptionConstants.OPT_CFLAGS_DEBUG, "cflags_debug", IConfigureOption.FLAGVALUE), // $NON-NLS-1$ // $NON-NLS-2$
new Option(AutotoolsOptionConstants.OPT_CFLAGS_GPROF, "cflags_gprof", IConfigureOption.FLAGVALUE), // $NON-NLS-1$ // $NON-NLS-2$
new Option(AutotoolsOptionConstants.OPT_CFLAGS_GCOV, "cflags_gcov", IConfigureOption.FLAGVALUE), // $NON-NLS-1$ // $NON-NLS-2$
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 1c1e526b78..a95161fbfb 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
@@ -28,6 +28,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.cdt.autotools.core.AutotoolsNewProjectNature;
+import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants;
import org.eclipse.cdt.autotools.core.AutotoolsPlugin;
import org.eclipse.cdt.autotools.core.IAutotoolsOption;
import org.eclipse.cdt.core.model.CoreModel;
@@ -238,7 +239,8 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
// read in flag values
NamedNodeMap optionAttrs = child.getAttributes();
Node id = optionAttrs.getNamedItem("id"); // $NON-NLS-1$
- IConfigureOption opt = cfg.getOption(id.getNodeValue());
+ String idValue = id.getNodeValue();
+ IConfigureOption opt = cfg.getOption(idValue);
if (opt instanceof FlagConfigureOption) {
NodeList l2 = child.getChildNodes();
for (int z = 0; z < l2.getLength(); ++z) {
@@ -407,7 +409,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
Option option = optionList[j];
IConfigureOption opt = cfg.getOption(option.getName());
if (opt.isFlag()) {
- p.println("<flag id=\"" + option.getName() + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
+ p.println("<flag id=\"" + option.getName() + "\" value=\"" + xmlEscape(option.getDefaultValue()) + "\">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
FlagConfigureOption fco = (FlagConfigureOption)opt;
ArrayList<String> children = fco.getChildren();
for (int k = 0; k < children.size(); ++k) {
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.properties b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.properties
index 520658d0af..94ac0875a7 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.properties
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.properties
@@ -89,6 +89,8 @@ Option.configure.cflags_gcov=Gcov support (-fprofile-arcs -ftest-coverage)
Option.configure.cflags_gcov.tip=Specify this to compile your executable so it will generate gcov coverage data when run
Option.configure.cflags_gcov.parm=-fprofile-arcs -ftest-coverage
+Option.configure.cflags=Compiler Flags:
+
Option.configure.autogen=autogen
Option.configure.options=Options
Option.configure.autogenOpts=Additional command-line options
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
index b886ad336e..69be937f23 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
@@ -21,12 +21,12 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
public FlagConfigureOption(String name, AutotoolsConfiguration cfg) {
super(name, cfg);
- this.value = ""; // $NON-NLS-1$
+ this.value = name;
}
public FlagConfigureOption(String name, String msgName, AutotoolsConfiguration cfg) {
super(name, msgName, cfg);
- this.value = ""; // $NON-NLS-1$
+ this.value = name;
}
@SuppressWarnings("unchecked")
@@ -40,7 +40,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
public String getParameter() {
StringBuffer parms = new StringBuffer();
// Multiple flags are designated by putting multiple flags together using "|" as delimiter
- String[] flagNames = getName().split("\\|"); //$NON-NLS-1$
+ String[] flagNames = getValue().split("\\|"); //$NON-NLS-1$
String flagSeparator = "";
for (String flagName : flagNames) {
parms.append(flagSeparator);
@@ -84,7 +84,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
}
public void setValue(String value) {
- // can't occur
+ this.value = value;
}
public IConfigureOption copy(AutotoolsConfiguration config) {

Back to the top