Re: BUG #17083: [PATCH] PostgreSQL fails to build with OpenLDAP 2.5.x

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Ho <ml+postgresql(at)03s(dot)net>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17083: [PATCH] PostgreSQL fails to build with OpenLDAP 2.5.x
Date: 2021-07-06 14:47:45
Message-ID: 1677203.1625582865@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Adrian Ho <ml+postgresql(at)03s(dot)net> writes:
> On 6/7/21 9:46 pm, Tom Lane wrote:
>> As for the patch itself, I'm wondering about
>> + LDAP_LIBS_FE="${ac_lib:+-l}$ac_lib $EXTRA_LDAP_LIBS"
>> That seems undesirably intimate with the implementation details
>> of AC_SEARCH_LIBS. Surely there's a better way?

> Hmmm, good point, my Autotools-fu is not very strong. I'll see if
> there's a blessed way of doing the above, otherwise I'll probably have
> to test each library separately in an AC_CHECK_LIB cascade instead.

Looking at the Autoconf docs, what AC_SEARCH_LIBS is specified to do is
"Prepend `-lLIBRARY' to `LIBS' for the first library found to contain
FUNCTION". So I'd suggest

* Save contents of LIBS and set it to empty
* Run AC_SEARCH_LIBS
* LDAP_LIBS_FE="$LIBS $EXTRA_LDAP_LIBS"
* Restore LIBS

I think we have some instances of that pattern already.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pantelis Theodosiou 2021-07-06 15:22:23 Re: BUG #17084: Wrong results of distinct node.
Previous Message PG Bug reporting form 2021-07-06 14:34:35 BUG #17084: Wrong results of distinct node.