Re: Creating Custom Library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 25, 2002 at 12:37:11PM +0530, Anjaneyulu wrote:
> Can anyone tell me the procedure for creating a custom library under linux?

For static library, just compile the sources, pack using ar and place
the resulting .a file somewhere linker can find it.

For dynamic library, compile with -fPIC option, then links with -dynamic
option and place the resulting .so file where linker and dynamic linker
can find it. Run ldconfig afterwards to have dynamic linker update it's
shared object cache. The actual object should have an extension .so.n,
where n is version of interface and a symlink with extension .so to it.
That way 2 versions can coexist, since the versioned file is used for
dynamic linking while the symlink is used for linking new ones.

You have to take care, that the name is recorded correctly in the file,
but I don't recall the exact rules. There is a libtool utility (in the
automake/autconf suite), that can take care of this on various systems.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux