From 7d0f94729f20300e55375c8a05b52aeeaf00f1f0 Mon Sep 17 00:00:00 2001 From: Nazir Bilal Yavuz Date: Thu, 6 Mar 2025 17:46:57 +0300 Subject: [PATCH v6 4/7] meson: [WIP] Add docs for postgresql-extension.pc Author: Andres Freund Author: Nazir Bilal Yavuz Discussion: https://postgr.es/m/206b001d-1884-4081-bd02-bed5c92f02ba%40eisentraut.org --- doc/src/sgml/acronyms.sgml | 2 +- doc/src/sgml/extend.sgml | 101 +++++++++++++++++++++++-------------- doc/src/sgml/jit.sgml | 2 +- 3 files changed, 66 insertions(+), 39 deletions(-) diff --git a/doc/src/sgml/acronyms.sgml b/doc/src/sgml/acronyms.sgml index 2f906e9f018..57f49c06a19 100644 --- a/doc/src/sgml/acronyms.sgml +++ b/doc/src/sgml/acronyms.sgml @@ -579,7 +579,7 @@ PGXS - PostgreSQL Extension System + PostgreSQL Extension System diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml index 63c5ec6d1eb..6d9fe5e96ad 100644 --- a/doc/src/sgml/extend.sgml +++ b/doc/src/sgml/extend.sgml @@ -1426,7 +1426,7 @@ include $(PGXS) This makefile relies on PGXS, which is described - in . The command make install + in . The command make install will install the control and script files into the correct directory as reported by pg_config. @@ -1439,21 +1439,26 @@ 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 + () and + its meson counterpart postgresql-extension.pc + (). + + + + + + 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 @@ -1493,7 +1498,7 @@ include $(PGXS) Set one of these three variables to specify what is built: - + MODULES @@ -1503,7 +1508,7 @@ include $(PGXS) - + MODULE_big @@ -1513,7 +1518,7 @@ include $(PGXS) - + PROGRAM @@ -1527,7 +1532,7 @@ include $(PGXS) The following variables can also be set: - + EXTENSION @@ -1539,7 +1544,7 @@ include $(PGXS) - + MODULEDIR @@ -1552,7 +1557,7 @@ include $(PGXS) - + DATA @@ -1561,7 +1566,7 @@ include $(PGXS) - + DATA_built @@ -1572,7 +1577,7 @@ include $(PGXS) - + DATA_TSEARCH @@ -1582,7 +1587,7 @@ include $(PGXS) - + DOCS @@ -1592,7 +1597,7 @@ include $(PGXS) - + HEADERS HEADERS_built @@ -1608,7 +1613,7 @@ include $(PGXS) - + HEADERS_$MODULE HEADERS_built_$MODULE @@ -1634,7 +1639,7 @@ include $(PGXS) - + SCRIPTS @@ -1644,7 +1649,7 @@ include $(PGXS) - + SCRIPTS_built @@ -1655,7 +1660,7 @@ include $(PGXS) - + REGRESS @@ -1664,7 +1669,7 @@ include $(PGXS) - + REGRESS_OPTS @@ -1673,7 +1678,7 @@ include $(PGXS) - + ISOLATION @@ -1682,7 +1687,7 @@ include $(PGXS) - + ISOLATION_OPTS @@ -1692,7 +1697,7 @@ include $(PGXS) - + TAP_TESTS @@ -1701,7 +1706,7 @@ include $(PGXS) - + NO_INSTALL @@ -1711,7 +1716,7 @@ include $(PGXS) - + NO_INSTALLCHECK @@ -1720,7 +1725,7 @@ include $(PGXS) - + EXTRA_CLEAN @@ -1729,7 +1734,7 @@ include $(PGXS) - + PG_CPPFLAGS @@ -1738,7 +1743,7 @@ include $(PGXS) - + PG_CFLAGS @@ -1747,7 +1752,7 @@ include $(PGXS) - + PG_CXXFLAGS @@ -1756,7 +1761,7 @@ include $(PGXS) - + PG_LDFLAGS @@ -1765,7 +1770,7 @@ include $(PGXS) - + PG_LIBS @@ -1774,7 +1779,7 @@ include $(PGXS) - + SHLIB_LINK @@ -1783,7 +1788,7 @@ include $(PGXS) - + PG_CONFIG @@ -1929,4 +1934,26 @@ make VPATH=/path/to/extension/source/tree install + + postgresql-extension.pc + + + When Postgres is built by using meson, it generates + postgresql-extension.pc pkg-config file. Extension + libraries can use this file like PGXS + (). + + To use the postgresql-extension.pc infrastructure for + your extension, you must write a simple meson.build file. In the + meson.build file, you need to include the + postgresql-extension.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: + + + + diff --git a/doc/src/sgml/jit.sgml b/doc/src/sgml/jit.sgml index 44e18bf1a6f..81a4644a97d 100644 --- a/doc/src/sgml/jit.sgml +++ b/doc/src/sgml/jit.sgml @@ -223,7 +223,7 @@ SET of types C and internal, as well as operators based on such functions. To do so for functions in extensions, the definitions of those functions need to be made available. - When using PGXS to build an extension + When using PGXS to build an extension against a server that has been compiled with LLVM JIT support, the relevant files will be built and installed automatically. -- 2.49.0