$NetBSD: patch-configure.ac,v 1.2 2013/10/20 18:18:52 joerg Exp $

Upstream's configure hand-constructs LDFLAGS from using --libdir, and
fails to address rpath.

To be addressed with upstream by gdt after updating to 1.5.3 and
understanding better.

--- configure.ac.orig	2010-01-29 21:24:24.000000000 +0000
+++ configure.ac
@@ -341,7 +341,7 @@ AC_SUBST([PGXSOVERRIDE])
 dnl Note: We don't need the server-side LDFLAGS or CPPFLAGS because we get these from PGXS 
 
 dnl Extract the linker and include flags for the frontend (for programs that use libpq)
-PGSQL_FE_LDFLAGS=-L`$PGCONFIG --libdir`" -lpq"
+PGSQL_FE_LDFLAGS="-L`$PGCONFIG --libdir` ${COMPILER_RPATH_FLAG}`$PGCONFIG --libdir` -lpq"
 PGSQL_FE_CPPFLAGS=-I`$PGCONFIG --includedir`
 
 AC_SUBST([PGSQL_FE_LDFLAGS])
