[Proposal] Generate pkg-config for server module development - Mailing list pgsql-hackers

From Anders Åstrand
Subject [Proposal] Generate pkg-config for server module development
Date
Msg-id 15dfbf19-d80e-414d-88bd-601c07d23e08@449.com
Whole thread Raw
List 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

pgsql-hackers by date:

Previous
From: Alexander Pyhalov
Date:
Subject: Re: Bypassing cursors in postgres_fdw to enable parallel plans
Next
From: Bruce Momjian
Date:
Subject: libxml2 video about its abandonment