Hi everyone,

This is dynis from #netsurf, one of your GSoC prospects. After deciding to move the core code for the project into a shared library, I realized that the first step would be deciding how the compiling and linking process would occur.

I just wrote this--the attached file--as a small example of how we might link in a library using the Makefile and Makefile.sources that existing code is all ready dependent upon*. The goal of this example was to setup a directory structure similar to that of NetSurf, alter the Makefile to compile the core functions as a shared library, and then link this library to the resulting binary application. This provides a good reference for the direction I'm going in and allows time for any developer input before we begin acting on actual project code.

* These files were stripped of most non-essential code to make the example more clear, including but not limited to all Risc OS specific code--since I'm compiling under linux.

In the archive you'll find two directories, nsexample/ and libnsexample/. The former contains a Makefile and Makefile.sources that compile in similar fashion to NetSurf by linking all the object files together. The latter is an altered version of the Makefile and Makefile.sources to compile the functions as a shared library, install the library, and link it to main.o when creating the resulting executable.

Currently the library is installed in /usr/lib and ldconfig is run afterward; this requires running make as root. rjek has suggested that the library location should be configurable and perhaps using libtool will assist us in making a proper, platform-independent library. These points are well-taken and I'll be reading the libtool docs as soon as possible.

If anyone has input please respond here on the mailing list or chat with me in #netsurf under the nick 'dynis'.

Regards,

dyn

Attachment: nsexample.tar.gz
Description: GNU Zip compressed data

Reply via email to