[Proposal] Generate pkg-config for server module development

From: Anders Åstrand <anders(at)449(dot)se>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [Proposal] Generate pkg-config for server module development
Date: 2025-12-17 14:17:49
Message-ID: 15dfbf19-d80e-414d-88bd-601c07d23e08@449.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello hackers!

I've been looking into making it easier for extension authors to use
other build
systems than make. I don't have everything in place just yet, but I
believe this
first part where we generate pkg-config files for building server
modules can be
useful on it's own.

I'm not entirely sure about what parameters we should include in the
pkg-config
file, but what I have in the attached patch is inspired by PGXS and the
pkg-config files we already generate for shared libraries.

A meson.build file using this could look something like this:

    project('my_extension', 'c', default_options: { 'b_lundef': false })
    pg_dep = dependency('postgresql-server')
    shared_library(
        'my_extension',
        name_prefix: '',
        sources: ['src/my_code.c'],
        dependencies: pg_dep,
        install: true,
        install_dir: pg_dep.get_variable('libdir'),
    )

I choose the Makefile to add this to quite arbitrarily, I'm sure
arguments can
be made for many of them.

Any feedback is highly appreciated! We would also need to add pkg-config for
building frontend tools I believe.

--
Anders Åstrand
Percona

Attachment Content-Type Size
0001-Generate-pkg-config-for-server-module-development.patch text/x-patch 4.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2025-12-17 14:21:28 libxml2 video about its abandonment
Previous Message Alexander Pyhalov 2025-12-17 14:09:28 Re: Bypassing cursors in postgres_fdw to enable parallel plans