From c1f564e37c27855e581aacedb29a93f5ff8bf57f Mon Sep 17 00:00:00 2001 From: Nazir Bilal Yavuz Date: Thu, 6 Mar 2025 17:46:57 +0300 Subject: [PATCH v14 2/4] meson: Add docs for postgresql-$version-llvm-jit-bitcode.pc Author: Andres Freund Author: Nazir Bilal Yavuz Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/206b001d-1884-4081-bd02-bed5c92f02ba%40eisentraut.org --- doc/src/sgml/extend.sgml | 98 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 8 deletions(-) diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index 63c5ec6d1eb..ac7c2e54d2f 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1439,21 +1439,34 @@ include $(PGXS) - + Extension Building Infrastructure - - pgxs - - If you are thinking about distributing your PostgreSQL extension modules, setting up a portable build system for them can be fairly difficult. Therefore the PostgreSQL installation provides a build - infrastructure for extensions, called PGXS, so - that simple extension modules can be built simply against an - already installed server. PGXS is mainly intended + infrastructure for extensions, called PGXS + (). + + + + When PostgreSQL is built with + Meson, it also installs a + pkg-config file, + postgresql-&majorversion;-llvm-jit-bitcode.pc + (). This file is used internally to + emit LLVM JIT bitcode; it is not + (yet) a stable, supported interface for building extensions. + + + + + + PGXS + + PGXS is mainly intended for extensions that include C code, although it can be used for pure-SQL extensions too. Note that PGXS is not intended to be a universal build system framework that can be used @@ -1929,4 +1942,73 @@ make VPATH=/path/to/extension/source/tree install + + postgresql-&majorversion;-llvm-jit-bitcode.pc + + + When PostgreSQL is built with + Meson, it installs a + pkg-config file named + postgresql-&majorversion;-llvm-jit-bitcode.pc. It is + used internally to emit LLVM JIT + bitcode for the server and for selected + contrib modules, and it collects the same + compilation flags that are used to build the server itself. + + + + The file is deliberately versioned and named after its bitcode purpose + because there is not yet agreement on a stable, general-purpose interface + for building extensions. It is therefore not a + supported replacement for PGXS + (), and its name and contents may change + between major releases. + + + + To use the + postgresql-&majorversion;-llvm-jit-bitcode.pc + infrastructure for your extension, you must write a simple + meson.build file. In the + meson.build file, you need to include the + postgresql-&majorversion;-llvm-jit-bitcode.pc + pkg-config file. Here is an example that builds an + extension module named isbn_issn, consisting of a + shared library containing some C code, an extension control file, an + SQL script, an include file (only needed if other + modules might need to access the extension functions without going via + SQL), and a documentation text file: + +project('isbn_issn', 'c') + +pg_ext = dependency('postgresql-&majorversion;-llvm-jit-bitcode-warnings') + +isbn_issn_sources = files('isbn_issn.c') + +isbn_issn = shared_module('isbn_issn', + isbn_issn_sources, + dependencies: pg_ext, + install_dir: pg_ext.get_variable(pkgconfig: 'dir_mod'), +) + +install_data( + 'isbn_issn.control', + 'isbn_issn--1.0.sql', + install_dir: pg_ext.get_variable(pkgconfig: 'dir_data'), +) + +install_headers( + 'isbn_issn.h', + install_dir: pg_ext.get_variable(pkgconfig: 'dir_include'), +) + +install_data( + 'README.isbn_issn', + install_dir: pg_ext.get_variable(pkgconfig: 'dir_doc'), +) + + + + + -- 2.47.3