Re: building libpq.a static library

From: Jan de Visser <jan(at)de-visser(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Jeroen Ooms <jeroen(at)berkeley(dot)edu>
Subject: Re: building libpq.a static library
Date: 2017-07-12 14:21:47
Message-ID: 25891116.pXANcD57F2@coyote
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, July 12, 2017 6:31:09 AM EDT Jeroen Ooms wrote:
> I maintain static libraries for libpq for the R programming language
> (we need static linking to ship with the binary packages).
> Unfortunately currently the standard postgres makefile only generates
> a shared library for libpq, not a static one.
>
> In order to make a static library I always manually edit
> ./src/interfaces/libpq/Makefile and add a target:
>
> libpq.a: $(OBJS)
> ar rcs $@ $^
>
> And then run 'make libpq.a' in the libpq directory.
>
> This works but it's a bit of a pain to maintain. I was wondering if
> this hack could be merged so that the standard 'configure
> --enable-static' script would install a static library for libpq
> alongside the shared one.

I have no idea what the consensus about this is, but providing a patch file and
registering it at https://commitfest.postgresql.org/ increases your chances.

I wish you good luck hacking autoconf hell (which is what you'll need to do to
get the command line switch) though (*shudder*).

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-07-12 14:43:21 Re: PostgreSQL10 beta2 with ICU - initdb fails on MacOS
Previous Message Heikki Linnakangas 2017-07-12 14:11:12 Re: Typo in backend/storage/ipc/standby.c