From 427f046c406e4ef351918f6b5e673b295bc7d352 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mar 19 2010 19:05:54 +0000 Subject: * Fri Mar 19 2010 Jeff Johnston 1:6.0.2-2 - Check in missing maketargets patch. * Thu Mar 18 2010 Jeff Johnston 1:6.0.2-1 - Rebase CDT to Galileo SR2 (6.0.2). - Rebase Autotools to Linux tools R0.5. - Rebase Libhover to Linux tools R0.5. --- diff --git a/.cvsignore b/.cvsignore index 67e6db0..b116f06 100644 --- a/.cvsignore +++ b/.cvsignore @@ -41,3 +41,6 @@ ammacros-1.9.5.xml ammacros-1.9.6.xml eclipse-cdt-fetched-src-autotools-R0_4_0_1.tar.gz eclipse-cdt-fetched-src-libhover-R0_4_0.tar.gz +eclipse-cdt-fetched-src-v201002161416.tar.bz2 +eclipse-cdt-fetched-src-autotools-R0_5_0.tar.gz +eclipse-cdt-fetched-src-libhover-R0_5_0.tar.gz diff --git a/eclipse-cdt-addbuilder.patch b/eclipse-cdt-addbuilder.patch new file mode 100644 index 0000000..6f56f88 --- /dev/null +++ b/eclipse-cdt-addbuilder.patch @@ -0,0 +1,72 @@ +### Eclipse Workspace Patch 1.0 +#P org.eclipse.linuxtools.cdt.autotools.core +Index: src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java +=================================================================== +--- src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java (revision 24339) ++++ src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java (working copy) +@@ -20,9 +20,16 @@ + import org.eclipse.core.resources.IProject; + import org.eclipse.core.resources.IProjectDescription; + import org.eclipse.core.resources.IProjectNature; ++import org.eclipse.core.resources.IWorkspace; ++import org.eclipse.core.resources.IWorkspaceRunnable; ++import org.eclipse.core.resources.ResourcesPlugin; + import org.eclipse.core.runtime.CoreException; + import org.eclipse.core.runtime.IProgressMonitor; ++import org.eclipse.core.runtime.IStatus; + import org.eclipse.core.runtime.NullProgressMonitor; ++import org.eclipse.core.runtime.Status; ++import org.eclipse.core.runtime.jobs.ISchedulingRule; ++import org.eclipse.core.runtime.jobs.Job; + import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsConfigurationBuilder; + + public class AutotoolsNewProjectNature implements IProjectNature { +@@ -94,9 +101,45 @@ + commandList.add(command); + } + } +- ICommand[] newCommands = new ICommand[commandList.size()]; +- description.setBuildSpec(commandList.toArray(newCommands)); +- project.setDescription(description, new NullProgressMonitor()); ++ final ICommand[] newCommands = commandList.toArray(new ICommand[commandList.size()]); ++ if (newCommands.length == commands.length) { ++ boolean hasCorrectBuilderCommands = true; ++ for (int j = 0; j < commands.length; ++j) { ++ if (!commands[j].getBuilderName().equals(newCommands[j])) { ++ hasCorrectBuilderCommands = false; ++ break; ++ } ++ } ++ if (hasCorrectBuilderCommands) ++ return; ++ } ++ final ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot(); ++ final IProject proj = project; ++ ++ Job backgroundJob = new Job("Autotools Set Project Description") { ++ /* (non-Javadoc) ++ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) ++ */ ++ protected IStatus run(IProgressMonitor monitor) { ++ try { ++ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() { ++ ++ public void run(IProgressMonitor monitor) throws CoreException { ++ ++ IProjectDescription description = proj.getDescription(); ++ description.setBuildSpec(newCommands); ++ proj.setDescription(description, new NullProgressMonitor()); ++ } ++ }, rule, IWorkspace.AVOID_UPDATE, monitor); ++ } catch (CoreException e) { ++ return e.getStatus(); ++ } ++ IStatus returnStatus = Status.OK_STATUS; ++ return returnStatus; ++ } ++ }; ++ backgroundJob.setRule(rule); ++ backgroundJob.schedule(); + } + + /** diff --git a/eclipse-cdt-autotools-bug280117.patch b/eclipse-cdt-autotools-bug280117.patch deleted file mode 100644 index f166f35..0000000 --- a/eclipse-cdt-autotools-bug280117.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up ./src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java.fix ./src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java ---- ./src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java.fix 2009-06-15 15:41:38.000000000 -0400 -+++ ./src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java 2009-06-15 15:42:10.000000000 -0400 -@@ -105,8 +105,8 @@ public class AutotoolsScannerInfo implem - String id = options[i].getId(); - if (id.indexOf("builddir") > 0) { // $NON-NLS-1$ - runPath = makefile.getProject().getLocation().append(value.trim()); -+ done = true; - } -- done = true; - } - } catch (BuildException e) { - // do nothing diff --git a/eclipse-cdt-autotools-bug461647.patch b/eclipse-cdt-autotools-bug461647.patch deleted file mode 100644 index cf66a82..0000000 --- a/eclipse-cdt-autotools-bug461647.patch +++ /dev/null @@ -1,25 +0,0 @@ -Index: src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java -=================================================================== -RCS file: /cvs/eclipse/autotools/com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java,v -retrieving revision 1.19 -diff -u -r1.19 AutotoolsMakefileBuilder.java ---- src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java 28 Jan 2008 20:45:12 -0000 1.19 -+++ src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java 9 Sep 2008 19:16:28 -0000 -@@ -50,6 +50,7 @@ - public static final String BUILDER_ID = AutotoolsPlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$ - public static final String MANAGED_BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$ - public static final String AUTOTOOLS_CONFIG_ID = AutotoolsPlugin.getUniqueIdentifier() + ".configuration.build"; //$NON-NLS-1$ -+ public static final String AUTOTOOLS_PROJECT_TYPE_ID = AutotoolsPlugin.getUniqueIdentifier() + ".projectType"; //$NON-NLS-1$ - - private static final String BUILD_FINISHED = "AutotoolsMakefileBuilder.message.finished"; //$NON-NLS-1$ - private static final String TYPE_CLEAN = "AutotoolsMakefileBuilder.type.clean"; //$NON-NLS-1$ -@@ -76,8 +77,7 @@ - // then return true. - if (project.getNature(ManagedCProjectNature.MNG_NATURE_ID) != null) { - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); -- IConfiguration config = info.getDefaultConfiguration(); -- if (config.getParent().getId().equals(AUTOTOOLS_CONFIG_ID)) { -+ if (info.getManagedProject().getProjectType().getId().equals(AUTOTOOLS_PROJECT_TYPE_ID)) { - AutotoolsProjectNature.addAutotoolsBuilder(project, new NullProgressMonitor()); - AutotoolsPlugin.verifyScannerInfoProvider(project); - return true; diff --git a/eclipse-cdt-autotools-plugin.patch b/eclipse-cdt-autotools-plugin.patch deleted file mode 100644 index 6fdf520..0000000 --- a/eclipse-cdt-autotools-plugin.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./plugin.xml.fix ./plugin.xml ---- ./plugin.xml.fix 2008-09-04 16:09:17.000000000 -0400 -+++ ./plugin.xml 2008-09-04 16:09:34.000000000 -0400 -@@ -754,7 +754,7 @@ - name="%AutotoolsNature.name" - point="org.eclipse.core.resources.natures"> - -+ id="org.eclipse.cdt.managedbuilder.core.managedBuildNature"> - - - 0) -+ needFullConfigure = true; -+ } catch (EOFException e) { -+ needFullConfigure = true; -+ } catch (IOException e) { -+ needFullConfigure = true; -+ } -+ } -+ if (!needFullConfigure && configStatus != null && configStatus.exists()) { - ok = runCommand(configfile, project.getLocation().append( - buildDir), null, "Running config.status"); - } -@@ -302,10 +344,13 @@ public class MakeGenerator implements IM - ok = runCommand(project.getLocation().append( - info.getToolForConfiguration("status")), project - .getLocation().append(buildDir), -- getConfigArgs(), "Generating Makefile"); -+ configArgs, "Generating Makefile"); - File makefileFile = project.getLocation().append(buildDir) - .append("Makefile").toFile(); - addMakeTargetsToManager(makefileFile); -+ // TODO: should we do something special if configure doesn't -+ // return ok? -+ saveConfigArgs(configArgs); - } - // If no configure, run autogen.sh - else if (autogenExists()) { -@@ -359,6 +404,21 @@ public class MakeGenerator implements IM - return autogenCommand.toFile().exists(); - } - -+ private void saveConfigArgs(String[] args) { -+ IPath settingsPath = project.getLocation().append(SETTINGS_FILE_NAME); -+ try { -+ File f = new File(settingsPath.toOSString()); -+ DataOutputStream settings = new DataOutputStream( -+ new BufferedOutputStream(new FileOutputStream(f))); -+ for (int i = 0; i < args.length; ++i) { -+ settings.writeUTF(args[i]); -+ } -+ settings.close(); -+ } catch (IOException e) { -+ /* What should we do? */ -+ } -+ } -+ - private String[] getConfigArgs() throws BuildException { - // Get the arguments to be passed to config from build model - ITool tool = info.getToolFromOutputExtension("status"); -@@ -376,15 +436,17 @@ public class MakeGenerator implements IM - value = value.trim(); - boolean finished = false; - int lastIndex = value.indexOf("--"); -- while (!finished) { -- int index = value.indexOf("--",lastIndex+2); -- if (index != -1) { -- String previous = value.substring(lastIndex, index).trim(); -- configArgs.add(previous); -- value = value.substring(index); -- } else { -- configArgs.add(value); -- finished = true; -+ if (lastIndex != -1) { -+ while (!finished) { -+ int index = value.indexOf("--",lastIndex+2); -+ if (index != -1) { -+ String previous = value.substring(lastIndex, index).trim(); -+ configArgs.add(previous); -+ value = value.substring(index); -+ } else { -+ configArgs.add(value); -+ finished = true; -+ } - } - } - } ---- com.redhat.eclipse.cdt.autotools/ChangeLog.fix 2006-08-21 16:58:28.000000000 -0400 -+++ com.redhat.eclipse.cdt.autotools/ChangeLog 2006-08-21 17:00:46.000000000 -0400 -@@ -0,0 +1,31 @@ -+2006-08-21 Jeff Johnston -+ -+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java (run): If -+ there are no targets yet (i.e. no makefile), try and regenerate the makefile. -+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getConfigArgs): -+ Make sure there is an "other" string to process rather than adding -+ an empty argument. -+ -+2006-08-16 Jeff Johnston -+ -+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles): -+ Add logic to check if the configuration arguments have changed since the last -+ configuration and reconfigure if they have. -+ (saveConfigArgs): New method. -+ -+2006-08-03 Jeff Johnston -+ -+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (addAutotoolsBuilder): -+ Check for ManagedMake's genmakebuilder and remove if found. -+ (hasTargetBuilder): Look for Autotools default configuration and if found, -+ add the Autotools Makefile builder. -+ -+2006-07-31 Jeff Johnston -+ -+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java (getLibHoverDocs): New -+ method which replaces buildDocPath and fetches libhover base data file from -+ the plugin's jar. -+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java (buildDocPath): Replaced -+ by getLibHoverDocs. Change all callers. -+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java (getDocument): Removed. -+ diff --git a/eclipse-cdt-definedsymbol-fix.patch b/eclipse-cdt-definedsymbol-fix.patch deleted file mode 100644 index 3796269..0000000 --- a/eclipse-cdt-definedsymbol-fix.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- ./com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java.fix2 2006-09-11 16:22:36.000000000 -0400 -+++ ./com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java 2006-09-11 16:45:51.000000000 -0400 -@@ -278,29 +278,31 @@ public class AutotoolsScannerInfo implem - // Extract -D directives from the compilation string. - // TODO: Handle -U directives as well. - String cs = getCompilationString(); -- Pattern p4 = Pattern.compile(" -D"); -- String[] tokens = p4.split(cs); -- for (int j = 1; j < tokens.length; ++j) { -- String x = tokens[j].trim(); -- int eqSignIndex = x.indexOf('='); -- if (eqSignIndex == -1) { -- int firstSpace = x.indexOf(' ', eqSignIndex); -- if (firstSpace != -1) -- symbolMap.put(x.substring(0, firstSpace), ""); -- else -- symbolMap.put(x, ""); -- } -- else { -- int endIndex = -1; -- if (x.charAt(eqSignIndex + 1) == '\\' && x.charAt(eqSignIndex + 2) == '\"') { -- endIndex = x.indexOf('\"', eqSignIndex + 3) + 1; -- } else { -- endIndex = x.indexOf(' '); -+ if (cs != null) { -+ Pattern p4 = Pattern.compile(" -D"); -+ String[] tokens = p4.split(cs); -+ for (int j = 1; j < tokens.length; ++j) { -+ String x = tokens[j].trim(); -+ int eqSignIndex = x.indexOf('='); -+ if (eqSignIndex == -1) { -+ int firstSpace = x.indexOf(' ', eqSignIndex); -+ if (firstSpace != -1) -+ symbolMap.put(x.substring(0, firstSpace), ""); -+ else -+ symbolMap.put(x, ""); -+ } -+ else { -+ int endIndex = -1; -+ if (x.charAt(eqSignIndex + 1) == '\\' && x.charAt(eqSignIndex + 2) == '\"') { -+ endIndex = x.indexOf('\"', eqSignIndex + 3) + 1; -+ } else { -+ endIndex = x.indexOf(' '); -+ } -+ if (endIndex <= 0) -+ symbolMap.put(x.substring(0,eqSignIndex), x.substring(eqSignIndex+1)); -+ else -+ symbolMap.put(x.substring(0, eqSignIndex), x.substring(eqSignIndex+1, endIndex)); - } -- if (endIndex <= 0) -- symbolMap.put(x.substring(0,eqSignIndex), x.substring(eqSignIndex+1)); -- else -- symbolMap.put(x.substring(0, eqSignIndex), x.substring(eqSignIndex+1, endIndex)); - } - } - // Add the defined symbols from ManagedBuildManager. This will include -@@ -322,7 +324,7 @@ public class AutotoolsScannerInfo implem - - public void createIncludeChain(IFile include, IResource res) { - try { -- include.setSessionProperty(OPEN_INCLUDE, res); -+ include.setSessionProperty(OPEN_INCLUDE, res); - } catch (CoreException e) { - // Do nothing - } diff --git a/eclipse-cdt-definedsymbolhover.patch b/eclipse-cdt-definedsymbolhover.patch deleted file mode 100644 index 4c166d2..0000000 --- a/eclipse-cdt-definedsymbolhover.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/DefinedSymbolHover.java.fix 2006-09-11 15:53:00.000000000 -0400 -+++ ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/DefinedSymbolHover.java 2006-09-11 15:52:51.000000000 -0400 -@@ -0,0 +1,67 @@ -+package org.eclipse.cdt.internal.ui.text.c.hover; -+ -+import java.util.Map; -+ -+import org.eclipse.cdt.core.CCorePlugin; -+import org.eclipse.cdt.core.model.IWorkingCopy; -+import org.eclipse.cdt.core.parser.IScannerInfo; -+import org.eclipse.cdt.core.parser.IScannerInfoProvider; -+import org.eclipse.cdt.ui.CUIPlugin; -+import org.eclipse.cdt.ui.IWorkingCopyManager; -+import org.eclipse.core.resources.IResource; -+import org.eclipse.jface.text.BadLocationException; -+import org.eclipse.jface.text.IRegion; -+import org.eclipse.jface.text.ITextViewer; -+import org.eclipse.ui.IEditorInput; -+import org.eclipse.ui.IEditorPart; -+ -+public class DefinedSymbolHover extends AbstractCEditorTextHover { -+ -+ /** -+ * -+ */ -+ public DefinedSymbolHover() { -+ super(); -+ } -+ -+ /* -+ * @see ITextHover#getHoverInfo(ITextViewer, IRegion) -+ */ -+ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { -+ IEditorPart editor = getEditor(); -+ if (editor != null) { -+ IEditorInput input= editor.getEditorInput(); -+ IWorkingCopyManager manager= CUIPlugin.getDefault().getWorkingCopyManager(); -+ IWorkingCopy copy = manager.getWorkingCopy(input); -+ if (copy == null) { -+ return null; -+ } -+ -+ String expression; -+ try { -+ expression = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength()); -+ expression = expression.trim(); -+ if (expression.length() == 0) -+ return null; -+ -+ String source = null; -+ IResource res = copy.getUnderlyingResource(); -+ -+ IScannerInfo info; -+ IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(res.getProject()); -+ if (provider != null) { -+ info = provider.getScannerInformation(res); -+ Map definedSymbols = info.getDefinedSymbols(); -+ String x = (String)definedSymbols.get(expression); -+ if (x != null) { -+ source = "-D" + expression + (x.length() > 0 ? " = " + -+ x : ""); -+ } -+ } -+ return source; -+ } catch (BadLocationException e) { -+ } -+ } -+ return null; -+ } -+} ---- ./results/plugins/org.eclipse.cdt.ui/plugin.properties.fix 2006-09-11 15:50:03.000000000 -0400 -+++ ./results/plugins/org.eclipse.cdt.ui/plugin.properties 2006-09-11 15:50:43.000000000 -0400 -@@ -283,6 +283,8 @@ ViewCommand.typeHierarchy.description= S - CEditorTextHoversName=C Editor Text Hovers - sourceHover= Source - sourceHoverDescription= Shows the source of the selected element. -+definedSymbolHover= Defined Symbol -+definedSymbolHoverDescription= Shows the definition of a selected defined symbol. - cdocHover= Documentation - cdocHoverDescription= Shows the documentation of the selected element. - sequentialHover= Combined Hover ---- ./results/plugins/org.eclipse.cdt.ui/plugin.xml.fix 2006-09-11 15:49:54.000000000 -0400 -+++ ./results/plugins/org.eclipse.cdt.ui/plugin.xml 2006-09-11 15:51:19.000000000 -0400 -@@ -145,6 +145,12 @@ - class="org.eclipse.cdt.internal.ui.text.c.hover.CSourceHover" - id="org.eclipse.cdt.ui.CSourceHover"> - -+ -+ - -+ -+ -+ -+ -+ -+ -+ ScannerInfoProvider that extracts from dynamic build info taken from makefiles. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Class which implements IScannerInfoProvider dynamically from makefile build. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ [Enter the first release in which this extension point appears.] -+ -+ -+ -+ -+ -+ -+ -+ -+ [Enter extension point usage example here.] -+ -+ -+ -+ -+ -+ -+ -+ -+ [Enter API information here.] -+ -+ -+ -+ -+ -+ -+ -+ -+ [Enter information about supplied implementation of this extension point.] -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ ---- ./results/plugins/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java.fix 2006-07-12 16:54:55.000000000 -0400 -+++ ./results/plugins/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java 2006-07-12 16:56:05.000000000 -0400 -@@ -856,6 +856,28 @@ public class CCorePlugin extends Plugin - } - return provider; - } -+ -+ /** -+ * Get the dynamic IScannerInfoProvider contributed interface for the platform. -+ * @return IScannerInfoProvider or null -+ */ -+ public IScannerInfoProvider getDynamicScannerInfoProvider() throws CoreException { -+ IScannerInfoProvider provider = null; -+ IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, "DynamicScannerInfoProvider"); //$NON-NLS-1$ -+ if (extension != null) { -+ IExtension[] extensions = extension.getExtensions(); -+ try { -+ if (extensions.length > 0) { -+ IConfigurationElement[] configElements = extensions[0].getConfigurationElements(); -+ provider = (IScannerInfoProvider) configElements[0].createExecutableExtension("class"); -+ } -+ return provider; -+ } catch (CoreException e) { -+ // log(e); -+ } -+ } -+ return null; -+ } - - /** - * Helper function, returning the contenttype for a filename ---- ./results/plugins/org.eclipse.cdt.core/plugin.xml.fix 2006-07-12 16:54:19.000000000 -0400 -+++ ./results/plugins/org.eclipse.cdt.core/plugin.xml 2006-07-12 16:56:05.000000000 -0400 -@@ -44,6 +44,7 @@ - - - -+ - - - ---- ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java.fix 2006-07-12 16:55:40.000000000 -0400 -+++ ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java 2006-07-12 16:56:05.000000000 -0400 -@@ -37,8 +37,10 @@ import org.eclipse.core.resources.IResou - import org.eclipse.core.resources.IResourceProxyVisitor; - import org.eclipse.core.resources.ResourcesPlugin; - import org.eclipse.core.runtime.CoreException; -+import org.eclipse.core.runtime.IConfigurationElement; - import org.eclipse.core.runtime.IPath; - import org.eclipse.core.runtime.Path; -+import org.eclipse.core.runtime.QualifiedName; - import org.eclipse.jface.action.Action; - import org.eclipse.jface.viewers.ILabelProvider; - import org.eclipse.jface.viewers.ISelection; -@@ -79,30 +81,47 @@ public class OpenIncludeAction extends A - if (include == null) { - return; - } -- - try { -+ boolean dynamicIncludePathFound = false; - IResource res = include.getUnderlyingResource(); - ArrayList filesFound = new ArrayList(4); -+ IResource resToScan = res; -+ QualifiedName dynamicScannerPrevFile = new QualifiedName("org.eclipse.cdt.core", "DynamicScannerPrevFile"); - if (res != null) { - IProject proj = res.getProject(); - String includeName = include.getElementName(); -- // Search in the scannerInfo information -- IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(proj); -+ IScannerInfoProvider provider = CCorePlugin.getDefault().getDynamicScannerInfoProvider(); - if (provider != null) { -- IScannerInfo info = provider.getScannerInformation(res); -- // XXXX this should fall back to project by itself -- if (info == null) { -- info = provider.getScannerInformation(proj); -- } -+ while (resToScan.getSessionProperty(dynamicScannerPrevFile) != null) -+ resToScan = (IResource)resToScan.getSessionProperty(dynamicScannerPrevFile); -+ IScannerInfo info = provider.getScannerInformation(resToScan); - if (info != null) { - String[] includePaths = info.getIncludePaths(); - HashSet found = new HashSet(); - findFile(includePaths, includeName, filesFound, found); - } -- if (filesFound.size() == 0) { -- // Fall back and search the project -- findFile(proj, new Path(includeName), filesFound); -+ } -+ if (filesFound.size() == 0) { -+ // Search in the scannerInfo information -+ provider = CCorePlugin.getDefault().getScannerInfoProvider(proj); -+ if (provider != null) { -+ IScannerInfo info = provider.getScannerInformation(res); -+ // XXXX this should fall back to project by itself -+ if (info == null) { -+ info = provider.getScannerInformation(proj); -+ } -+ if (info != null) { -+ String[] includePaths = info.getIncludePaths(); -+ HashSet found = new HashSet(); -+ findFile(includePaths, includeName, filesFound, found); -+ } -+ if (filesFound.size() == 0) { -+ // Fall back and search the project -+ findFile(proj, new Path(includeName), filesFound); -+ } - } -+ } else { -+ dynamicIncludePathFound = true; - } - } - IPath fileToOpen; -@@ -110,7 +129,7 @@ public class OpenIncludeAction extends A - if (nElementsFound == 0) { - noElementsFound(); - fileToOpen= null; -- } else if (nElementsFound == 1) { -+ } else if (nElementsFound == 1 || dynamicIncludePathFound) { - fileToOpen= (IPath) filesFound.get(0); - } else { - fileToOpen= chooseFile(filesFound); -@@ -119,6 +138,8 @@ public class OpenIncludeAction extends A - if (fileToOpen != null) { - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(fileToOpen); - if (file != null) { -+ if (dynamicIncludePathFound) -+ file.setSessionProperty(dynamicScannerPrevFile, resToScan); - EditorUtility.openInEditor(file); - } else { - ICProject cproject = include.getCProject(); diff --git a/eclipse-cdt-libhover-template.patch b/eclipse-cdt-libhover-template.patch new file mode 100644 index 0000000..e2d64d2 --- /dev/null +++ b/eclipse-cdt-libhover-template.patch @@ -0,0 +1,308 @@ +diff -up ./src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java.fix ./src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java +--- ./src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java.fix 2010-03-18 17:22:47.000000000 -0400 ++++ ./src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java 2010-03-18 17:23:34.000000000 -0400 +@@ -30,17 +30,18 @@ import java.util.SortedMap; + import java.util.Map.Entry; + + import org.eclipse.cdt.core.dom.ast.DOMException; +-import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier; + import org.eclipse.cdt.core.dom.ast.IASTName; +-import org.eclipse.cdt.core.dom.ast.IASTNamedTypeSpecifier; +-import org.eclipse.cdt.core.dom.ast.IASTNode; +-import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration; + import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; + import org.eclipse.cdt.core.dom.ast.IBinding; + import org.eclipse.cdt.core.dom.ast.IType; +-import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding; ++import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType; + import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; + import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType; ++import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument; ++import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition; ++import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance; ++import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter; ++import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap; + import org.eclipse.cdt.core.model.ILanguage; + import org.eclipse.cdt.core.model.ITranslationUnit; + import org.eclipse.cdt.ui.ICHelpBook; +@@ -256,11 +257,6 @@ public class LibHover implements ICHelpP + IFunctionSummary f; + + f = null; +- boolean isPTR = false; +- boolean isREF = false; +- int offset = -1; +- int length = 0; +- + ITranslationUnit t = context.getTranslationUnit(); + + String className = null; +@@ -271,128 +267,31 @@ public class LibHover implements ICHelpP + if (context instanceof IHoverHelpInvocationContext) { + // We know the file offset of the member reference. + IRegion region = (IRegion)((IHoverHelpInvocationContext)context).getHoverRegion(); +- char[] contents = t.getCodeReader().buffer; +- int i = region.getOffset(); +- // Let's figure out if it is a pointer reference or a direct reference in which case we can +- // find the variable and hence it's class. +- if (i > 2 && contents[i-1] == '>' && contents[i-2] == '-') { +- // Pointer reference +- int j = i - 3; +- int pointer = 0; +- while (j > 0 && isCPPCharacter(contents[j])) { +- pointer = j; +- --j; +- } +- if (pointer != 0) { +- offset = pointer; +- length = region.getOffset() - pointer - 2; +- isPTR = true; +- // String pointerName = new String(contents, pointer, region.getOffset() - pointer - 2); +- // System.out.println("pointer reference to " + pointerName); +- } +- } else if (i > 1 && contents[i-1] == '.') { +- int j = i - 2; +- int ref = 0; +- while (j > 0 && isCPPCharacter(contents[j])) { +- ref = j; +- --j; +- } +- if (ref != 0) { +- offset = ref; +- length = region.getOffset() - ref - 1; +- isREF = true; +- // String refName = new String(contents, ref, region.getOffset() - ref - 1); +- // System.out.println("regular reference to " + refName); +- } +- } +- final IASTName[] result= {null}; +- final int toffset = offset; +- final int tlength = length; +- +- // If we have a pointer or reference variable, get its ASTName. +- if (isPTR || isREF) { +- EnclosingASTNameJob job = new EnclosingASTNameJob(t, toffset, tlength); +- job.schedule(); +- try { +- job.join(); +- } catch (InterruptedException e) { +- // TODO Auto-generated catch block +- e.printStackTrace(); +- } +- if (job.getResult() == Status.OK_STATUS) +- result[0] = job.getASTName(); +- } +- +- // If we get the ASTName for the variable, let's find its declaration which will give us its class. +- final IASTName[][] decl = {null}; +- if (result[0] != null) { +- final IBinding binding = result[0].resolveBinding(); +- ASTDeclarationFinderJob job = new ASTDeclarationFinderJob(t, binding); +- job.schedule(); +- try { +- job.join(); +- } catch (InterruptedException e) { +- // TODO Auto-generated catch block +- e.printStackTrace(); +- } +- if (job.getResult() == Status.OK_STATUS) { +- decl[0] = job.getDeclarations(); +- } +- } +- +- // Look for a simple declaration. +- IASTNode n = null; +- if (decl[0] != null && decl[0].length > 0) { +- n = decl[0][0]; +- while (n != null && !(n instanceof IASTSimpleDeclaration)) { +- n = n.getParent(); +- } +- } +- +- // If we have the simple declaration, get its declaration specifier which hopefully will +- // be a named type. +- if (n != null) { +- IASTSimpleDeclaration d = (IASTSimpleDeclaration)n; +- IASTDeclSpecifier s = d.getDeclSpecifier(); +- if (s instanceof IASTNamedTypeSpecifier) { +- // From the named type, we can get the binding of the type name and from that, +- // its qualified name. We need a qualified name (i.e. with namespace) because our +- // repository of classes and typedefs are hashed by fully qualified names. +- IASTName astName = ((IASTNamedTypeSpecifier)s).getName(); +- if (astName != null) { +- IBinding nameBinding = astName.resolveBinding(); +- if (nameBinding instanceof ICPPBinding) { +- String[] qualified = ((ICPPBinding)nameBinding).getQualifiedName(); +- className = qualified[0]; +- for (int k = 1; k < qualified.length; ++k) +- className += "::" + qualified[k]; +- } else { +- className = nameBinding.getName(); +- } +- } +- } +- } +-// System.out.println("classname is " + className); + + // Now, let's find the declaration of the method. We need to do this because we want the specific + // member prototype to go searching for. There could be many members called "x" which have different + // documentation. +- if (className != null) { +- EnclosingASTNameJob job = new EnclosingASTNameJob(t, region.getOffset(), region.getLength()); +- job.schedule(); +- try { +- job.join(); +- } catch (InterruptedException e) { +- // TODO Auto-generated catch block +- e.printStackTrace(); +- } +- if (job.getResult() == Status.OK_STATUS) +- result[0] = job.getASTName(); +- } ++ final IASTName[] result= {null}; ++ EnclosingASTNameJob job = new EnclosingASTNameJob(t, region.getOffset(), region.getLength()); ++ job.schedule(); ++ try { ++ job.join(); ++ } catch (InterruptedException e) { ++ // TODO Auto-generated catch block ++ e.printStackTrace(); ++ } ++ if (job.getResult() == Status.OK_STATUS) ++ result[0] = job.getASTName(); + if (result[0] != null) { + final IBinding binding = result[0].getBinding(); ++ // Check to see we have a member function. + if (binding instanceof ICPPFunction) { + methodType = ((ICPPFunction)binding).getType(); ++ // We have a member function, find the class name. ++ IBinding owner = ((ICPPFunction)binding).getOwner(); ++ if (owner instanceof ICPPClassType) { ++ className = getClassName((ICPPClassType)owner); ++ } + } + } + } +@@ -422,6 +321,56 @@ public class LibHover implements ICHelpP + + return null; + } ++ ++ // Get the class name for a type, including any instance template parameters ++ // e.g. std::basic_string ++ private String getClassName(ICPPClassType c) { ++ String className = null; ++ try { ++ String[] qualified = c.getQualifiedName(); ++ className = qualified[0]; ++ for (int k = 1; k < qualified.length; ++k) { ++ className += "::" + qualified[k]; ++ } ++ ++ // Check if we have an instance of a template class. ++ if (c instanceof ICPPTemplateInstance) { ++ ICPPTemplateInstance ti = (ICPPTemplateInstance)c; ++ // Get a map which tells us the values of the template ++ // arguments (e.g. _CharT maps to char in the instance). ++ ICPPTemplateParameterMap tiMap = ti.getTemplateParameterMap(); ++ ICPPTemplateDefinition td = ti.getTemplateDefinition(); ++ ICPPTemplateParameter[] templateArgs = td.getTemplateParameters(); ++ className += "<"; ++ String separator = ""; ++ for (int x = 0; x < templateArgs.length; ++x) { ++ ICPPTemplateParameter tp = templateArgs[x]; ++ ICPPTemplateArgument ta = tiMap.getArgument(tp); ++ IType type = null; ++ // The template may have a type specified or a value. ++ // In the case of a value, figure out its type and use ++ // that when we do a lookup. ++ if (ta.isTypeValue()) ++ type = ta.getTypeValue(); ++ else ++ type = ta.getTypeOfNonTypeValue(); ++ if (tp.getTemplateNestingLevel() == 0) { ++ // if the parameter is a class type, use recursion to ++ // get its class name including template parameters ++ if (type instanceof ICPPClassType) ++ className += separator + getClassName((ICPPClassType)type); ++ else ++ className += separator + type.toString(); ++ separator = ","; ++ } ++ } ++ className += ">"; ++ } ++ } catch(DOMException e) { ++ return null; ++ } ++ return className; ++ } + + private IFunctionSummary getFunctionSummary(LibHoverLibrary l, String name) { + FunctionInfo x = l.getFunctionInfo(name); +@@ -483,8 +432,8 @@ public class LibHover implements ICHelpP + f.ReturnType = m.getReturnType(); + f.Prototype = m.getPrototype(); + f.Summary = m.getDescription(); +- String actualClassName = className.substring(className.indexOf("::")+2); // $NON-NLS-1$ +- f.Name = actualClassName + "::" + memberName; // $NON-NLS-1$ ++// String actualClassName = className.substring(className.indexOf("::")+2); // $NON-NLS-1$ ++ f.Name = className + "::" + memberName; // $NON-NLS-1$ + String[] templateParms = info.getTemplateParms(); + for (int i = 0; i < templateTypes.size(); ++i) { + f.ReturnType = f.ReturnType.replaceAll(templateParms[i], templateTypes.get(i)); +@@ -569,28 +518,6 @@ public class LibHover implements ICHelpP + fList.add(f); + } + } +- +-// Document document = l != null ? l.getDocument() : null; +-// if ((null != document) && (null != prefix)) { +-// NodeList elems = document.getElementsByTagName("construct"); // $NON-NLS-1$ +-// for (int i = 0; i < elems.getLength(); ++i) { +-// Element elem = (Element)elems.item(i); +-// NamedNodeMap attrs = elem.getAttributes(); +-// Node id_node = attrs.item(0); +-// String elemName = id_node.getNodeValue(); +-// if (elemName != null && elemName.startsWith("function-")) { // $NON-NLS-1$ +-// String funcName = elemName.substring(9); +-// if (funcName != null && funcName.startsWith(prefix)) { +-// NodeList functionNodes = elem.getElementsByTagName("function"); // $NON-NLS-1$ +-// for (int j = 0; j < functionNodes.getLength(); ++j) { +-// Node function_node = functionNodes.item(j); +-// FunctionSummary f = getFunctionSummaryFromNode(funcName, function_node, document); +-// fList.add(f); +-// } +-// } +-// } +-// } +-// } + } + IFunctionSummary[] summaries = new IFunctionSummary[fList.size()]; + for (int k = 0; k < summaries.length; k++) { +diff -up ./src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java.fix ./src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java +--- ./src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java.fix 2010-03-18 17:22:56.000000000 -0400 ++++ ./src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java 2010-03-18 17:23:38.000000000 -0400 +@@ -159,13 +159,15 @@ public class LibHoverLibrary { + // and we choose the first match. If nothing matches our particular + // case, we fall back on the initial generic template. + ClassInfo info = getHoverInfo().classes.get(className.substring(0, index)); +- ArrayList children = info.getChildren(); +- if (children != null && children.size() > 0) { +- for (int x = 0; x < children.size(); ++x) { +- ClassInfo child = children.get(x); +- if (className.matches(child.getClassName())) { +- info = child; +- break; ++ if (info != null) { ++ ArrayList children = info.getChildren(); ++ if (children != null && children.size() > 0) { ++ for (int x = 0; x < children.size(); ++x) { ++ ClassInfo child = children.get(x); ++ if (className.matches(child.getClassName())) { ++ info = child; ++ break; ++ } + } + } + } diff --git a/eclipse-cdt-libhover.patch b/eclipse-cdt-libhover.patch deleted file mode 100644 index d572f0a..0000000 --- a/eclipse-cdt-libhover.patch +++ /dev/null @@ -1,110 +0,0 @@ -diff -up ./org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF.fix2 ./org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF ---- ./org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF.fix2 2009-09-23 17:15:45.000000000 -0400 -+++ ./org.eclipse.linuxtools.cdt.libhover/META-INF/MANIFEST.MF 2009-09-23 17:08:47.000000000 -0400 -@@ -18,3 +18,4 @@ Require-Bundle: org.eclipse.ui, - org.eclipse.jface.text;bundle-version="3.4.1" - Bundle-RequiredExecutionEnvironment: J2SE-1.5 - Export-Package: org.eclipse.linuxtools.cdt.libhover -+Bundle-ActivationPolicy: lazy -diff -up ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java.fix2 ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java ---- ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java.fix2 2009-09-23 17:16:59.000000000 -0400 -+++ ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java 2009-09-23 17:09:54.000000000 -0400 -@@ -29,6 +29,7 @@ public class LibhoverPlugin extends Abst - * The constructor - */ - public LibhoverPlugin() { -+ plugin = this; - } - - /* -diff -up ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java.fix2 ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java ---- ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java.fix2 2009-09-23 17:11:05.000000000 -0400 -+++ ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java 2009-09-23 17:11:21.000000000 -0400 -@@ -451,7 +451,7 @@ public class LibHover implements ICHelpP - return null; - if (methodType != null) { - try { -- args = resolveArgs(info, methodType.getParameterTypes()); -+ args = resolveArgs(info, methodType.getParameterTypes(), templateTypes); - returnType = methodType.getReturnType(); - } catch (DOMException e) { - // TODO Auto-generated catch block -@@ -465,11 +465,11 @@ public class LibHover implements ICHelpP - MemberInfo member = info.getMember(memberName); - if (member != null) { - MemberInfo m = null; -- if (!isParmMatch(member, args)) { -+ if (!isParmMatch(member, args, templateTypes, info)) { - ArrayList members = member.getChildren(); - for (int i = 0; i < members.size(); ++i) { - MemberInfo k = members.get(i); -- if (isParmMatch(k, args)) { -+ if (isParmMatch(k, args, templateTypes, info)) { - m = k; - break; - } -@@ -513,12 +513,18 @@ public class LibHover implements ICHelpP - } - - -- private boolean isParmMatch(MemberInfo m, String[] args) { -+ private boolean isParmMatch(MemberInfo m, String[] args, ArrayList templateTypes, ClassInfo info) { - String[] memberParms = m.getParamTypes(); -+ for (int i = 0; i < memberParms.length; ++i) { -+ String[] templateParms = info.getTemplateParms(); -+ for (int j = 0; j < templateTypes.size(); ++j) { -+ memberParms[i] = memberParms[i].replaceAll(templateParms[j], templateTypes.get(j)); -+ } -+ } - return Arrays.equals(memberParms, args); - } - -- private String[] resolveArgs(ClassInfo info, IType[] parameterTypes) { -+ private String[] resolveArgs(ClassInfo info, IType[] parameterTypes, ArrayList templateTypes) { - String[] templateParms = info.getTemplateParms(); - String[] result = new String[parameterTypes.length]; - for (int i = 0; i < parameterTypes.length; ++i) { -@@ -529,7 +535,11 @@ public class LibHover implements ICHelpP - while (index >= 0) { - // We assume no class has more than 9 template parms. - int digit = param.charAt(index + 1) - '0'; -- param = param.replaceFirst(param.substring(index, index + 2), templateParms[digit]); -+ // where possible, replace template parms with real values -+ if (digit < templateTypes.size()) -+ param = param.replaceFirst(param.substring(index, index + 2), templateTypes.get(digit)); -+ else -+ param = param.replaceFirst(param.substring(index, index + 2), templateParms[digit]); - index = param.indexOf("#"); - } - result[i] = param; -diff -up ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java.fix2 ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java ---- ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java.fix2 2009-09-23 17:10:32.000000000 -0400 -+++ ./org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java 2009-09-23 17:10:55.000000000 -0400 -@@ -21,10 +21,12 @@ import java.net.URL; - import java.util.ArrayList; - - import org.eclipse.core.filesystem.URIUtil; -+import org.eclipse.core.runtime.FileLocator; - import org.eclipse.core.runtime.IPath; - import org.eclipse.linuxtools.cdt.libhover.ClassInfo; - import org.eclipse.linuxtools.cdt.libhover.FunctionInfo; - import org.eclipse.linuxtools.cdt.libhover.LibHoverInfo; -+import org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin; - import org.eclipse.linuxtools.cdt.libhover.TypedefInfo; - - public class LibHoverLibrary { -@@ -98,7 +100,13 @@ public class LibHoverLibrary { - URL url = acDoc.toURL(); - docStream = url.openStream(); - } else { -- docStream = new FileInputStream(p.toFile()); -+ try { -+ // Try to open the file as local to this plug-in. -+ docStream = FileLocator.openStream(LibhoverPlugin.getDefault().getBundle(), p, false); -+ } catch (IOException e) { -+ // File is not local to plug-in, try file system. -+ docStream = new FileInputStream(p.toFile()); -+ } - } - ObjectInputStream input = new ObjectInputStream(docStream); - hoverInfo = (LibHoverInfo)input.readObject(); diff --git a/eclipse-cdt-maketargets.patch b/eclipse-cdt-maketargets.patch new file mode 100644 index 0000000..842fd6c --- /dev/null +++ b/eclipse-cdt-maketargets.patch @@ -0,0 +1,243 @@ +### Eclipse Workspace Patch 1.0 +#P org.eclipse.cdt.make.core +Index: src/org/eclipse/cdt/make/core/IMakeTargetManager.java +=================================================================== +RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java,v +retrieving revision 1.16 +diff -u -r1.16 IMakeTargetManager.java +--- src/org/eclipse/cdt/make/core/IMakeTargetManager.java 14 Jun 2007 19:00:48 -0000 1.16 ++++ src/org/eclipse/cdt/make/core/IMakeTargetManager.java 1 Feb 2010 18:59:59 -0000 +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2000, 2007 QNX Software Systems and others. ++ * Copyright (c) 2000, 2007, 2010 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at +@@ -7,6 +7,7 @@ + * + * Contributors: + * QNX Software Systems - Initial API and implementation ++ * Red Hat Inc - Add setTargets method + *******************************************************************************/ + package org.eclipse.cdt.make.core; + +@@ -14,6 +15,12 @@ + import org.eclipse.core.resources.IProject; + import org.eclipse.core.runtime.CoreException; + ++/** ++ * MakeTarget Manager interface. ++ * ++ * @noimplement This interface is not intended to be implemented by clients. ++ * @noextend This interface is not intended to be extended by clients. ++ */ + public interface IMakeTargetManager { + IMakeTarget createTarget(IProject project, String targetName, String targetBuilderID) throws CoreException; + /** +@@ -24,7 +31,8 @@ + void addTarget(IMakeTarget target) throws CoreException; + + /** +- * Adds target to manager on a specific projects folder. ++ * Adds target to manager on a specific projects folder. It is assumed ++ * that the target and container belong to the same project. + * @param container + * @param target + * @throws CoreException +@@ -33,6 +41,21 @@ + void removeTarget(IMakeTarget target) throws CoreException; + void renameTarget(IMakeTarget target, String name) throws CoreException; + ++ /** ++ * Set targets on a specific projects folder. It is assumed ++ * all targets and container belong to the same project which ++ * is determined from the first element of the ++ * targets array. If no container is specified, the project is used. ++ * All previous targets for the container are replaced upon success and if ++ * failure occurs, an exception is thrown and the previous set of targets ++ * for the container are unchanged. ++ * ++ * @param container to set targets for or null if project should be used ++ * @param targets array ++ * @throws CoreException ++ */ ++ public void setTargets(IContainer container, IMakeTarget[] targets) throws CoreException; ++ + boolean targetExists(IMakeTarget target); + + IMakeTarget[] getTargets(IContainer container) throws CoreException; +Index: src/org/eclipse/cdt/make/core/MakeTargetEvent.java +=================================================================== +RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeTargetEvent.java,v +retrieving revision 1.10 +diff -u -r1.10 MakeTargetEvent.java +--- src/org/eclipse/cdt/make/core/MakeTargetEvent.java 11 Feb 2009 19:26:11 -0000 1.10 ++++ src/org/eclipse/cdt/make/core/MakeTargetEvent.java 1 Feb 2010 18:59:59 -0000 +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2000, 2007 QNX Software Systems and others. ++ * Copyright (c) 2000, 2007, 2010 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at +@@ -7,6 +7,7 @@ + * + * Contributors: + * QNX Software Systems - Initial API and implementation ++ * Red Hat Inc. - Allow multiple targets + *******************************************************************************/ + package org.eclipse.cdt.make.core; + +@@ -15,7 +16,7 @@ + import org.eclipse.core.resources.IProject; + + public class MakeTargetEvent extends EventObject { +- private static final long serialVersionUID = 1L; ++ private static final long serialVersionUID = 2L; + + public static final int TARGET_ADD = 1; + public static final int TARGET_CHANGED = 2; +@@ -23,7 +24,7 @@ + public static final int PROJECT_ADDED = 4; + public static final int PROJECT_REMOVED = 5; + +- IMakeTarget target; ++ IMakeTarget[] targets; + IProject project; + int type; + +@@ -33,7 +34,20 @@ + public MakeTargetEvent(Object source, int type, IMakeTarget target) { + super(source); + this.type = type; +- this.target = target; ++ this.targets = new IMakeTarget[] {target}; ++ } ++ ++ /** ++ * @param source ++ * @param type event type (e.g. TARGET_ADD, TARGET_CHANGED) ++ * @param targets array of MakeTargets ++ * ++ */ ++ public MakeTargetEvent(Object source, int type, IMakeTarget[] targets) { ++ super(source); ++ this.type = type; ++ this.targets = new IMakeTarget[targets.length]; ++ System.arraycopy(targets, 0, this.targets, 0, targets.length); + } + + public MakeTargetEvent(Object source, int type, IProject project) { +@@ -46,7 +60,16 @@ + return type; + } + ++ /* ++ * @deprecated ++ * Use getTargets() instead. ++ */ ++ @Deprecated + public IMakeTarget getTarget() { +- return target; ++ return targets[0]; ++ } ++ ++ public IMakeTarget[] getTargets() { ++ return targets; + } + } +Index: src/org/eclipse/cdt/make/internal/core/ProjectTargets.java +=================================================================== +RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/ProjectTargets.java,v +retrieving revision 1.30 +diff -u -r1.30 ProjectTargets.java +--- src/org/eclipse/cdt/make/internal/core/ProjectTargets.java 18 Mar 2009 17:44:47 -0000 1.30 ++++ src/org/eclipse/cdt/make/internal/core/ProjectTargets.java 1 Feb 2010 18:59:59 -0000 +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2000, 2008 QNX Software Systems and others. ++ * Copyright (c) 2000, 2008, 2010 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at +@@ -8,6 +8,7 @@ + * Contributors: + * QNX Software Systems - Initial API and implementation + * James Blackburn (Broadcom Corp.) - Use ICStorageElement ++ * Red Hat Inc. - Add set method + *******************************************************************************/ + package org.eclipse.cdt.make.internal.core; + +@@ -108,6 +109,20 @@ + return new IMakeTarget[0]; + } + ++ public void set(IContainer container, IMakeTarget[] targets) throws CoreException { ++ List newList = new ArrayList(); ++ for (int i = 0; i < targets.length; ++i) { ++ IMakeTarget target = targets[i]; ++ target.setContainer(container); ++ if (newList.contains(target)) { ++ throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, ++ MakeMessages.getString("MakeTargetManager.target_exists"), null)); //$NON-NLS-1$ ++ } ++ newList.add(target); ++ } ++ targetMap.put(container, newList); ++ } ++ + public IMakeTarget findTarget(IContainer container, String name) { + List list = targetMap.get(container); + if (list != null) { +Index: src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java +=================================================================== +RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java,v +retrieving revision 1.29 +diff -u -r1.29 MakeTargetManager.java +--- src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java 12 Mar 2009 18:21:04 -0000 1.29 ++++ src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java 1 Feb 2010 18:59:59 -0000 +@@ -1,5 +1,5 @@ + /******************************************************************************* +- * Copyright (c) 2000, 2007 QNX Software Systems and others. ++ * Copyright (c) 2000, 2007, 2010 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at +@@ -7,6 +7,7 @@ + * + * Contributors: + * QNX Software Systems - Initial API and implementation ++ * Red Hat Inc. - add setTargets method + *******************************************************************************/ + package org.eclipse.cdt.make.internal.core; + +@@ -81,6 +82,28 @@ + notifyListeners(new MakeTargetEvent(this, MakeTargetEvent.TARGET_ADD, target)); + } + ++ public void setTargets(IContainer container, IMakeTarget[] targets) throws CoreException { ++ if (container instanceof IWorkspaceRoot) { ++ throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeMessages.getString("MakeTargetManager.add_to_workspace_root"), null)); //$NON-NLS-1$ ++ } ++ ProjectTargets projectTargets = projectMap.get(targets[0].getProject()); ++ if (projectTargets == null) { ++ projectTargets = readTargets(targets[0].getProject()); ++ } ++ if (container == null) ++ container = targets[0].getProject(); ++ IMakeTarget[] oldTargets = projectTargets.get(container); ++ projectTargets.set(container, targets); ++ try { ++ writeTargets(projectTargets); ++ } catch (CoreException e) { ++ // we only need to reset the targets if writing of targets fails ++ projectTargets.set(container, oldTargets); ++ throw e; ++ } ++ notifyListeners(new MakeTargetEvent(this, MakeTargetEvent.TARGET_ADD, targets[0])); ++ } ++ + public boolean targetExists(IMakeTarget target) { + ProjectTargets projectTargets = projectMap.get(target.getProject()); + if (projectTargets == null) { diff --git a/eclipse-cdt-managedConfigurations-fix.patch b/eclipse-cdt-managedConfigurations-fix.patch deleted file mode 100644 index 3dbb4cb..0000000 --- a/eclipse-cdt-managedConfigurations-fix.patch +++ /dev/null @@ -1,65 +0,0 @@ -Index: src/org/eclipse/cdt/ui/newui/AbstractPage.java -=================================================================== -RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java,v -retrieving revision 1.63 -diff -u -r1.63 AbstractPage.java ---- src/org/eclipse/cdt/ui/newui/AbstractPage.java 29 May 2008 10:31:51 -0000 1.63 -+++ src/org/eclipse/cdt/ui/newui/AbstractPage.java 6 Nov 2008 00:37:18 -0000 -@@ -68,6 +68,7 @@ - import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation; - import org.eclipse.ui.dialogs.PropertyPage; - -+import org.eclipse.cdt.core.CCorePlugin; - import org.eclipse.cdt.core.model.CoreModel; - import org.eclipse.cdt.core.model.ICElement; - import org.eclipse.cdt.core.model.ICProject; -@@ -79,6 +80,7 @@ - import org.eclipse.cdt.core.settings.model.ICProjectDescription; - import org.eclipse.cdt.core.settings.model.ICResourceDescription; - import org.eclipse.cdt.core.settings.model.MultiItemsHolder; -+import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; - import org.eclipse.cdt.ui.CUIPlugin; - import org.eclipse.cdt.ui.PreferenceConstants; - import org.eclipse.cdt.utils.ui.controls.ControlFactory; -@@ -468,7 +470,7 @@ - * - * @param prj - project description where we'll search (or create) config description - * @param cfg - config description belonging to another project description, -- * it is a sample for search and base for possile creation -+ * it is a sample for search and base for possible creation - * of resulting configuration description. - * - * @return the configuration description (found or created) or null in case of error -@@ -479,11 +481,27 @@ - ICConfigurationDescription c = prj.getConfigurationById(id); - // if there's no cfg found, try to create it - if (c == null) { -- try { -- c = prj.createConfiguration(id, cfg.getName(), cfg); -- c.setDescription(cfg.getDescription()); -- } catch (CoreException e) { -- /* do nothing: c is already null */ -+ // see if this is a configuration that is known to the project description cached by the -+ // CDTPropertyPage (e.g. config has been added via New Configuration Dialog) -+ ICProjectDescription prj2 = CDTPropertyManager.getProjectDescription(AbstractPage.this, getProject()); -+ ICConfigurationDescription c2 = prj2.getConfigurationById(id); -+ if (c2 != null) { -+ // cfg found...let's use the same build system id and create it on the -+ // project description passed in -+ try { -+ CConfigurationData data = cfg.getConfigurationData(); -+ c = prj.createConfiguration(c2.getBuildSystemId(), data); -+ } catch (CoreException e) { -+ /* do nothing: c is already null */ -+ } -+ } else { -+ // not found..let's create it anyway -+ try { -+ CConfigurationData data = cfg.getConfigurationData(); -+ c = prj.createConfiguration(CCorePlugin.DEFAULT_PROVIDER_ID, data); -+ } catch (CoreException e) { -+ /* do nothing: c is already null */ -+ } - } - } - // if creation failed, report an error and return null diff --git a/eclipse-cdt-managedConfigurations.patch b/eclipse-cdt-managedConfigurations.patch deleted file mode 100644 index beabea3..0000000 --- a/eclipse-cdt-managedConfigurations.patch +++ /dev/null @@ -1,21 +0,0 @@ -Index: model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java -=================================================================== -RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java,v -retrieving revision 1.63 -diff -u -r1.63 CProjectDescriptionManager.java ---- model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java 28 Apr 2008 18:35:09 -0000 1.63 -+++ model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java 7 Oct 2008 19:32:38 -0000 -@@ -1512,8 +1512,11 @@ - ICStorageElement el = children[i]; - if(CONFIGURATION.equals(el.getName())){ - String id = el.getAttribute(CConfigurationSpecSettings.ID); -- if(id != null) -- map.put(id, el); -+ if(id != null) { -+ ICStorageElement el2 = (ICStorageElement)map.put(id, el); -+ if (el2 != null && el2 != el) -+ map.put(id, el2); -+ } - } - } - } diff --git a/eclipse-cdt-managedbuild-failcheck.patch b/eclipse-cdt-managedbuild-failcheck.patch deleted file mode 100644 index dc3bb58..0000000 --- a/eclipse-cdt-managedbuild-failcheck.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- ./results/plugins/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java.fix 2007-01-26 19:22:27.000000000 -0500 -+++ ./results/plugins/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java 2007-01-26 19:43:53.000000000 -0500 -@@ -700,34 +700,40 @@ public class GeneratedMakefileBuilder ex - } - } - } -- -- // Now call make -- checkCancel(monitor); -- statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", getProject().getName()); //$NON-NLS-1$ -- monitor.subTask(statusMsg); -- IPath topBuildDir = generator.getBuildWorkingDir(); -- if (topBuildDir != null) { -- invokeMake(FULL_BUILD, topBuildDir, info, generator, monitor); -+ -+ if (result.getCode() != IStatus.ERROR) { -+ // Now call make -+ checkCancel(monitor); -+ statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", getProject().getName()); //$NON-NLS-1$ -+ monitor.subTask(statusMsg); -+ IPath topBuildDir = generator.getBuildWorkingDir(); -+ if (topBuildDir != null) { -+ invokeMake(FULL_BUILD, topBuildDir, info, generator, monitor); -+ } else { -+ statusMsg = ManagedMakeMessages.getFormattedString(NOTHING_BUILT, getProject().getName()); //$NON-NLS-1$ -+ monitor.subTask(statusMsg); -+ return; -+ } -+ -+ // Now regenerate the dependencies -+ checkCancel(monitor); -+ statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.regen.deps", getProject().getName()); //$NON-NLS-1$ -+ monitor.subTask(statusMsg); -+ try { -+ generator.regenerateDependencies(false); -+ } catch (CoreException e) { -+ // Throw the exception back to the builder -+ throw e; -+ } -+ -+ // Build finished message -+ statusMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED, getProject().getName()); //$NON-NLS-1$ -+ monitor.subTask(statusMsg); - } else { -- statusMsg = ManagedMakeMessages.getFormattedString(NOTHING_BUILT, getProject().getName()); //$NON-NLS-1$ -+ // Build finished message -+ statusMsg = ManagedMakeMessages.getFormattedString(BUILD_STOPPED_ERR, getProject().getName()); //$NON-NLS-1$ - monitor.subTask(statusMsg); -- return; -- } -- -- // Now regenerate the dependencies -- checkCancel(monitor); -- statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.regen.deps", getProject().getName()); //$NON-NLS-1$ -- monitor.subTask(statusMsg); -- try { -- generator.regenerateDependencies(false); -- } catch (CoreException e) { -- // Throw the exception back to the builder -- throw e; - } -- -- // Build finished message -- statusMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED, getProject().getName()); //$NON-NLS-1$ -- monitor.subTask(statusMsg); - } - - /* (non-Javadoc) diff --git a/eclipse-cdt-mm-builder.patch b/eclipse-cdt-mm-builder.patch deleted file mode 100644 index 380f679..0000000 --- a/eclipse-cdt-mm-builder.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java.fix 2006-08-08 14:47:55.000000000 -0400 -+++ com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java 2006-08-08 14:48:25.000000000 -0400 -@@ -18,12 +18,19 @@ import java.util.Vector; - - import org.eclipse.cdt.make.core.IMakeBuilderInfo; - import org.eclipse.cdt.make.core.MakeCorePlugin; -+import org.eclipse.cdt.managedbuilder.core.IConfiguration; -+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin; -+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature; - import org.eclipse.cdt.managedbuilder.internal.core.GeneratedMakefileBuilder; -+import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo; - import org.eclipse.core.resources.ICommand; - import org.eclipse.core.resources.IProject; - import org.eclipse.core.resources.IProjectDescription; - import org.eclipse.core.runtime.CoreException; - import org.eclipse.core.runtime.IProgressMonitor; -+import org.eclipse.core.runtime.NullProgressMonitor; - - /** - * This is the incremental builder associated with a managed build project. It dynamically -@@ -34,6 +41,8 @@ import org.eclipse.core.runtime.IProgres - public class AutotoolsMakefileBuilder extends GeneratedMakefileBuilder { - public static final String BUILDER_NAME = "genmakebuilder"; //$NON-NLS-1$ - public static final String BUILDER_ID = AutotoolsPlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$ -+ public static final String MANAGED_BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$ -+ public static final String AUTOTOOLS_CONFIG_ID = AutotoolsPlugin.getUniqueIdentifier() + ".configuration1"; //$NON-NLS-1$ - - private IMakeBuilderInfo info; - -@@ -46,16 +55,21 @@ public class AutotoolsMakefileBuilder ex - IProjectDescription description = project.getDescription(); - ICommand[] commands = description.getBuildSpec(); - -- // TODO Remove this when the new StandardBuild nature adds the cbuilder -+ // TODO Remove the cbuilder check when the new StandardBuild nature adds the cbuilder - for (int i = 0; i < commands.length; i++) { - ICommand command = commands[i]; -- if (command.getBuilderName().equals("org.eclipse.cdt.core.cbuilder")) { //$NON-NLS-1$ -+ String builderName = command.getBuilderName(); -+ // If there is a ManagedMake makefile generator, remove it as it will -+ // cause an additional build "all" to occur when we are making any target. -+ if (builderName.equals("org.eclipse.cdt.core.cbuilder") || -+ builderName.equals(MANAGED_BUILDER_ID)) { //$NON-NLS-1$ - // Remove the command - Vector vec = new Vector(Arrays.asList(commands)); - vec.removeElementAt(i); - vec.trimToSize(); - ICommand[] tempCommands = (ICommand[]) vec.toArray(new ICommand[commands.length-1]); - description.setBuildSpec(tempCommands); -+ project.setDescription(description, null); - break; - } - } -@@ -84,12 +98,18 @@ public class AutotoolsMakefileBuilder ex - - public static boolean hasTargetBuilder(IProject project) { - try { -- IProjectDescription description = project.getDescription(); -- ICommand[] commands = description.getBuildSpec(); -- // See if the builder is already there -- -- for (int i = 0; i < commands.length; ++i) { -- if (commands[i].getBuilderName().equals(BUILDER_ID)) { -+ // When a project is converted to an Autotools project, we -+ // replace the ManagedMake builder with a special one that -+ // handles MakeTargets. If a project is brought into Eclipse and -+ // uses the New Project Wizard to create a ManagedMake project that -+ // is of type: Autotools, this added step is not done. If we know -+ // we have an Autotools project from the configuration id, then -+ // we should add the builder now and return true. -+ if (project.getNature(ManagedCProjectNature.MNG_NATURE_ID) != null) { -+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); -+ IConfiguration config = info.getDefaultConfiguration(); -+ if (config.getParent().getId().equals(AUTOTOOLS_CONFIG_ID)) { -+ addAutotoolsBuilder(project, new NullProgressMonitor()); - return true; - } - } diff --git a/eclipse-cdt-no-sdkbuild.patch b/eclipse-cdt-no-sdkbuild.patch deleted file mode 100644 index 7f070dc..0000000 --- a/eclipse-cdt-no-sdkbuild.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- build.xml 2005-02-24 14:10:52.000000000 -0600 -+++ build.xml.new 2005-04-04 12:51:46.117849336 -0500 -@@ -37,15 +37,9 @@ - - - -- -- -- - - - -- -- -- - - - -@@ -57,9 +51,6 @@ - - - -- -- -- - - - diff --git a/eclipse-cdt-no-tests-4.0.3.patch b/eclipse-cdt-no-tests-4.0.3.patch deleted file mode 100644 index eb18baf..0000000 --- a/eclipse-cdt-no-tests-4.0.3.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./build.xml.fix2 2008-04-04 16:06:49.000000000 -0400 -+++ ./build.xml 2008-04-04 16:07:02.000000000 -0400 -@@ -4,7 +4,7 @@ - - - -- -+ - - - diff --git a/eclipse-cdt-no-tests-5.0.0.patch b/eclipse-cdt-no-tests-5.0.0.patch deleted file mode 100644 index cbce224..0000000 --- a/eclipse-cdt-no-tests-5.0.0.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./org.eclipse.cdt.releng/build.xml.notests ./org.eclipse.cdt.releng/build.xml ---- ./org.eclipse.cdt.releng/build.xml.notests 2008-07-31 20:34:19.000000000 -0400 -+++ ./org.eclipse.cdt.releng/build.xml 2008-07-31 20:41:49.000000000 -0400 -@@ -4,7 +4,7 @@ - - - -- -+ - - - diff --git a/eclipse-cdt-no-tests-5.0.1.patch b/eclipse-cdt-no-tests-5.0.1.patch deleted file mode 100644 index cbce224..0000000 --- a/eclipse-cdt-no-tests-5.0.1.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./org.eclipse.cdt.releng/build.xml.notests ./org.eclipse.cdt.releng/build.xml ---- ./org.eclipse.cdt.releng/build.xml.notests 2008-07-31 20:34:19.000000000 -0400 -+++ ./org.eclipse.cdt.releng/build.xml 2008-07-31 20:41:49.000000000 -0400 -@@ -4,7 +4,7 @@ - - - -- -+ - - - diff --git a/eclipse-cdt-no-tests.patch b/eclipse-cdt-no-tests.patch deleted file mode 100644 index f3931df..0000000 --- a/eclipse-cdt-no-tests.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- build.xml.orig 2006-06-08 11:34:05.000000000 -0400 -+++ build.xml 2006-06-08 11:57:56.000000000 -0400 -@@ -4,7 +4,7 @@ - - - -- -+ - - - diff --git a/eclipse-cdt-noLexerTests.patch b/eclipse-cdt-noLexerTests.patch deleted file mode 100644 index ccc2e9a..0000000 --- a/eclipse-cdt-noLexerTests.patch +++ /dev/null @@ -1,18 +0,0 @@ -### Eclipse Workspace Patch 1.0 -#P org.eclipse.cdt.core.tests -Index: parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java -=================================================================== -RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java,v -retrieving revision 1.6 -diff -u -r1.6 ScannerTestSuite.java ---- parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java 16 Jan 2008 16:43:48 -0000 1.6 -+++ parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java 25 Aug 2008 15:36:46 -0000 -@@ -17,7 +17,7 @@ - - public static Test suite() { - TestSuite suite= new ScannerTestSuite(); -- suite.addTest(LexerTests.suite()); -+// suite.addTest(LexerTests.suite()); - suite.addTest(LocationMapTests.suite()); - suite.addTest(PortedScannerTests.suite()); - suite.addTest(PreprocessorTests.suite()); diff --git a/eclipse-cdt-scannerinfoplus.patch b/eclipse-cdt-scannerinfoplus.patch deleted file mode 100644 index 729bb75..0000000 --- a/eclipse-cdt-scannerinfoplus.patch +++ /dev/null @@ -1,82 +0,0 @@ ---- ./results/plugins/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfoPlus.java.fix 2006-08-29 14:28:17.000000000 -0400 -+++ ./results/plugins/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IScannerInfoPlus.java 2006-08-29 14:28:54.000000000 -0400 -@@ -0,0 +1,16 @@ -+package org.eclipse.cdt.core.parser; -+ -+import org.eclipse.core.resources.IFile; -+import org.eclipse.core.resources.IResource; -+ -+public interface IScannerInfoPlus extends IScannerInfo { -+ -+ /** -+ * Map an open include file as being included by a specific resource. -+ * -+ * @param include the include file -+ * @param res the resource that included the include file -+ */ -+ public void createIncludeChain(IFile include, IResource res); -+ -+} ---- ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java.fix 2006-08-29 14:32:46.000000000 -0400 -+++ ./results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/OpenIncludeAction.java 2006-08-29 14:33:19.000000000 -0400 -@@ -24,6 +24,7 @@ import org.eclipse.cdt.core.model.ICElem - import org.eclipse.cdt.core.model.ICProject; - import org.eclipse.cdt.core.model.ITranslationUnit; - import org.eclipse.cdt.core.parser.IScannerInfo; -+import org.eclipse.cdt.core.parser.IScannerInfoPlus; - import org.eclipse.cdt.core.parser.IScannerInfoProvider; - import org.eclipse.cdt.internal.ui.CPluginImages; - import org.eclipse.cdt.internal.ui.dialogs.ElementListSelectionDialog; -@@ -37,8 +38,10 @@ import org.eclipse.core.resources.IResou - import org.eclipse.core.resources.IResourceProxyVisitor; - import org.eclipse.core.resources.ResourcesPlugin; - import org.eclipse.core.runtime.CoreException; -+import org.eclipse.core.runtime.IConfigurationElement; - import org.eclipse.core.runtime.IPath; - import org.eclipse.core.runtime.Path; -+import org.eclipse.core.runtime.QualifiedName; - import org.eclipse.jface.action.Action; - import org.eclipse.jface.viewers.ILabelProvider; - import org.eclipse.jface.viewers.ISelection; -@@ -79,17 +82,16 @@ public class OpenIncludeAction extends A - if (include == null) { - return; - } -- - try { - IResource res = include.getUnderlyingResource(); -+ IScannerInfo info = null; - ArrayList filesFound = new ArrayList(4); - if (res != null) { - IProject proj = res.getProject(); - String includeName = include.getElementName(); -- // Search in the scannerInfo information -- IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(proj); -+ IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(proj); - if (provider != null) { -- IScannerInfo info = provider.getScannerInformation(res); -+ info = provider.getScannerInformation(res); - // XXXX this should fall back to project by itself - if (info == null) { - info = provider.getScannerInformation(proj); -@@ -110,7 +112,7 @@ public class OpenIncludeAction extends A - if (nElementsFound == 0) { - noElementsFound(); - fileToOpen= null; -- } else if (nElementsFound == 1) { -+ } else if (nElementsFound == 1 || info instanceof IScannerInfoPlus) { - fileToOpen= (IPath) filesFound.get(0); - } else { - fileToOpen= chooseFile(filesFound); -@@ -119,6 +121,11 @@ public class OpenIncludeAction extends A - if (fileToOpen != null) { - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(fileToOpen); - if (file != null) { -+ // If dealing with an IScannerInfoPlus, we want to register -+ // the resource with the include file it includes. -+ if (info instanceof IScannerInfoPlus) { -+ ((IScannerInfoPlus)info).createIncludeChain(file, res); -+ } - EditorUtility.openInEditor(file); - } else { - ICProject cproject = include.getCProject(); diff --git a/eclipse-cdt.spec b/eclipse-cdt.spec index e39f474..bb0e6b7 100644 --- a/eclipse-cdt.spec +++ b/eclipse-cdt.spec @@ -7,9 +7,9 @@ Epoch: 1 %define major 6 %define minor 0 %define majmin %{major}.%{minor} -%define micro 1 +%define micro 2 %define eclipse_base %{_libdir}/eclipse -%define build_id 200909110608 +%define build_id 201002161416 # All arches line up except i386 -> x86 @@ -22,7 +22,7 @@ Epoch: 1 Summary: Eclipse C/C++ Development Tools (CDT) plugin Name: eclipse-cdt Version: %{majmin}.%{micro} -Release: 8%{?dist} +Release: 2%{?dist} License: EPL and CPL Group: Development/Tools URL: http://www.eclipse.org/cdt @@ -33,13 +33,13 @@ Requires: eclipse-platform # script. Note that the optional c99 and upc parsers plus the optional # xlc support features have been removed. -Source0: %{name}-fetched-src-CDT_6_0_1.tar.bz2 +Source0: %{name}-fetched-src-v%{build_id}.tar.bz2 Source4: fetch-cdt.sh -Source1: %{name}-fetched-src-autotools-R0_4_0_1.tar.gz +Source1: %{name}-fetched-src-autotools-R0_5_0.tar.gz Source14: make-autotools-tarball.sh -Source2: %{name}-fetched-src-libhover-R0_4_0.tar.gz +Source2: %{name}-fetched-src-libhover-R0_5_0.tar.gz Source15: make-libhover-tarball.sh ## The following tarball was generated thusly: @@ -104,17 +104,24 @@ Patch16: %{name}-ppc64-add_ldflags.patch # https://bugs.eclipse.org/bugs/show_bug.cgi?id=272370 Patch17: %{name}-ppc64-add_xopen_source-include.patch -# Fix problem in Discovery Tab code that causes NPE for Autotools project -# https://bugs.eclipse.org/bugs/show_bug.cgi?id=291690 -Patch18: %{name}-discoverytab.patch - # Following is a patch to autotools to supply macro hover docs locally # in the plugin. Patch19: %{name}-autotools-local.patch -# Disable mylyn bridge compiling. Should be removed when CDT 6.1 is out. +# Disable mylyn bridge compiling. Should be removed when CDT 7.0 is out. Patch20: %{name}-disable-mylyn.patch +# Add new setTargets interface to MakeTargetManager for use by Autotools. +# This can be removed for CDT 7.0. +Patch21: %{name}-maketargets.patch + +# Fix for Autotools bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=306406 +# Can be removed once Autotools moves to R0_5_1 or higher. +Patch22: %{name}-addbuilder.patch + +# Fix for Libhover bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=306283 +Patch23: %{name}-libhover-template.patch + BuildRequires: eclipse-pde BuildRequires: eclipse-rse >= 3.0 BuildRequires: java-devel >= 1.4.2 @@ -175,8 +182,8 @@ popd pushd results/plugins %patch13 popd -pushd results/plugins/org.eclipse.cdt.managedbuilder.ui -%patch18 -p0 +pushd results/plugins/org.eclipse.cdt.make.core +%patch21 -p0 popd #pushd results/plugins/org.eclipse.cdt.core.tests #rm parser/org/eclipse/cdt/core/parser/tests/scanner/LexerTests.java @@ -216,7 +223,8 @@ mkdir autotools pushd autotools tar -xzf %{SOURCE1} %patch19 -p0 -pushd org.eclipse.linuxtools.cdt.autotools +pushd org.eclipse.linuxtools.cdt.autotools.core +%patch22 -p0 mkdir macros pushd macros cp %{SOURCE8} . @@ -238,6 +246,7 @@ rm -rf org.eclipse.linuxtools.cdt.libhover.newlib rm -rf org.eclipse.linuxtools.cdt.libhover.newlib-feature %patch14 -p0 pushd org.eclipse.linuxtools.cdt.libhover +%patch23 -p0 mkdir libhoverdocs pushd libhoverdocs cp %{SOURCE6} . @@ -589,6 +598,14 @@ rm -rf ${RPM_BUILD_ROOT} %endif %changelog +* Fri Mar 19 2010 Jeff Johnston 1:6.0.2-2 +- Check in missing maketargets patch. + +* Thu Mar 18 2010 Jeff Johnston 1:6.0.2-1 +- Rebase CDT to Galileo SR2 (6.0.2). +- Rebase Autotools to Linux tools R0.5. +- Rebase Libhover to Linux tools R0.5. + * Fri Jan 29 2010 Jeff Johnston 1:6.0.1-8 - Fix urls for autotools and libhover sources. - Add source references for autotools and libhover fetch scripts. diff --git a/fetch-cdt.sh b/fetch-cdt.sh index d8f505b..16d0719 100755 --- a/fetch-cdt.sh +++ b/fetch-cdt.sh @@ -1,6 +1,6 @@ #!/bin/sh -CDTTAG=CDT_6_0_1 +CDTTAG=v201002161416 ECLIPSEBASE=$(rpm --eval %{_libdir})/eclipse mkdir -p temp && cd temp diff --git a/sources b/sources index 8dcf470..664ea9a 100644 --- a/sources +++ b/sources @@ -2,12 +2,12 @@ 2d4ae0a2131ba1efc896d981072cc091 eclipse-cdt-target_filter.gif.gz 921f3464c4b5a284473ebdad634e5c2d libstdc++-v3.libhover 4bccad3ee92faaca4f8dc3ac6941434e glibc-2.7-2.libhover -62e2dcbf8fb1f1b23cc71ae762b873b8 eclipse-cdt-fetched-src-CDT_6_0_1.tar.bz2 992ad18bb8b4d95e5ecab9138dc379ae acmacros-2.13.xml 5bcf3e0c2a780b237bb06226eda7a4e7 acmacros-2.59.xml 0e096b343447578000c73002dc448afa acmacros-2.61.xml 4404043432f7f30300139ce39288ba93 ammacros-1.4-p6.xml f6edf5299e6f0d89017bd295a296c2cd ammacros-1.9.5.xml f5c671311f49cdb33eaaa64ab6d781fa ammacros-1.9.6.xml -5560963f84030d8a535ce56c7c3c79f5 eclipse-cdt-fetched-src-autotools-R0_4_0_1.tar.gz -10762b14bfee59132ef50324bb343f71 eclipse-cdt-fetched-src-libhover-R0_4_0.tar.gz +c42f55b60cdb4410b6c5a5201357e7b8 eclipse-cdt-fetched-src-v201002161416.tar.bz2 +b521cd872ec5776d743a38318a4cbe3e eclipse-cdt-fetched-src-autotools-R0_5_0.tar.gz +6a21a7b465d9abce8064186f1ba601c6 eclipse-cdt-fetched-src-libhover-R0_5_0.tar.gz