Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0mMb-0005ZU-GU for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Jul 2021 14:47:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m0mMa-0003TH-Eo for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Jul 2021 14:47:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0mMa-0003Ln-8A for pgsql-bugs@lists.postgresql.org; Tue, 06 Jul 2021 14:47:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0mMW-0000oc-B8 for pgsql-bugs@lists.postgresql.org; Tue, 06 Jul 2021 14:47:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 166EljVY1677204; Tue, 6 Jul 2021 10:47:45 -0400 From: Tom Lane To: Adrian Ho cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17083: [PATCH] PostgreSQL fails to build with OpenLDAP 2.5.x In-reply-to: References: <17083-a19190d9591946a7@postgresql.org> <1666182.1625579201@sss.pgh.pa.us> Comments: In-reply-to Adrian Ho message dated "Tue, 06 Jul 2021 22:22:00 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1677202.1625582865.1@sss.pgh.pa.us> Date: Tue, 06 Jul 2021 10:47:45 -0400 Message-ID: <1677203.1625582865@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Ho 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