Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Add a custom toolchain to the Autotools CDT plugin

Hello Jeff,

Le 06/03/2013 23:16, Jeff Johnston a écrit :
Hmm, from your first snapshot, you are not creating a GNU Autotools
project with your toolchain.  Instead, you are creating a Managed Make
project (Executable) with your toolchain added.

Sorry I gave a bad link, the good screenshot showing that I contribute the toolchain to the Autotools project type is this one [1].

If you look in org.eclipse.cdt.autotools.ui plugin.xml, you can see the
menu, command, and handler specifications.  You can also try and see if
any of the handlers get invoked and if they fail or have their enabled
state marked false.

It seems that the popupmenus extension does not work properly in my case. Consequently and as the popupmenus extension is deprecated, you will find a patch attached that replace the popupmenus extension by the menus extension.

After applying th is patch, I am able to see the Autotools menus on my project which uses the Buildroot toolchain.

Now I still have to solve some problems on how to set the PATH environment variable and the --host option programmatically when the toolchain is selected.

Thanks again for your help,
Mélanie

[1]http://bit.ly/WYgkmG
>From f22a076dd61c112a74b8e075336e788abb81c177 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9lanie=20Bats?= <melanie.bats@xxxxxxx>
Date: Thu, 7 Mar 2013 22:40:55 +0100
Subject: [PATCH] Replace the deprecated popupmenus extension by using the
 menus extension

---
 build/org.eclipse.cdt.autotools.ui/plugin.xml |  160 ++++++++++++-------------
 1 file changed, 74 insertions(+), 86 deletions(-)

diff --git a/build/org.eclipse.cdt.autotools.ui/plugin.xml b/build/org.eclipse.cdt.autotools.ui/plugin.xml
index 9413f67..9fb0b81 100644
--- a/build/org.eclipse.cdt.autotools.ui/plugin.xml
+++ b/build/org.eclipse.cdt.autotools.ui/plugin.xml
@@ -50,92 +50,6 @@
   </extension> 
   -->
    <extension
-         point="org.eclipse.ui.menus">
-      <menuContribution
-            locationURI="popup:org.eclipse.ui.popup.any?before=additions">
-         <separator
-               name="autotoolsGroup"
-               visible="true">
-         </separator>
-      </menuContribution>
-   </extension>
-   <extension
-         id="org.eclipse.cdt.autotools.ui.popup1"
-         point="org.eclipse.ui.popupMenus">
-      <objectContribution
-            objectClass="org.eclipse.core.resources.IResource"
-            adaptable="true"
-            id="org.eclipse.cdt.autotools.ui.popupMenu.NavigatorContribution">
-         <action
-               class="org.eclipse.cdt.internal.autotools.ui.actions.InvokeLibtoolizeAction"
-               enablesFor="1"
-               id="org.eclipse.cdt.autotools.ui.action.libtoolize1"
-               label="%InvokeLibtoolize.label"
-               menubarPath="org.eclipse.cdt.autotools.ui.invokeAutotools1/gm1">
-         </action>
-         <action
-               class="org.eclipse.cdt.internal.autotools.ui.actions.InvokeAutoheaderAction"
-               enablesFor="1"
-               id="org.eclipse.cdt.autotools.ui.action.autoheader1"
-               label="%InvokeAutoheader.label"
-               menubarPath="org.eclipse.cdt.autotools.ui.invokeAutotools1/gm1">
-         </action>
-         <action
-               class="org.eclipse.cdt.internal.autotools.ui.actions.InvokeAutoreconfAction"
-               enablesFor="1"
-               id="org.eclipse.cdt.autotools.ui.action.autoreconf1"
-               label="%InvokeAutoreconf.label"
-               menubarPath="org.eclipse.cdt.autotools.ui.invokeAutotools1/gm1">
-         </action>
-         <action
-               class="org.eclipse.cdt.internal.autotools.ui.actions.InvokeAutomakeAction"
-               enablesFor="1"
-               id="org.eclipse.cdt.autotools.ui.action.automake1"
-               label="%InvokeAutomake.label"
-               menubarPath="org.eclipse.cdt.autotools.ui.invokeAutotools1/gm1">
-         </action>
-         <action
-               class="org.eclipse.cdt.internal.autotools.ui.actions.InvokeAutoconfAction"
-               enablesFor="1"
-               id="org.eclipse.cdt.autotools.ui.action.autoconf1"
-               label="%InvokeAutoconf.label"
-               menubarPath="org.eclipse.cdt.autotools.ui.invokeAutotools1/gm1">
-         </action>
-         <action
-               class="org.eclipse.cdt.internal.autotools.ui.actions.InvokeAclocalAction"
-               enablesFor="1"
-               id="org.eclipse.cdt.autotools.ui.action.aclocal1"
-               label="%InvokeAclocal.label"
-               menubarPath="org.eclipse.cdt.autotools.ui.invokeAutotools1/gm1">
-         </action>
-          <menu
-               id="org.eclipse.cdt.autotools.ui.invokeAutotools1"
-               label="%InvokeAutotools.label"
-               path="autotoolsGroup">
-            <groupMarker
-                  name="gm1">
-            </groupMarker>
-         </menu>
-          <action
-                class="org.eclipse.cdt.internal.autotools.ui.actions.ReconfigureAction"
-                definitionId="org.eclipse.cdt.autotools.ui.command.reconfigure"
-                id="org.eclipse.cdt.autotools.ui.action.autoreconf1"
-                label="%Reconfigure.label"
-                menubarPath="autotoolsGroup">
-          </action>
-         <visibility>
-            <or>
-              <objectState
-                 name="projectNature"
-                 value="org.eclipse.cdt.autotools.core.autotoolsNatureV2"/>
-              <objectState
-                 name="projectNature"
-                 value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2"/>
-            </or>
-         </visibility>
-      </objectContribution>
-   </extension>
-   <extension
          point="org.eclipse.cdt.core.CBuildConsole">
       <CBuildConsole
             class="org.eclipse.cdt.internal.autotools.ui.CConfigureConsole"
