diff --git a/eclipse-cdt-configuration.patch b/eclipse-cdt-configuration.patch new file mode 100644 index 0000000..eedf2f5 --- /dev/null +++ b/eclipse-cdt-configuration.patch @@ -0,0 +1,221 @@ +--- com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java.fix 2006-08-21 17:06:01.000000000 -0400 ++++ com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java 2006-08-21 17:06:22.000000000 -0400 +@@ -3,9 +3,13 @@ package com.redhat.eclipse.cdt.autotools + import org.eclipse.cdt.make.core.IMakeTarget; + import org.eclipse.cdt.make.ui.MakeLabelProvider; + import org.eclipse.cdt.make.ui.TargetBuild; ++import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; ++import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; + import org.eclipse.core.resources.IContainer; ++import org.eclipse.core.resources.IProject; + import org.eclipse.core.runtime.CoreException; + import org.eclipse.core.runtime.IPath; ++import org.eclipse.core.runtime.NullProgressMonitor; + import org.eclipse.core.runtime.QualifiedName; + import org.eclipse.jface.action.IAction; + import org.eclipse.jface.window.Window; +@@ -13,6 +17,7 @@ import org.eclipse.ui.IWorkbenchWindowAc + import org.eclipse.ui.dialogs.ElementListSelectionDialog; + + import com.redhat.eclipse.cdt.autotools.AutotoolsPlugin; ++import com.redhat.eclipse.cdt.autotools.MakeGenerator; + + /** + * Our sample action implements workbench action delegate. +@@ -42,7 +47,19 @@ public class BuildSpecial extends Abstra + if (container != null) { + ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new MakeLabelProvider()); + try { +- dialog.setElements(AutotoolsPlugin.getDefault().getTargetManager().getTargets(container)); ++ // Get the targets listed for the top-level makefile. If none ++ // exist, we may not have a makefile yet so we should attempt to ++ // generate the makefile via configuration. ++ IMakeTarget[] targets = AutotoolsPlugin.getDefault().getTargetManager().getTargets(container); ++ if (targets.length == 0) { ++ IProject project = container.getProject(); ++ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); ++ MakeGenerator generator = new MakeGenerator(); ++ generator.initialize(project, info, new NullProgressMonitor()); ++ generator.regenerateMakefiles(); ++ } ++ targets = AutotoolsPlugin.getDefault().getTargetManager().getTargets(container); ++ dialog.setElements(targets); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); +--- com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java.fix 2006-08-21 17:01:14.000000000 -0400 ++++ com.redhat.eclipse.cdt.autotools/src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java 2006-08-21 17:01:44.000000000 -0400 +@@ -1,8 +1,15 @@ + package com.redhat.eclipse.cdt.autotools; + ++import java.io.BufferedInputStream; ++import java.io.BufferedOutputStream; + import java.io.ByteArrayInputStream; ++import java.io.DataInputStream; ++import java.io.DataOutputStream; ++import java.io.EOFException; + import java.io.File; ++import java.io.FileInputStream; + import java.io.FileNotFoundException; ++import java.io.FileOutputStream; + import java.io.FileReader; + import java.io.IOException; + import java.io.OutputStream; +@@ -53,6 +60,8 @@ public class MakeGenerator implements IM + public final String AUTOGEN_SH = "autogen.sh"; + + public final String CONFIGURE = "configure"; ++ ++ public final String SETTINGS_FILE_NAME = ".cdtconfigure"; + + private IProject project; + +@@ -244,6 +253,7 @@ public class MakeGenerator implements IM + public MultiStatus regenerateMakefiles() throws CoreException { + MultiStatus status; + boolean ok = true; ++ boolean needFullConfigure = true; + + // See if the user has cancelled the build + checkCancel(); +@@ -292,8 +302,40 @@ public class MakeGenerator implements IM + IPath configfile = getProjectLocation().append(buildDir).append( + CONFIG_STATUS); + IFile configStatus = root.getFileForLocation(configfile); +- +- if (configStatus != null && configStatus.exists()) { ++ IPath configSettingsPath = getProjectLocation().append(SETTINGS_FILE_NAME); ++ IFile configSettings = root.getFileForLocation(configSettingsPath); ++ String[] configArgs = getConfigArgs(); ++ ++ // We need to figure out if the end-user has changed the configuration ++ // settings. In such a case, we need to reconfigure from scratch ++ // regardless of whether config.status exists or not. ++ // We figure this out by saving the configuration settings to ++ // a special file and reading/comparing whenever we are asked to build. ++ if (configSettings.exists()) { ++ int i = 0; ++ needFullConfigure = false; ++ IPath settingsPath = project.getLocation().append(SETTINGS_FILE_NAME); ++ try { ++ File f = new File(settingsPath.toOSString()); ++ DataInputStream settings = new DataInputStream( ++ new BufferedInputStream(new FileInputStream(f))); ++ while (i < configArgs.length) { ++ String s = settings.readUTF(); ++ if (!s.equals(configArgs[i])) { ++ i = configArgs.length; ++ needFullConfigure = true; ++ } ++ ++i; ++ } ++ if (settings.available() > 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.spec b/eclipse-cdt.spec index a61ce08..d1aa29c 100644 --- a/eclipse-cdt.spec +++ b/eclipse-cdt.spec @@ -21,7 +21,7 @@ Epoch: 1 Summary: %{pkg_summary} Name: %{eclipse_name}-cdt Version: %{majmin}.%{micro} -Release: 1jpp_11fc +Release: 1jpp_12fc License: Eclipse Public License - v 1.0 (EPL) Group: Text Editors/Integrated Development Environments (IDE) URL: http://www.eclipse.org/cdt @@ -52,6 +52,7 @@ Patch4: %{name}-no-tests.patch Patch5: %{name}-dynamic-scannerinfo-ext.patch Patch6: %{name}-libhover-jar.patch Patch7: %{name}-mm-builder.patch +Patch8: %{name}-configuration.patch BuildRequires: eclipse-pde %if %{gcj_support} @@ -102,6 +103,7 @@ pushd autotools tar -xzf %{SOURCE1} %patch6 -p0 %patch7 -p0 +%patch8 -p0 popd # Upstream CVS includes random .so files. Let's remove them now. @@ -270,6 +272,12 @@ rm -rf ${RPM_BUILD_ROOT} %endif %changelog +* Mon Aug 21 2006 Jeff Johnston 3.1.0-1jpp_12fc +- Fix build special targets when project hasn't configured yet. +- Fix to fully reconfigure after configuration options change. +- Fix configuration problem whereby config.sub complains. +- Bugzilla 200000, 201270, 203440 + * Tue Aug 08 2006 Jeff Johnston 3.1.0-1jpp_11fc - Fix Build Special Targets bug when importing a CVS project and using ManagedMake Project Wizard.