automake
[Top][All Lists]
Advanced

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

Re: custom install rules


From: Christian Parpart
Subject: Re: custom install rules
Date: Thu, 8 Feb 2007 10:45:13 +0100
User-agent: KMail/1.9.6

On Thursday 08 February 2007 09:29:13 Ralf Wildenhues wrote:
> Hello Christian,
>
> * Christian Parpart wrote on Thu, Feb 08, 2007 at 07:18:18AM CET:
> > I'd like to install some plugins, that usually do not need any .la or .a
> > files to be installed (and even compiled).
>
> Use the `install-exec-local' target to extend Automake's install rules,
> don't override the `install' target.

thanks.

> If you use Automake-1.10, you could use
>   AM_LIBTOOLFLAGS = --tag=disable-static
> to avoid creating non-PIC objects and archives; similarly
> target_LIBTOOLFLAGS if you have other targets in the directory that do
> not want this tag.  This --tag is not yet documented by Libtool, because
> we weren't sure whether it's portable/functional enough.  But I think it
> works pretty ok.  

hm... okay, so assuming I've too DSOs in a directory, one shared library 
(libfoo.so) and a plugin (fooplug.so), how would the rules then look like?

# ------------------------------------------------------------------

## shared library: libfoo.so / libfoo.a
lib_LTLIBRARIES = libfoo.la

libfoo_la_SOURCES = libfoo.cpp

## plugin: fooplug.so

fooplugsdir = @libexecdir@/fooplugs
fooplugs_LTLIBRARIES = fooplug.la
fooplugs_LIBTOOLFLAGS = --tag=disable-static

fooplug_la_SOURCES = fooplug.cpp
fooplug_la_LDFLAGS = -module -avoid-version -no-undefined
# ------------------------------------------------------------------

That is, the libfoo is compiled/installed for dynamic and static use
and fooplug is compiled/installed for being loaded at runtime ONLY (a plugin).

Is this the proper way to do it then?

But is there also a way to define fooplugs_LIBTOOLFLAGS somewhere
in configure.ac, so, that - in case you're having a rather big project - you 
don't need to define the libtool flags for this "target" everytime?

Although, I never played with targets yet, i'm quite new to them though :)

> Of course, if your whole package wants only shared 
> libs, and you haven't prepared for preloaded modules anyway, then you
> should rather put AC_DISABLE_STATIC in configure.ac.

> >         rm $(DESTDIR)${chatplugindir}/$${lafile/.la/.a}; \
>
> The shell syntax `${foo/regex/sub}' is a bash extension not available
> in other shells.  A more portable way to write this which would be XSI
> conformant would be `${foo%.la}.a'.  But first, with above hint you
> won't need this line, second you may still run afoul of breaking your
> installation on AIX, where shared libraries may end in `.a', or w32,
> where static libraries may end in `.lib'.  The `old_library' setting
> in the .la file tells you the right name if any.

thanks.

> Further, I should be advising against removing installed .la files.
> While they may not help you much, they are usually of more help to
> users that install software below nonstandard locations.

for shared libraries I do totally agree, but how could they help for dso's 
that are dlopen()'d only?

Regards,
Christian Parpart.

Attachment: pgpN4I3DbA7zz.pgp
Description: PGP signature


reply via email to

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