Page 1 of 1

A tailbite / polink / polib question!

Posted: Wed Nov 14, 2007 1:18 pm
by srod
Hi,

Something about Tailbite is puzzling me a little. I will pick on Gnozal's PureZIP user library as an example as I know it imports an external library : ZLIB in this case. I guess really I should direct this query straight at Gnozal, but I thought others might be intersted in this as well. :)

If I use Tailbite to create a user library and (like PureZIP) I import functions from an external library (e.g. ZLIB) then it seems clear that I do NOT need to ship the external library (ZLIB) along with my resulting user library.

If this is correct, then I am puzzling over 'who' has grabbed the code from the external library and placed it within the Purebasic user library? Is it POLINK or Tailbite or POLIB (via LibraryMaker.exe) ? I am puzzled because I didn't think that POLINK would be involved when creating user libraries.

The reason I ask is that I'm thinking of creating a user library which will need to import functions from an external library and I just need to know where I stand with this?

Thanks.

Re: A tailbite / polink / polib question!

Posted: Wed Nov 14, 2007 3:38 pm
by gnozal
srod wrote:If I use Tailbite to create a user library and (like PureZIP) I import functions from an external library (e.g. ZLIB) then it seems clear that I do NOT need to ship the external library (ZLIB) along with my resulting user library.
yes
srod wrote:If this is correct, then I am puzzling over 'who' has grabbed the code from the external library and placed it within the Purebasic user library? Is it POLINK or Tailbite or POLIB (via LibraryMaker.exe) ?
I would say it's the linker, but I may be wrong.

Posted: Wed Nov 14, 2007 3:52 pm
by srod
Hi Gnozal,

thanks for the reply.

Is the linker even involved when creating user libraries via Tailbite? POLINK, I believe, can only create exe's or dll's. Must admit, if it is not Tailbite itself grabbing the code from the external libraries, then I suspect it to be POLIB.

Still, at least you've confirmed that I need not ship the external .lib as well as my user library. :)

Posted: Wed Nov 14, 2007 4:14 pm
by gnozal
srod wrote:Hi Gnozal,

thanks for the reply.

Is the linker even involved when creating user libraries via Tailbite? POLINK, I believe, can only create exe's or dll's. Must admit, if it is not Tailbite itself grabbing the code from the external libraries, then I suspect it to be POLIB.
Hmm...
Think ... Think ... Think ... Think ...
I think it works that way :
1. PBCOMPILER creates the EXE (using POLINK) that we don't need, but also the ASM file (/COMMENTED)
2. TAILBITE grabs the ASM file, splits it, rewrites some parts
3. FASM compiles the ASM files created by tailbite to OBJ
4. POLIB creates the LIB library from the *.OBJ files
5. LibraryMaker creates userlibrary from the LIB file
It's a team play :wink:
So it's probably more POLIB than POLINK ...

Posted: Wed Nov 14, 2007 4:32 pm
by srod
I wonder then if Tailbite is placing the name of the external .lib referenced in the Import / EndImport in the .desc file? There is something telling POLIB or LibraryMaker.exe to include some of the .obj (if not all of them) from the external .lib in the resulting library.

Ah, fascinating stuff! :)