Linking a Plugin with static libraries

Ned Konz ned at bike-nomad.com
Thu Jun 5 03:08:17 UTC 2003


On Wednesday 04 June 2003 07:37 pm, Eddie Cottongim wrote:
>  I have a plugin with
> primitive methods. They call functions in external libraries
> (.lib). I have the external libraries.
>
> How do I get these linked properly? Do I have to alter the
> interpreter makefile? Is there a directive that will get VMMaker to
> help me? I attempted to build the plugin alone and couldn't figure
> it out (lots of undefined symbols). I have made approximately zero
> progress on this.

Hi Eddie,

Look at the Spread Plugin package I have on SqueakMap.

I had to add a little acinclude.m4 file so that configure would check 
for the library I was linking with.

so platforms/unix/plugins/SpreadPlugin/acinclude.m4 reads:

AC_PLUGIN_CHECK_LIB(sp,SP_connect)

I believe that's sufficient. After adding that, you have to do a make 
in the config directory, followed by a normal build cycle.

That will check for libsp in configure, and make sure that it has an 
entry point named SP_connect, and then add that library to the 
appropriate Makefile.

I *think* you'll have to do one of these for each platform you want to 
port to in the platform tree.

You can also put a Makefile fragment (as I recall) into the directory; 
this will be copied into the master Makefile.

Call it Makefile.inc and put it into the same directory as the 
acinclude.m4.

For instance, the DropPlugin (which uses the FilePlugin) has in the 
file platforms/unix/plugins/DropPlugin/Makefile.inc

XCPPFLAGS=	-I$(topdir)/platforms/Cross/plugins/FilePlugin

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list