Re: BUG #17083: [PATCH] PostgreSQL fails to build with OpenLDAP 2.5.x - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17083: [PATCH] PostgreSQL fails to build with OpenLDAP 2.5.x
Date
Msg-id 1677203.1625582865@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17083: [PATCH] PostgreSQL fails to build with OpenLDAP 2.5.x  (Adrian Ho <ml+postgresql@03s.net>)
Responses Re: BUG #17083: [PATCH] PostgreSQL fails to build with OpenLDAP 2.5.x  (Adrian Ho <ml+postgresql@03s.net>)
List pgsql-bugs
Adrian Ho <ml+postgresql@03s.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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17084: Wrong results of distinct node.
Next
From: Pantelis Theodosiou
Date:
Subject: Re: BUG #17084: Wrong results of distinct node.