Hi Igor, #configureFT2Plugin: is the place for #addExternalLibraries: but it only works for FT2Plugin compiled as internal plugin. To compile the FT2Plugin as external, you also have to use #addExternalLibraries: #('freetype') but not sent from #configureFT2Plugin:. It is because of cmake and where #configurePlugin:with: is sent from the #generate method. in the #generate method, #configurePlugin:with: is sent **BEFORE** the 'add_library' cmd production for cmake. it is ok for internal plugin. but, if the plugin is external, then, #addExternalLibraries: #('freetype') has to be invoked **AFTER** the 'add_library' cmd production for cmake. I've implemented a #postConfigurePlugin:with:. same logic as #configurePlugin:with: but sent from the generate method after the 'add_library' cmd production. generate ... vmGen config configurePlugin: plugin with: self. ... internal ifTrue: [self cmd: 'add_library' params: name , ' STATIC ${sources}'.] ifFalse: [self cmd: 'add_library' params: name , ' SHARED ${sources}']. vmGen config postConfigurePlugin: plugin with: self. "added post configuration here" ... I will open an issue and put all my stuffs there. Cheers Alain Le 02/06/2011 13:16, Igor Stasenko a écrit :
Add following to CogFamilyUnixConfig>>configureFT2Plugin: gen "extra rules for FT2Plugin"
| generator |
generator := maker isExternal ifTrue: [ gen ] ifFalse: [ gen vmGenerator ].
generator addExternalLibraries: #( 'freetype' "freetype library" ).
This will force maker to link against freetype library. (actually i think better would be to override the #addExternalLibraries: in CMakePluginGenerator which will add libraries to vm generator, if plugin is internal. So in configureXYZPlugin: , you can just write:
gen addExternalLibraries: #( .. ) without testing if plugin is internal or external.
as a second step, I will come back to the compiling of FT2Plugin as an external plugin.
Cheers Alain
02/06/2011 02:59, Schwab,Wilhelm K a écrit :
Alain,
Sig's answer leaves me doubting my suspicion, but I will toss it out anyway, and since you are building a vm, you can pretty easily run through the exercise.
First, the question: what (full path) library is the vm trying to load? It really is a plugin, so some of my more common concerns (extra slashes in the path, so.Name instead of libName.so, etc., go away - or do they??).
Sadly, I don't see the code I want to give you on this machine. Maybe my laptop will have some friendly symlinks to the tweaked files. In short, I think that any time the (particularly linux) vm translates a number to to a name or a name to a path, and the subsequent load fails, it should say something somewhere about what it tried to open/load. I have used syslog() to good effect. It's nice because the logs rotate, giving some time for the user to look for it and yet not clog the drive with old news.
Ok; I'll shut up and see if I can find some code for you :)
Bill
________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Alain Plantec [alain.plantec@yahoo.com] Sent: Wednesday, June 01, 2011 2:00 PM To: pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Compiling and using the FT2Plugin
Le 01/06/2011 19:46, Igor Stasenko a écrit :
On 1 June 2011 19:20, Alain Plantec<alain.plantec@yahoo.com> wrote:
Hi all, I try to build my own vm (ubuntu 10.04, virtualbox) Thanks to the **excellent** Mariano blog, I can compile, it runs ok except the FT2Plugin I always have the following error message while trying to load fonts:
ioLoadModule(libFT2Plugin.so): libFT2Plugin.so: cannot open shared object file: No such file or directory
I guess that it is because the plugin is unable to load libfreetype.so. does someone know what I am missing ?
i know. ;)
i wanna add a correct settings for building this plugin on all platforms. so we can ship a vm with this plugin by default. But i haven't time to do it yet. So, if you find a solution how to do it for unix, i will capture your knowledge in corresponding config(s) :) ahhhhh! thanks Igor I'm not so stupid, its a problem :) ok, I will try Cheers Alain
thanks Alain