[collectd] Yet another Solaris 10 patch: Runtime library path for postgresql plugin

Scott Severtson ssevertson at digitalmeasures.com
Wed May 30 17:36:17 CEST 2012


All,

Just added PostgreSQL plugin support to our Solaris 10 x64/GCC build, 
and discovered that the resulting postgresql.so library doesn't have a 
correctly configured runtime path.

# ldd postgresql.so
         libpq.so.5 =>    (file not found)
         libc.so.1 =>     /lib/64/libc.so.1
         libgcc_s.so.1 =>         /usr/sfw/lib/64/libgcc_s.so.1
         libm.so.2 =>     /lib/64/libm.so.2

I could just add an LDFLAGS environment variable including this path, 
but this would be applied to all plugins/binaries.

It appears that the autoconf script is building libpq's LDFLAGS based on 
the output of "pg_config --libs":

---
with_libpq_libdir=`$with_pg_config --libdir 2> /dev/null`
...
for dir in $with_libpq_libdir; do
     with_libpq_ldflags="$with_libpq_ldflags -L$dir"
done
---

Would it be harmful to other platforms to also add "-R$dir" to the 
generated LDFLAGS for this plugin? I've attached a patch against 5.1.0 
autoconf script which does so.

Thanks,
Scott Severtson
Chief Architect
Digital Measures

-------------- next part --------------
A non-text attachment was scrubbed...
Name: collectd-configure-solaris-10-runtime-path.patch
Type: text/x-patch
Size: 390 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20120530/014604d1/attachment.bin>


More information about the collectd mailing list