[PD-dev] how to load shared code for libraries

IOhannes m zmölnig zmoelnig at iem.at
Sat Oct 29 16:26:16 CEST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/19/2011 01:29 AM, Hans-Christoph Steiner wrote:
> I committed the change to tkwidgets and the template/Makefile.
> 

i tried to use the new template/Makefile for this feature and noticed a
few issues:
- - object sources are called SOURCES, whereas shared sources are called
SHARED_SOURCE (singular); same goes for SHARED_HEADER
for consistency sake, i propose to use plural throughout.

- - the output name of the shared lib cannot be simply overridden (it
derives from the value of SHARED_SOURCE)

- - using multiple C-files for the shared code, doesn't really work: it
tries to create a shared library from each C-file (so if you
SHARED_SOURCE="foo.c bar.c", you will end up with both foo.so and
bar.so, and your objecctclass will link against all those.
it seems like you only used a "single C-file" library, but i guess a
number of libs will also want to use multiple C-files for building a
single library, which should then be linked to all objectclasses.
(this get's you all the features from creating a shared lib from each
SHARED_SOURCE file, and additionally allows the shared code to share
code with itself)

therefore i propose a few small amendments to template/Makefile:
- - rename SHARED_SOURCE to SHARED_SOURCES
- - rename SHARED_HEADER to SHARED_HEADERS
- - build all shared sources into a single library
- - as default name, use "lib$(LIBRARY).so" for this library
- - allow the user to easily override this name, if they want to


mdfgt
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6sDQYACgkQkX2Xpv6ydvQ0NwCfdueDX+0KTaI9sWqlf4c0oCjT
4r4AoLfBVdAVi2qryleXQEKFVomDDeZ/
=Nn0u
-----END PGP SIGNATURE-----



More information about the Pd-dev mailing list