@@ -844,4 +758,78 @@
              name="%Autotools.wizard.name">
        </wizard>
     </extension>
+         <extension
+          point="org.eclipse.ui.menus">
+       <menuContribution
+             allPopups="false"
+             locationURI="popup:org.eclipse.ui.popup.any?before=additions">
+          <separator
+                name="autotoolsGroup"
+                visible="true">
+          </separator>
+          <menu
+                label="%InvokeAutotools.label">
+             <visibleWhen
+                   checkEnabled="false">
+                <iterate
+                      operator="and">
+                   <or>
+                      <test
+                            property="org.eclipse.core.resources.projectNature"
+                            value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
+                      </test>
+                      <test
+                            property="org.eclipse.core.resources.projectNature"
+                            value="org.eclipse.cdt.autotools.core.autotoolsNatureV2">
+                      </test>
+                   </or>
+                </iterate>
+             </visibleWhen>
+             <command
+                   commandId="org.eclipse.cdt.autotools.ui.command.aclocal"
+                   style="push">
+             </command>
+             <command
+                   commandId="org.eclipse.cdt.autotools.ui.command.autoconf"
+                   style="push">
+             </command>
+             <command
+                   commandId="org.eclipse.cdt.autotools.ui.command.automake"
+                   style="push">
+             </command>
+             <command
+                   commandId="org.eclipse.cdt.autotools.ui.command.autoreconf"
+                   style="push">
+             </command>
+             <command
+                   commandId="org.eclipse.cdt.autotools.ui.command.autoheader"
+                   style="push">
+             </command>
+             <command
+                   commandId="org.eclipse.cdt.autotools.ui.command.libtoolize"
+                   style="push">
+             </command>
+          </menu>
+          <command
+                commandId="org.eclipse.cdt.autotools.ui.command.reconfigure"
+                style="push">
+             <visibleWhen
+                   checkEnabled="false">
+                <iterate
+                      operator="and">
+                   <or>
+                      <test
+                            property="org.eclipse.core.resources.projectNature"
+                            value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
+                      </test>
+                      <test
+                            property="org.eclipse.core.resources.projectNature"
+                            value="org.eclipse.cdt.autotools.core.autotoolsNatureV2">
+                      </test>
+                   </or>
+                </iterate>
+             </visibleWhen>
+          </command>
+       </menuContribution>
+    </extension>
 </plugin>
-- 
1.7.9.5


Back to the top