Re: How to add and use a static library within Postgres backend

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: How to add and use a static library within Postgres backend
Дата
Msg-id CAMsr+YGCVguU11f56_8Vejv620ZnMV=BQh0XJwhGyw8j32EYrg@mail.gmail.com
обсуждение исходный текст
Ответ на How to add and use a static library within Postgres backend  (XiaoChuan Yu <xcyu.se@gmail.com>)
Список pgsql-hackers
On 27 November 2015 at 10:35, XiaoChuan Yu <xcyu.se@gmail.com> wrote:
I'm doing some experimenting with the storage engine and I'd like to use a C++ static library (that has C headers).  I only need this to build on Ubuntu 64-bit for now.
How do I make postgres build with this library?

Build it separately. Link to it like any other library. Take a look at configure.in for how libraries are discovered and the Makefile.am files for how the header path and linker flags are defined.

What changes do I need to make to the build system files?

As above. Look at how PostgreSQL uses existing libraries. If the library presents a pure C interface it should be just like everything else.
 
I assume headers go in src/include but where do I put the library.a file?

Don't copy anything into PostgreSQL's source tree. Add new linker path and include path entries so the build system knows how to find the files where you originally compiled them.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: silent data loss with ext4 / all current versions
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: silent data loss with ext4 / all current versions