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

1

5

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'?

Delastre answered 15/4, 2011 at 2:8 Comment(0)
U
8

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.

Ungainly answered 15/4, 2011 at 9:18 Comment(2)
Mailing list reference: lists.gnu.org/archive/html/automake/2004-05/msg00106.htmlTriiodomethane
Also, it needs to be noted that the library with .so extension can be found in the .libs directory. When you do make install the .so library is installed together with the .la library.Header

© 2022 - 2024 — McMap. All rights reserved.