There is now a version of coffIT for PB 4.4 (x86 only). The PB 4.4 generated ASM had changed ever so very slightly; enough to confuse the hell out of coffIT!
This is to be considered a test version at this moment in time as I have not had time to test it as much as I would like.
This new version adds support for all of PB 4.4's new data-types (when creating PB wrappers) including the new hash maps etc.
See the nxSoftware site for the download.
Tested with PB 4.41 RC1 only.
=====================================
26/05/2008.
coffIT is now compatible with PB 4.2. A certain alteration was required to keep pace with one alteration made to PB's generated ASM code.
The download link is in the second post of this thread.
=====================================
09/03/2008. Bugfix.
When creating a static .lib, coffIT (more precisely, Fasm!) would crash out if a 'Data' statement contained repeated addresses of the same procedure.
The download link is in the second post of this thread.
=====================================
04/03/2008. Update - coffIT 2.0 beta 1.
coffIT now offers MSCOFF .obj or MSCOFF static library (.lib) output formats.
I advise reading the relevant parts of the help manual regarding the choice of creating .obj or .lib files, because it is worth understanding how coffIT proceeds here as well as the reason why I would not necessarily suggest using .lib files!
The download link is in the second post of this thread.
=====================================
29/02/2008. Update - coffIT 1.0 beta 2.
In the event of a successful compilation, coffIT generated log files will now list all external functions / symbols required by the resulting .obj or .lib file etc.
This is useful when hoping to use your resulting static library in other programming languages etc.
This is on top of the coffIT generated Purebasic import wrappers which will list all Windows libraries required by the .lib etc.
The download link is in the second post of this thread.
=====================================
Hi,
introducing version 1 of coffIT, a tool for compiling PB source code programs to either MSCOFF object files (.obj) or static library files (.lib). (.lib files will be added for version 2 - most of the code is already in place for this.)
At this stage I am going to reproduce the first page of the coffIT help manual in order to give a little background etc. Static libraries can be a minefield for those new to the idea :
Of course Tailbite will create a static library from PB source, but Tailbite does not allow the developer to export variables from it's libraries etc. coffIT does this, -and more!Many programming languages allow the developer to create what are termed static libraries; compiled libraries which can be reused in many different projects and (dependencies allowing) across different programming languages.
This is a tried and tested and a very efficient means of reusing code, particularly useful in languages easily lending themselves to a 'modular' style of programming such as C and many Basic programming languages.
Indeed, many language compilers make extensive use of such libraries when building applications and allow the developer to add yet more such libraries to the language, effectively extending the range of commands available to that developer. Purebasic is one such language in which we can easily import libraries written in other languages into our applications through the use of the Import and EndImport statements. Thus our programs can use the same all encompassing libraries which the C programmer has taken for granted for many a year now!
However, whilst Purebasic allows the use of correctly formatted static libraries created in other languages, it does not explicitly allow us to create such libraries either for use in other Purebasic projects or indeed for use with other languages. The Purebasic compiler simply does not offer this facility to the end user, -at least not directly! Indeed, the system of libraries used by Purebasic when building applications is based upon it's own customised format which, whilst allowing for an increased ease of use, does ultimately mean that we can not use these libraries in other programming languages or indeed easily add libraries of our own.
And this is where coffIT comes in to play. It allows us to create standard MSCOFF object files and static libraries (static libs will be added in version 2) which can be used in other Purebasic projects and, dependencies on other libraries allowing, with other programming languages.
And all at the push of a button!
Features of coffIT include :
- Export variables, structures, arrays. Export all globals or just selected ones.
- Re-use assembly code files so that (advanced) programmers are free to make adjustments at the assembly code level to the static libraries etc.
- Create a Purebasic import wrapper which will ensure that all dependencies (user libraries, external libraries, system libraries etc.) are added to any executable making use of your static library etc.
Next question : can our static libs be used in other Purebasic applications? The answer is yes. The only problem is forcing Purebasic to add all the necessary user libs and other external libs when linking the final executable. This is far from a trivial concern, but is solved by coffIT by simply requesting that it creates a PB import wrapper when building your static lib. This import wrapper takes responsibility for 'tricking' Purebasic into passing all necessary dependencies to the linker when building the application's executable.
The help manual examines these problems quite thoroughly.
Continued in the next post...