[Libosinfo] [libosinfo 2/2] build: add libraries via _LIBADD, not _LDFLAGS

Daniel P. Berrange berrange at redhat.com
Wed Dec 18 15:22:13 UTC 2013


On Wed, Dec 18, 2013 at 04:18:45PM +0100, Christophe Fergeau wrote:
> From: Ryan Lortie <desrt at desrt.ca>
> 
> Make sure we use the _LIBADD variable for adding our dependencies.
> 
> Adding libraries via _LDFLAGS means that we have our libraries appearing
> before the user's LDFLAGS environment variable, which is bad, because
> the LDFLAGS from pkg-config could contain -L for system paths and
> jhbuild sets LDFLAGS to -L${prefix}/lib so that we can find the
> libraries in the user's jhbuild install path.  If the system path flags
> come before the user's directory then we'll get the wrong version.
> 
> Also: automake documentation says it's wrong and would actually error
> out on this if it wasn't hidden behind a variable substitution.
> 
> https://fedorahosted.org/libosinfo/ticket/12
> ---
>  osinfo/Makefile.am | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/osinfo/Makefile.am b/osinfo/Makefile.am
> index 20b6a02..21c69e4 100644
> --- a/osinfo/Makefile.am
> +++ b/osinfo/Makefile.am
> @@ -39,12 +39,14 @@ libosinfo_1_0_la_CFLAGS = \
>  	-DLOCALEDIR="\"$(datadir)/locale\"" \
>  	$(NULL)
>  
> -libosinfo_1_0_la_LDFLAGS = \
> -	$(COVERAGE_LDFLAGS) \
> +libosinfo_1_0_la_LIBADD = \
>  	$(LIBXML_LIBS) \
>  	$(LIBXSLT_LIBS) \
>  	$(GOBJECT_LIBS) \
> -	$(GIO_LIBS) \
> +	$(GIO_LIBS)
> +
> +libosinfo_1_0_la_LDFLAGS = \
> +	$(COVERAGE_LDFLAGS) \
>  	$(VERSION_SCRIPT_FLAGS)$(LIBOSINFO_VERSION_FILE) \
>          -version-info $(LIBOSINFO_VERSION_INFO) \
>  	$(NO_UNDEFINED_FLAGS)


ACK matches what we do for libvirt


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the Libosinfo mailing list