diff --git a/build/org.eclipse.cdt.autotools.core/ChangeLog b/build/org.eclipse.cdt.autotools.core/ChangeLog index 2007aa9556f..70f4ce00a68 100644 --- a/build/org.eclipse.cdt.autotools.core/ChangeLog +++ b/build/org.eclipse.cdt.autotools.core/ChangeLog @@ -1,3 +1,10 @@ +2012-07-23 Jeff Johnston + + * src/org/eclipse/cdt/autotools/core/AutotoolsOptionConstants.java: New file. + * src/org/eclipse/cdt/internal/autotools/core/configure/IConfigureOption.java: Use IAutotoolsOption values for type constants. + * src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java: Use AutotoolsOptionConstants + for names of configuration options. + 2012-07-20 Jeff Johnston * src/org/eclipse/cdt/autotools/core/AutotoolsPlugin.java (getAutotoolCfgOptions): New publicly accessible 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 new file mode 100644 index 00000000000..43658956a40 --- /dev/null +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/autotools/core/AutotoolsOptionConstants.java @@ -0,0 +1,51 @@ +package org.eclipse.cdt.autotools.core; + +/** + * @since 1.2 + */ +public class AutotoolsOptionConstants { + // IAutotoolOption Names + public final static String TOOL_CONFIGURE = "configure"; // $NON-NLS-1$ + public final static String CATEGORY_GENERAL = "general"; // $NON-NLS-1$ + public final static String OPT_CONFIGDIR = "configdir"; // $NON-NLS-1$ + public final static String OPT_CACHE_FILE = "cache-file"; // $NON-NLS-1$ + public final static String OPT_HELP = "help"; // $NON-NLS-1$ + public final static String OPT_NO_CREATE = "no-create"; // $NON-NLS-1$ + public final static String OPT_QUIET = "quiet"; // $NON-NLS-1$ + public final static String OPT_VERSION = "version"; // $NON-NLS-1$ + public final static String CATEGORY_PLATFORM = "platform"; // $NON-NLS-1$ + public final static String OPT_HOST = "host"; // $NON-NLS-1$ + public final static String OPT_BUILD = "build"; // $NON-NLS-1$ + public final static String OPT_TARGET = "target"; // $NON-NLS-1$ + public final static String CATEGORY_DIRECTORIES = "directories"; // $NON-NLS-1$ + public final static String OPT_PREFIX = "prefix"; // $NON-NLS-1$ + public final static String OPT_EXEC_PREFIX = "exec-prefix"; // $NON-NLS-1$ + public final static String OPT_LIBDIR = "libdir"; // $NON-NLS-1$ + public final static String OPT_BINDIR = "bindir"; // $NON-NLS-1$ + public final static String OPT_SBINDIR = "sbindir"; // $NON-NLS-1$ + public final static String OPT_INCLUDEDIR = "includedir"; // $NON-NLS-1$ + public final static String OPT_DATADIR = "datadir"; // $NON-NLS-1$ + public final static String OPT_SYSCONFDIR = "sysconfdir"; // $NON-NLS-1$ + public final static String OPT_INFODIR = "infodir"; // $NON-NLS-1$ + public final static String OPT_MANDIR = "mandir"; // $NON-NLS-1$ + public final static String OPT_SRCDIR = "srcdir"; // $NON-NLS-1$ + public final static String OPT_LOCALSTATEDIR = "localstatedir"; // $NON-NLS-1$ + public final static String OPT_SHAREDSTATEDIR = "sharedstatedir"; // $NON-NLS-1$ + public final static String OPT_LIBEXECDIR = "libexecdir"; // $NON-NLS-1$ + public final static String OPT_OLDINCLUDEDIR = "oldincludedir"; // $NON-NLS-1$ + public final static String CATEGORY_FILENAMES = "filenames"; // $NON-NLS-1$ + public final static String OPT_PROGRAM_PREFIX = "program-prefix"; // $NON-NLS-1$ + public final static String OPT_PROGRAM_SUFFIX = "program-suffix"; // $NON-NLS-1$ + public final static String OPT_PROGRAM_TRANSFORM_NAME = "program-transform-name"; // $NON-NLS-1$ + public final static String CATEGORY_FEATURES = "features"; // $NON-NLS-1$ + public final static String OPT_ENABLE_MAINTAINER_MODE = "enable-maintainer-mode"; // $NON-NLS-1$ + public final static String FLAG_CFLAGS = "CFLAGS"; // $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$ + public final static String OPT_USER = "user"; // $NON-NLS-1$ + public final static String TOOL_AUTOGEN = "autogen"; // $NON-NLS-1$ + public final static String CATEGORY_OPTIONS = "options"; // $NON-NLS-1$ + public final static String OPT_AUTOGENOPTS = "autogenOpts"; // $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 03b728d8993..40dfb2f30f7 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 @@ -16,6 +16,8 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants; + public class AutotoolsConfiguration implements IAConfiguration { @@ -67,48 +69,48 @@ public class AutotoolsConfiguration implements IAConfiguration { // All options following a category are children of that category // in a tree view, up to the next category. private static Option[] configOpts = new Option[] { - new Option("configure", IConfigureOption.TOOL), // $NON-NLS-1$ - new Option("general", IConfigureOption.CATEGORY), // $NON-NLS-1$ - new Option("configdir", IConfigureOption.INTERNAL), // $NON-NLS-1$ - new Option("cache-file", "cache_file", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("help", IConfigureOption.BIN), // $NON-NLS-1$ - new Option("no-create", "no_create", IConfigureOption.BIN), // $NON-NLS-1$ - new Option("quiet", IConfigureOption.BIN), // $NON-NLS-1$ - new Option("version", IConfigureOption.BIN), // $NON-NLS-1$ - new Option("platform", IConfigureOption.CATEGORY), // $NON-NLS-1$ - new Option("host", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("build", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("target", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("directories", IConfigureOption.CATEGORY), // $NON-NLS-1$ - new Option("prefix", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("exec-prefix", "exec_prefix", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("libdir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("bindir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("sbindir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("includedir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("datadir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("sysconfdir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("infodir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("mandir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("srcdir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("localstatedir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("sharedstatedir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("libexecdir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("oldincludedir", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("filenames", IConfigureOption.CATEGORY), // $NON-NLS-1$ - new Option("program-prefix", "program_prefix", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("program-suffix", "program_suffix", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("program-transform-name", "program_transform_name", IConfigureOption.STRING), // $NON-NLS-1$ - new Option("features", IConfigureOption.CATEGORY), // $NON-NLS-1$ - new Option("enable-maintainer-mode", "enable_maintainer_mode", IConfigureOption.BIN), // $NON-NLS-1$ - new Option("CFLAGS", IConfigureOption.FLAG), // $NON-NLS-1$ - new Option("cflags-debug", "cflags_debug", IConfigureOption.FLAGVALUE), // $NON-NLS-1$ // $NON-NLS-2$ - new Option("cflags-gprof", "cflags_gprof", IConfigureOption.FLAGVALUE), // $NON-NLS-1$ // $NON-NLS-2$ - new Option("cflags-gcov", "cflags_gcov", IConfigureOption.FLAGVALUE), // $NON-NLS-1$ // $NON-NLS-2$ - new Option("user", IConfigureOption.MULTIARG), // $NON-NLS-1$ - new Option("autogen", "autogen", "autogen.sh", IConfigureOption.TOOL), // $NON-NLS-1$ - new Option("options", IConfigureOption.CATEGORY), // $NON-NLS-1$ - new Option("autogenOpts", IConfigureOption.MULTIARG), // $NON-NLS-1$ + new Option(AutotoolsOptionConstants.TOOL_CONFIGURE, IConfigureOption.TOOL), + new Option(AutotoolsOptionConstants.CATEGORY_GENERAL, IConfigureOption.CATEGORY), + new Option(AutotoolsOptionConstants.OPT_CONFIGDIR, IConfigureOption.INTERNAL), + new Option(AutotoolsOptionConstants.OPT_CACHE_FILE, "cache_file", IConfigureOption.STRING), // $NON-NLS-1$ + new Option(AutotoolsOptionConstants.OPT_HELP, IConfigureOption.BIN), + new Option(AutotoolsOptionConstants.OPT_NO_CREATE, "no_create", IConfigureOption.BIN), // $NON-NLS-1$ + new Option(AutotoolsOptionConstants.OPT_QUIET, IConfigureOption.BIN), + new Option(AutotoolsOptionConstants.OPT_VERSION, IConfigureOption.BIN), + new Option(AutotoolsOptionConstants.CATEGORY_PLATFORM, IConfigureOption.CATEGORY), + new Option(AutotoolsOptionConstants.OPT_HOST, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_BUILD, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_TARGET, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.CATEGORY_DIRECTORIES, IConfigureOption.CATEGORY), + new Option(AutotoolsOptionConstants.OPT_PREFIX, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_EXEC_PREFIX, "exec_prefix", IConfigureOption.STRING), // $NON-NLS-1$ + new Option(AutotoolsOptionConstants.OPT_LIBDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_BINDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_SBINDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_INCLUDEDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_DATADIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_SYSCONFDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_INFODIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_MANDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_SRCDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_LOCALSTATEDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_SHAREDSTATEDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_LIBEXECDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.OPT_OLDINCLUDEDIR, IConfigureOption.STRING), + new Option(AutotoolsOptionConstants.CATEGORY_FILENAMES, IConfigureOption.CATEGORY), + new Option(AutotoolsOptionConstants.OPT_PROGRAM_PREFIX, "program_prefix", IConfigureOption.STRING), // $NON-NLS-1$ + new Option(AutotoolsOptionConstants.OPT_PROGRAM_SUFFIX, "program_suffix", IConfigureOption.STRING), // $NON-NLS-1$ + 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, IConfigureOption.FLAG), + 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$ + new Option(AutotoolsOptionConstants.OPT_USER, IConfigureOption.MULTIARG), + new Option(AutotoolsOptionConstants.TOOL_AUTOGEN, "autogen", "autogen.sh", IConfigureOption.TOOL), // $NON-NLS-1$ + new Option(AutotoolsOptionConstants.CATEGORY_OPTIONS, IConfigureOption.CATEGORY), + new Option(AutotoolsOptionConstants.OPT_AUTOGENOPTS, IConfigureOption.MULTIARG), }; private static Option[] toolList; diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/IConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/IConfigureOption.java index 51437fbcd30..07b709094df 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/IConfigureOption.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/IConfigureOption.java @@ -12,16 +12,18 @@ package org.eclipse.cdt.internal.autotools.core.configure; import java.util.ArrayList; +import org.eclipse.cdt.autotools.core.IAutotoolsOption; + public interface IConfigureOption { - public final static int CATEGORY = 0; - public final static int BIN = 1; - public final static int STRING = 2; - public final static int INTERNAL = 3; - public final static int MULTIARG = 4; - public final static int TOOL = 5; - public final static int FLAG = 6; - public final static int FLAGVALUE = 7; + public final static int CATEGORY = IAutotoolsOption.CATEGORY; + public final static int BIN = IAutotoolsOption.BIN; + public final static int STRING = IAutotoolsOption.STRING; + public final static int INTERNAL = IAutotoolsOption.INTERNAL; + public final static int MULTIARG = IAutotoolsOption.MULTIARG; + public final static int TOOL = IAutotoolsOption.TOOL; + public final static int FLAG = IAutotoolsOption.FLAG; + public final static int FLAGVALUE = IAutotoolsOption.FLAGVALUE; public String getName(); public String getParameter(); public ArrayList getParameters();