Supporting a new compiler
Posted: Tue Nov 17, 2009 10:36 am
Hi,
I'm beating on codelite (1.0.3034 on mswdws) some to support a new language ( cobra ).
I chose codeLite because it looked like it had some support for (editing) multiple languages ( and allowed extending support for that) and used a generic make based build system that was
configurable. I dont want/intend to get into hacking IDE src files and rebuilding unless theres no alternative (IDEs) to use and theres no other alternative.
Its gone reasonably well - got project support (unfortunately not via makefiles) and syntax coloring working but of course I have some questions .
- hope someone somewhere thinks they're worth of answering.
From the most general to the specific:
Generally where are you thinking of heading with IDE support for languages other than C/C++?
Do you anticipate codeLite to be a generally good base for an IDE supporting other langs as first class citizens or are you focussing mostly on C/C++
but allowing whatever can be supported with the use of the Scite Editor component and exposure of some of the config settings as config XML files ?
I'm thinking (over and above building) of such things as adding/exposing (Doccing) hooks for providing own language integration of such things as tags/cscope equivalents, completion,
builder wizards, ...
The current core build setup (through building and running a makefile) seems pretty well configurable for languages that have the traditional 2-3 stage build construction
(preprocess-> compile -> link: src -> src -> object -> executable), Unfortunately I couldnt get it to work that way (or find a way for it to work that way) for a
single step compile+link: srcs ->executable (which is what cobra does (cf c# and java)).
SFAICT this is mostly due to the internal build of the makefiles always making rules to turn srcfiles into objects then linking the .o's together.
Does codeLite have a way of configuring the built makefile like this already ??
That is a dependency rule for an executable on a single step compile srcs -> executable
e.g.
( If so I just couldnt find it).
If not is their any likelihood/interest of getting some s/w config knob to tell codeLite to make a 1 step srcs-to-executable rule in the makefile ( using $(CompilerTool) and associates)
rather than the current inbuilt 2 stage one?
I got the build to work using the Custom Build settings config but that relies on the language compiler being able to do any dependency checking which would be a reason for using
a makefile in the first place and it relies on some other mechanism to pass to the compiler its files build list to compile.
The cobra compiler fortunately has such a mechanism but it imposes some extra overhead on the IDE user to create and manage such a list (presumably duplicating what CodeLite is doing).
This seems to come down to not having a codeLite build macro ( like $(FileNamePath), $(FileName)) that provides a list of all the sourcefiles that the IDE has in its project
($(ProjectSourceFiles), $(SourceFiles), ...)
Is there such a macro already that I may have missed ?
Another possibility is ( since such a compiler can be considered a build tool in its own right) would be to allow a way of specifying a different ( non (gnu)make) build tool in the
SettingsMenu /BuildSettings -> Build Systems dialog. Unfortunately that doesnt work:
The only build system (saved) is gnu Makefile for g++/gnuc, you can override some of the settings used ( like the exact tool and switches ) in the dialog BUT the expansion of the CodeLite info passed to the build system execution is exactly oriented to (gnu) make and that doesnt seem to be configurable (either user or via XML/config file) ?
This causes two problems:
the first is that a -j <something> switch is always passed (even if you specify a 1 (or unlimited) for number of concurrent jobs) - I couldnt find a suppression mechanism for that
secondly it always passes a makefile name of (project_wsp.mk or somesuch ) and thats all - this is of little use for a build tool that wants a file list on the command line or as a build-list-file.
Is there some other way/somewhere else to specify the build System to use, thats not oriented around a make commandline syntax ?
If not is it possible/likely that the buildtool invocation could/can be modified to be allowed to be a little more generic
(e.g. dialog that allows config of a makefile invocation line (like now except you can suppress -j) plus an alternative that allows you to specify all of
build tool, switches, src file list to pass and a storage mechanism for such settings, or even a template in a user accessable XML file somewhere) ?
This could also be applicable to integration with other src consuming tools that arent buildtools ( e.g. interpreters ( for C anyway), prettyprinters, src analysers, policy checkers/enforcers, ....)
---
For the project Templates can you specify/add a new category for the project Template to reside in?
( I'd like to gang all the cobra language templates together rather than hanging them under User Templates).
I thought it might autodetect/create on a new category name but they were then ignored - Is there any way of doing that currently or are the categories hardwired somewhere ? (where?)
I've noticed in a couple of places you are expected to supply language specific things ( like filenames in file dialogs) the entries are constrained to allFiles or c/C++.
could that be configured specific to the language using or relaxed so can specify a wildcard glob pattern ( *.cobra ) ?
Would you be interested in a list of places where something similar is the case (wired to C/C++)?
In the Output View,Tasks tab how do you permanently configure the TODO/FIXME etc search patterns; with a cobra project nothing happens on pressing those buttons and the
configure button puts you in a find dialog that fills the FindResults tab ?
Naturally with supporting a non C++ language in a C++ focused IDE theres a whole lot of things that arent applicable - fortunately codeLite can be tweaked to suppress or hide those items (toolbars and plugins). Where does it store those settings to use on reload ?
Finally (for the moment anyway . I realise some of the above may come across as a bit negative, Its not intended so.
I was pleasantly surprised by how rapidly it was possible to support to a reasonable level a different language with a different build paradigm from C/C++ in codeLite,
I was unpleasantly surprised that it wasnt possible to do it in the (first two ) most obvious ways ( to me anyway) detailed above (makefile, buildtool).
Generally codeLite seems an excellent piece of software well oriented to C/C++ development - it just seems to me it has some curious (and small) blind spots wrt supporting additional
languages pretty seamlessly (buts its almost got it for much/most of the desirable capability).
(finally finally). Similarly to many Open source projects You need a whole lot more doc content on the website
using, configuring (my interest at the moment), Developing( building, code layout, content map,..).
When I get what I'm doing to some level of usefulness I'll be posting config and mod description to the cobra website
- would you like the same and perhaps a description of what I ended up doing to codeLite to support a different language (edit and builds) ??
Cheers
-- hops
I'm beating on codelite (1.0.3034 on mswdws) some to support a new language ( cobra ).
I chose codeLite because it looked like it had some support for (editing) multiple languages ( and allowed extending support for that) and used a generic make based build system that was
configurable. I dont want/intend to get into hacking IDE src files and rebuilding unless theres no alternative (IDEs) to use and theres no other alternative.
Its gone reasonably well - got project support (unfortunately not via makefiles) and syntax coloring working but of course I have some questions .
- hope someone somewhere thinks they're worth of answering.
From the most general to the specific:
Generally where are you thinking of heading with IDE support for languages other than C/C++?
Do you anticipate codeLite to be a generally good base for an IDE supporting other langs as first class citizens or are you focussing mostly on C/C++
but allowing whatever can be supported with the use of the Scite Editor component and exposure of some of the config settings as config XML files ?
I'm thinking (over and above building) of such things as adding/exposing (Doccing) hooks for providing own language integration of such things as tags/cscope equivalents, completion,
builder wizards, ...
The current core build setup (through building and running a makefile) seems pretty well configurable for languages that have the traditional 2-3 stage build construction
(preprocess-> compile -> link: src -> src -> object -> executable), Unfortunately I couldnt get it to work that way (or find a way for it to work that way) for a
single step compile+link: srcs ->executable (which is what cobra does (cf c# and java)).
SFAICT this is mostly due to the internal build of the makefiles always making rules to turn srcfiles into objects then linking the .o's together.
Does codeLite have a way of configuring the built makefile like this already ??
That is a dependency rule for an executable on a single step compile srcs -> executable
e.g.
Code: Select all
(OutputFile): $(Srcs)
$(CompilerName) $(OutputSwitch)$(OutputFile) $(SourceSwitch) $(CmpOptions) $(Srcs)
If not is their any likelihood/interest of getting some s/w config knob to tell codeLite to make a 1 step srcs-to-executable rule in the makefile ( using $(CompilerTool) and associates)
rather than the current inbuilt 2 stage one?
I got the build to work using the Custom Build settings config but that relies on the language compiler being able to do any dependency checking which would be a reason for using
a makefile in the first place and it relies on some other mechanism to pass to the compiler its files build list to compile.
The cobra compiler fortunately has such a mechanism but it imposes some extra overhead on the IDE user to create and manage such a list (presumably duplicating what CodeLite is doing).
This seems to come down to not having a codeLite build macro ( like $(FileNamePath), $(FileName)) that provides a list of all the sourcefiles that the IDE has in its project
($(ProjectSourceFiles), $(SourceFiles), ...)
Is there such a macro already that I may have missed ?
Another possibility is ( since such a compiler can be considered a build tool in its own right) would be to allow a way of specifying a different ( non (gnu)make) build tool in the
SettingsMenu /BuildSettings -> Build Systems dialog. Unfortunately that doesnt work:
The only build system (saved) is gnu Makefile for g++/gnuc, you can override some of the settings used ( like the exact tool and switches ) in the dialog BUT the expansion of the CodeLite info passed to the build system execution is exactly oriented to (gnu) make and that doesnt seem to be configurable (either user or via XML/config file) ?
This causes two problems:
the first is that a -j <something> switch is always passed (even if you specify a 1 (or unlimited) for number of concurrent jobs) - I couldnt find a suppression mechanism for that
secondly it always passes a makefile name of (project_wsp.mk or somesuch ) and thats all - this is of little use for a build tool that wants a file list on the command line or as a build-list-file.
Is there some other way/somewhere else to specify the build System to use, thats not oriented around a make commandline syntax ?
If not is it possible/likely that the buildtool invocation could/can be modified to be allowed to be a little more generic
(e.g. dialog that allows config of a makefile invocation line (like now except you can suppress -j) plus an alternative that allows you to specify all of
build tool, switches, src file list to pass and a storage mechanism for such settings, or even a template in a user accessable XML file somewhere) ?
This could also be applicable to integration with other src consuming tools that arent buildtools ( e.g. interpreters ( for C anyway), prettyprinters, src analysers, policy checkers/enforcers, ....)
---
For the project Templates can you specify/add a new category for the project Template to reside in?
( I'd like to gang all the cobra language templates together rather than hanging them under User Templates).
I thought it might autodetect/create on a new category name but they were then ignored - Is there any way of doing that currently or are the categories hardwired somewhere ? (where?)
I've noticed in a couple of places you are expected to supply language specific things ( like filenames in file dialogs) the entries are constrained to allFiles or c/C++.
could that be configured specific to the language using or relaxed so can specify a wildcard glob pattern ( *.cobra ) ?
Would you be interested in a list of places where something similar is the case (wired to C/C++)?
In the Output View,Tasks tab how do you permanently configure the TODO/FIXME etc search patterns; with a cobra project nothing happens on pressing those buttons and the
configure button puts you in a find dialog that fills the FindResults tab ?
Naturally with supporting a non C++ language in a C++ focused IDE theres a whole lot of things that arent applicable - fortunately codeLite can be tweaked to suppress or hide those items (toolbars and plugins). Where does it store those settings to use on reload ?
Finally (for the moment anyway . I realise some of the above may come across as a bit negative, Its not intended so.
I was pleasantly surprised by how rapidly it was possible to support to a reasonable level a different language with a different build paradigm from C/C++ in codeLite,
I was unpleasantly surprised that it wasnt possible to do it in the (first two ) most obvious ways ( to me anyway) detailed above (makefile, buildtool).
Generally codeLite seems an excellent piece of software well oriented to C/C++ development - it just seems to me it has some curious (and small) blind spots wrt supporting additional
languages pretty seamlessly (buts its almost got it for much/most of the desirable capability).
(finally finally). Similarly to many Open source projects You need a whole lot more doc content on the website
using, configuring (my interest at the moment), Developing( building, code layout, content map,..).
When I get what I'm doing to some level of usefulness I'll be posting config and mod description to the cobra website
- would you like the same and perhaps a description of what I ended up doing to codeLite to support a different language (edit and builds) ??
Cheers
-- hops