Re: meson: Allow disabling static libraries

From: "Tristan Partin" <tristan(at)partin(dot)io>
To: "Peter Eisentraut" <peter(at)eisentraut(dot)org>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: meson: Allow disabling static libraries
Date: 2026-01-20 16:22:26
Message-ID: DFTJZHE3YE0W.HDGSBWWHE04Q@partin.io
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue Jan 20, 2026 at 1:04 AM CST, Peter Eisentraut wrote:
> This patch allows disabling the build of static libraries using the
> standard meson option -Ddefault_library=shared (defaults to "both").
> This option would work out of the box if you use the library() function
> to build libraries, but we use shared_library() and static_library()
> separately, for reasons that are explained in
> src/interfaces/libpq/meson.build. So now with this, the option works
> again as expected from the end user's perspective.
>
> This approach was suggested by Tristan Partin over in the AIX thread[0],
> but I figured this could be a generally usable feature, as some
> distributions don't want to build static libraries.
>
> For illustration and continuous testing, I disabled static libraries in
> the CI SanityCheck task.

Maybe a better test would be to install the build tree into a DESTDIR,
and then do a `find $DESTDIR -type f -name '*.a'` and confirm that no
static libraries were installed.

Otherwise, the patch looks good.

--
Tristan Partin
Databricks (https://databricks.com)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-01-20 16:28:00 Re: Make copyObject work in C++
Previous Message Andres Freund 2026-01-20 15:47:04 Re: Change copyObject() to use typeof_unqual