[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: custom install rules
From: |
Ralf Wildenhues |
Subject: |
Re: custom install rules |
Date: |
Thu, 8 Feb 2007 12:53:29 +0100 |
User-agent: |
Mutt/1.5.13 (2007-02-07) |
* Christian Parpart wrote on Thu, Feb 08, 2007 at 10:45:13AM CET:
> 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?
> lib_LTLIBRARIES = libfoo.la
> libfoo_la_SOURCES = libfoo.cpp
> 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
Almost. It should be
fooplug_LIBTOOLFLAGS = --tag=disable-static
instead. The *_LIBTOOLFLAGS is like other per-target flags such as
*_LDFLAGS; the only difference is that it comes earlier on the libtool
command line, and that it is used for compile mode (and other modes) as
well; for example --silent can be put in there.
> 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?
Hmm. Whenever no per-target flags are given, AM_LIBTOOLFLAGS will be
used. Depending on whether most of your LTLIBRARIES are modules or not,
you could set AM_LIBTOOLFLAGS and override for the non-modules, in the
example above by setting `libfoo_la_LIBTOOLFLAGS ='.
Of course you can also AC_SUBST()itute the *_LIBTOOLFLAGS variables from
configure.ac, but I guess that won't save you from getting all their
names right.
> Although, I never played with targets yet, i'm quite new to them though :)
Well, you've already used per-target LDFLAGS.
> > 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?
Well, if only for the simple reason that if you (or another software
that would like to use your modules) also use libltdl's lt_dlopen, it
needs these files in general.
Hope that helps.
Cheers,
Ralf