Re: [HACKERS] Fix linking of OpenLDAP libraries

Поиск
Список
Период
Сортировка
Искать
От
Albe Laurenz
Тема
Re: [HACKERS] Fix linking of OpenLDAP libraries
Дата
Msg-id
52EF20B2E3209443BC37736D00C3C1380A4019FE@EXADV1.host.magwien.gv.at
Список
Дерево обсуждения
Re: [HACKERS] Fix linking of OpenLDAP libraries Christopher Browne <cbbrowne@acm.org>
Tom Lane wrote:
>> I have realized that my modifications in configure.in and
>> src/interfaces/libpq/Makefile to link libpq against
>> OpenLDAP are buggy.
>>
>> Here is a proposed patch to fix it.

[...]

>>   # The backend doesn't need everything that's in LIBS, however
>> ! LIBS := $(filter-out -lz -lreadline -ledit -ltermcap 
>>          -lncurses -lcurses -lldap_r $(PTHREAD_LIBS), $(LIBS))
> 
> This seems pretty risky.  What if PTHREAD_LIBS contains -L switches?
> They'd get removed even if needed for other libraries.
> 
> It would probably be safer not to put LDAP into LIBS at all, 
> but invent two new macros for configure to set, say LDAP_LIBS
> and LDAP_LIBS_R, and add these to the link lines in the backend
> and libpq respectively.

Here is a new patch that replaces the previous one; it adds two
macros LDAP_LIBS_FE and LDAP_LIBS_BE for frontend and backend,
respectively.

I did not only add them to the Makefile for interfaces/libpq,
but also everywhere something is linked against libpq in case
somebody links static.
I don't know if that's necessary, or if static builds are
supported - if not, the changes to those Makefiles should
perhaps not be applied.

Tested on Linux, AIX and Windows.

Yours,
Laurenz Albe
В списке pgsql-patches по дате отправления
От: Merlin Moncure
Дата:
От: Martijn van Oosterhout
Дата:
FAQ