automake
[Top][All Lists]
Advanced

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

Re: Building .so files only.


From: Stephen Torri
Subject: Re: Building .so files only.
Date: 31 Aug 2003 19:29:16 -0500

On Sun, 2003-08-31 at 16:22, Tom Howard wrote:
> > I'm not an expert so make sure you have a look at the other responses.
> >  They way I handles this in my project was to install the modules into the
> > pkglibdir and then had a post installation hook that would create a
> > symbolic link within the module directory to the .la file.
> 
> Here are the rules I use to achive this:
> 
> MODULES: xyz.la abc.la
> MODULEDIR: modules

I don't know how this works for you but I have the following so that I
can build the libraries I want as modules:


  # Backend Language Writer
  include $(top_srcdir)/Makefile.include

  modulesdir=$(pkglibdir)/backend_language
  modules_LTLIBRARIES = libC.la

Automake handles all the duties of building the modules. Libtool is used
to build a module with the flags (set in configure.ac, exported as a
Makefile symbol and incorporated into the <module_name>_LDFLAGS:

  MODULE_LDFLAGS="-export-dynamic -module -avoid-version"

So now all I got at this point was a .so and a .la file. Both were
installed. So now that leads us to your solution.

> install-exec-hook:
>       @if ! test -d $(datadir); then rm -f $(datadir); mkdir $(datadir); fi 
>       @if ! test -d $(pkgdatadir); then rm -f $(pkgdatadir); mkdir 
> $(pkgdatadir); 
> fi 
>       @if ! test -d $(MODULEDIR); then rm -f $(MODULEDIR); mkdir 
> $(MODULEDIR); fi 
I know that you are trying to clear out all the directories on
installation. I found that automake wanted to use pkglibdir instead. So
as you can see above I incorporated that into setting the destination
directory. So I find this unnecessary.

>       @list='$(MODULES)'; for p in $$list; do \
>         if test -f $(pkglibdir)/$$p; then \
>               ln -sf $(pkglibdir)/$$p $(MODULEDIR)/$$p; \
>         fi; \
>       done
Automake handled installation of the files find. So I am not going to 
try and break something that works. I get both .la and .so installed but
I changed your idea to do:

install-data-hook:
        @list='$(modules_LTLIBRARIES)'; for p in $$list; do \
                rm -f $(modulesdir)/$$p ; \
        done

modules_LTLIBRAIRES has a list of .la files. The very thing we do not
want permanently installed. So all I do is remove after the installation
is complete.

> uninstall-local:
>       @list='$(MODULES)'; for p in $$list; do \
>         rm -f $(MODULEDIR)/$$p; \
>       done

This was unnecessary since automake did a good job of removing both the
.so and .la files when they were installed. So I did not feel this was
necessary.

> 
> pkglib_LTLIBRARIES = \
> ANY_OTHER_LIBS_PKGLIBS \
> $(MODULES) 
> 
> This will cause xyz.la and abc.la to be installed/uninstalled into/from 
> $(pkgdatadir)/modules.

See my above comment about pkglibdir.

Thanks for the ideas Tom. I got want I wanted in the end. You helped me
remember the -avoid-version flag.

Stephen
-- 
Stephen Torri
GPG Key: http://www.cs.wustl.edu/~storri/storri.asc

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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