In case you don't want to mess with individual .o files, you can also use ExtUtils::MakeMakers's MYEXTLIB option to link against a static library (aka archive, thus extension .a), but you do need such a static library version of whatever secondary library dependencies you want to link the module's .so file against — a shared library (.so) file won't do.
As with OBJECT (suggested by Joost), you'd simply add MYEXTLIB => '/path/to/lib/foo/libfoo.a' (or MYEXTLIB => '/path/to/lib/foo/libfoo$(LIB_EXT)') to the WriteMakefile( ... ) options. That's essentially it.
During the make run, you should then see something like this (assuming your Perl/XS module is named MyFoo, which depends on libfoo...):
cc -shared MyFoo.o -o blib/arch/auto/MyFoo/MyFoo.so /path/to/lib/foo/l +ibfoo.a
This command creates a shared library MyFoo.so from the object file MyFoo.o and the other object files contained in libfoo.a (an archive is nothing but a collection of object files). In other words, your MyFoo.so is then statically linked against libfoo.
If all else fails, you can also edit the Makefile that's written by MakeMaker to issue something similar to the above command line (but keep in mind that any modifications will be lost when you rerun MakeMaker...)
In reply to Re: Real Static Modules
by almut
in thread Real Static Modules
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |