[Top][All Lists]

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

Re: Filename for module

From: Bob Friesenhahn
Subject: Re: Filename for module
Date: Fri, 26 Sep 2003 11:06:52 -0500 (CDT)

On Fri, 26 Sep 2003, Olleg wrote:

> I am working on a module for PostgreSQL. I module will be exist a
> function which register all other functions of the module. So I must
> already know filename of the module on stage of make module, before
> will be created. How can I get filename of my module on stage
> of configure?

If you choose to use libltdl to load your module (which PostgreSQL
probably does not), then you can rely on its ability to load an
installed ".la" file ( in order to find the actual module
name.  This is the preferred way to load modules since it handles all
the complexities for you.

Otherwise you could run libtool after configure has generated it to
see what it does.  You could build a fake module using libtool and
extract the naming scheme from the generated .la file.  You could also
execute 'libtool --config' to extract information.  Ultimately you
would want to extract enough information to expand the first argument
of the 'library_names_spec' variable.

Here is a way to convert a line of 'libtool -config' output into a
local shell variable (libname_spec --> $libname) using your base
module name:

eval `./libtool --config|grep '^libname_spec='|sed -e 's/^libname_spec/libname/'

Notice that additional steps are required to completely expand

Bob Friesenhahn

reply via email to

[Prev in Thread] Current Thread [Next in Thread]