Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do you make a .so library with autoconf, rather that a .la library?

I want to make a shared library with autoconf. However, I want the shared library to have a ".so" extension and not to begin with "lib". Basically, I want to make a plug-in that will get loaded with dlopen. Is there an easy way to do this?

When I try to create the .so file with autoconf, I get this error:

plugins/Makefile.am:3: scan_bulk.la' is not a standard libtool library name plugins/Makefile.am:3: did you meanlibscan_bulk.la'?

like image 300
vy32 Avatar asked Apr 15 '11 02:04

vy32


1 Answers

Use the -module flag. It goes something like this:

pkglib_LTLIBRARIES = scan_bulk.la
scan_bulk_la_LDFLAGS = -module -avoid-version -shared

The module flag indicates to the Autotools that this is supposed to be a plugin.

like image 101
ptomato Avatar answered Sep 28 '22 07:09

ptomato