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 > module.la 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 (module.la) 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: name=mymodule eval `./libtool --config|grep '^libname_spec='|sed -e 's/^libname_spec/libname/' Notice that additional steps are required to completely expand library_names_spec. Bob ====================================== Bob Friesenhahn [EMAIL PROTECTED] http://www.simplesystems.org/users/bfriesen _______________________________________________ Libtool mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/libtool
