[Buildroot] [PATCH v1] collectd: fix postgresql library detection

Peter Seiderer ps.report at gmx.net
Tue Mar 17 22:17:04 UTC 2015


Hello Thomas,

> Gesendet: Dienstag, 17. März 2015 um 22:58 Uhr
> Von: "Thomas Petazzoni" <thomas.petazzoni at free-electrons.com>
> An: "Peter Seiderer" <ps.report at gmx.net>
> Cc: buildroot at busybox.net
> Betreff: Re: [Buildroot] [PATCH v1] collectd: fix postgresql library detection
>
> Dear Peter Seiderer,
> 
> On Tue, 17 Mar 2015 22:44:05 +0100, Peter Seiderer wrote:
> 
> >  ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
> >  	COLLECTD_CONF_OPTS += --with-libpq=$(STAGING_DIR)/usr/bin/pg_config
> > +	COLLECTD_CONF_ENV = LIBS="-lpthread -lm"
> 
> If they are needed, why isn't pg_config returning those linker flags?
> 

Because pg_config only implements --includedir and --libdir:
    $ cat host/usr/sh4-buildroot-linux-uclibc/sysroot/usr/bin/pg_config
#!/bin/sh

#
# Minimal pg_config implementation as replacement for the native pg_config application
# Only implements --includedir and --libdir
#

prefix=/home/seiderer/BUildroot/build_sh_postgresql_collectd/host/usr/sh4-buildroot-linux-uclibc/sysroot/usr

case "$1" in
  --includedir)
        echo "$prefix/include"
        ;;
  --libdir)
        echo "$prefix/lib"
        ;;
  *)
        echo "Usage: $0 {--includedir|--libdir}"
esac


And collectd configure uses only this two options...

> I'm sorry to be annoying, but I really don't like adding LIBS variables
> all over the place, because they tend to become wrong/unneeded, and we
> never notice.

...suspected this argument, I am open for other suggestions, but I think
this aproach is the least invasive...

Regards,
Peter

> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>



More information about the buildroot mailing list