@@ -1426,7 +1426,7 @@ include $(PGXS)
1426
1426
</programlisting>
1427
1427
1428
1428
This makefile relies on <acronym>PGXS</acronym>, which is described
1429
- in <xref linkend="extend-pgxs"/>. The command <literal>make install</literal>
1429
+ in <xref linkend="extend-postgres- pgxs"/>. The command <literal>make install</literal>
1430
1430
will install the control and script files into the correct
1431
1431
directory as reported by <application>pg_config</application>.
1432
1432
</para>
@@ -1439,21 +1439,26 @@ include $(PGXS)
1439
1439
</sect2>
1440
1440
</sect1>
1441
1441
1442
- <sect1 id="extend-pgxs ">
1442
+ <sect1 id="extend-postgres ">
1443
1443
<title>Extension Building Infrastructure</title>
1444
1444
1445
- <indexterm zone="extend-pgxs">
1446
- <primary>pgxs</primary>
1447
- </indexterm>
1448
-
1449
1445
<para>
1450
1446
If you are thinking about distributing your
1451
1447
<productname>PostgreSQL</productname> extension modules, setting up a
1452
1448
portable build system for them can be fairly difficult. Therefore
1453
1449
the <productname>PostgreSQL</productname> installation provides a build
1454
- infrastructure for extensions, called <acronym>PGXS</acronym>, so
1455
- that simple extension modules can be built simply against an
1456
- already installed server. <acronym>PGXS</acronym> is mainly intended
1450
+ infrastructure for extensions, called <literal>PGXS</literal>
1451
+ (<xref linkend="extend-postgres-pgxs"/>) and
1452
+ its meson counterpart <literal>postgresql-extension.pc</literal>
1453
+ (<xref linkend="extend-postgres-meson"/>).
1454
+ </para>
1455
+
1456
+ </sect1>
1457
+
1458
+ <sect1 id="extend-postgres-pgxs">
1459
+ <title>PGXS</title>
1460
+
1461
+ <para> <acronym>PGXS</acronym> is mainly intended
1457
1462
for extensions that include C code, although it can be used for
1458
1463
pure-SQL extensions too. Note that <acronym>PGXS</acronym> is not
1459
1464
intended to be a universal build system framework that can be used
@@ -1493,7 +1498,7 @@ include $(PGXS)
1493
1498
Set one of these three variables to specify what is built:
1494
1499
1495
1500
<variablelist>
1496
- <varlistentry id="extend-pgxs-modules">
1501
+ <varlistentry id="extend-postgres- pgxs-modules">
1497
1502
<term><varname>MODULES</varname></term>
1498
1503
<listitem>
1499
1504
<para>
@@ -1503,7 +1508,7 @@ include $(PGXS)
1503
1508
</listitem>
1504
1509
</varlistentry>
1505
1510
1506
- <varlistentry id="extend-pgxs-module-big">
1511
+ <varlistentry id="extend-postgres- pgxs-module-big">
1507
1512
<term><varname>MODULE_big</varname></term>
1508
1513
<listitem>
1509
1514
<para>
@@ -1513,7 +1518,7 @@ include $(PGXS)
1513
1518
</listitem>
1514
1519
</varlistentry>
1515
1520
1516
- <varlistentry id="extend-pgxs-program">
1521
+ <varlistentry id="extend-postgres- pgxs-program">
1517
1522
<term><varname>PROGRAM</varname></term>
1518
1523
<listitem>
1519
1524
<para>
@@ -1527,7 +1532,7 @@ include $(PGXS)
1527
1532
The following variables can also be set:
1528
1533
1529
1534
<variablelist>
1530
- <varlistentry id="extend-pgxs-extension">
1535
+ <varlistentry id="extend-postgres- pgxs-extension">
1531
1536
<term><varname>EXTENSION</varname></term>
1532
1537
<listitem>
1533
1538
<para>
@@ -1539,7 +1544,7 @@ include $(PGXS)
1539
1544
</listitem>
1540
1545
</varlistentry>
1541
1546
1542
- <varlistentry id="extend-pgxs-moduledir">
1547
+ <varlistentry id="extend-postgres- pgxs-moduledir">
1543
1548
<term><varname>MODULEDIR</varname></term>
1544
1549
<listitem>
1545
1550
<para>
@@ -1552,7 +1557,7 @@ include $(PGXS)
1552
1557
</listitem>
1553
1558
</varlistentry>
1554
1559
1555
- <varlistentry id="extend-pgxs-data">
1560
+ <varlistentry id="extend-postgres- pgxs-data">
1556
1561
<term><varname>DATA</varname></term>
1557
1562
<listitem>
1558
1563
<para>
@@ -1561,7 +1566,7 @@ include $(PGXS)
1561
1566
</listitem>
1562
1567
</varlistentry>
1563
1568
1564
- <varlistentry id="extend-pgxs-data-built">
1569
+ <varlistentry id="extend-postgres- pgxs-data-built">
1565
1570
<term><varname>DATA_built</varname></term>
1566
1571
<listitem>
1567
1572
<para>
@@ -1572,7 +1577,7 @@ include $(PGXS)
1572
1577
</listitem>
1573
1578
</varlistentry>
1574
1579
1575
- <varlistentry id="extend-pgxs-data-tsearch">
1580
+ <varlistentry id="extend-postgres- pgxs-data-tsearch">
1576
1581
<term><varname>DATA_TSEARCH</varname></term>
1577
1582
<listitem>
1578
1583
<para>
@@ -1582,7 +1587,7 @@ include $(PGXS)
1582
1587
</listitem>
1583
1588
</varlistentry>
1584
1589
1585
- <varlistentry id="extend-pgxs-docs">
1590
+ <varlistentry id="extend-postgres- pgxs-docs">
1586
1591
<term><varname>DOCS</varname></term>
1587
1592
<listitem>
1588
1593
<para>
@@ -1592,7 +1597,7 @@ include $(PGXS)
1592
1597
</listitem>
1593
1598
</varlistentry>
1594
1599
1595
- <varlistentry id="extend-pgxs-headers">
1600
+ <varlistentry id="extend-postgres- pgxs-headers">
1596
1601
<term><varname>HEADERS</varname></term>
1597
1602
<term><varname>HEADERS_built</varname></term>
1598
1603
<listitem>
@@ -1608,7 +1613,7 @@ include $(PGXS)
1608
1613
</listitem>
1609
1614
</varlistentry>
1610
1615
1611
- <varlistentry id="extend-pgxs-headers-module">
1616
+ <varlistentry id="extend-postgres- pgxs-headers-module">
1612
1617
<term><varname>HEADERS_$MODULE</varname></term>
1613
1618
<term><varname>HEADERS_built_$MODULE</varname></term>
1614
1619
<listitem>
@@ -1634,7 +1639,7 @@ include $(PGXS)
1634
1639
</listitem>
1635
1640
</varlistentry>
1636
1641
1637
- <varlistentry id="extend-pgxs-scripts">
1642
+ <varlistentry id="extend-postgres- pgxs-scripts">
1638
1643
<term><varname>SCRIPTS</varname></term>
1639
1644
<listitem>
1640
1645
<para>
@@ -1644,7 +1649,7 @@ include $(PGXS)
1644
1649
</listitem>
1645
1650
</varlistentry>
1646
1651
1647
- <varlistentry id="extend-pgxs-scripts-built">
1652
+ <varlistentry id="extend-postgres- pgxs-scripts-built">
1648
1653
<term><varname>SCRIPTS_built</varname></term>
1649
1654
<listitem>
1650
1655
<para>
@@ -1655,7 +1660,7 @@ include $(PGXS)
1655
1660
</listitem>
1656
1661
</varlistentry>
1657
1662
1658
- <varlistentry id="extend-pgxs-regress">
1663
+ <varlistentry id="extend-postgres- pgxs-regress">
1659
1664
<term><varname>REGRESS</varname></term>
1660
1665
<listitem>
1661
1666
<para>
@@ -1664,7 +1669,7 @@ include $(PGXS)
1664
1669
</listitem>
1665
1670
</varlistentry>
1666
1671
1667
- <varlistentry id="extend-pgxs-regress-opts">
1672
+ <varlistentry id="extend-postgres- pgxs-regress-opts">
1668
1673
<term><varname>REGRESS_OPTS</varname></term>
1669
1674
<listitem>
1670
1675
<para>
@@ -1673,7 +1678,7 @@ include $(PGXS)
1673
1678
</listitem>
1674
1679
</varlistentry>
1675
1680
1676
- <varlistentry id="extend-pgxs-isolation">
1681
+ <varlistentry id="extend-postgres- pgxs-isolation">
1677
1682
<term><varname>ISOLATION</varname></term>
1678
1683
<listitem>
1679
1684
<para>
@@ -1682,7 +1687,7 @@ include $(PGXS)
1682
1687
</listitem>
1683
1688
</varlistentry>
1684
1689
1685
- <varlistentry id="extend-pgxs-isolation-opts">
1690
+ <varlistentry id="extend-postgres- pgxs-isolation-opts">
1686
1691
<term><varname>ISOLATION_OPTS</varname></term>
1687
1692
<listitem>
1688
1693
<para>
@@ -1692,7 +1697,7 @@ include $(PGXS)
1692
1697
</listitem>
1693
1698
</varlistentry>
1694
1699
1695
- <varlistentry id="extend-pgxs-tap-tests">
1700
+ <varlistentry id="extend-postgres- pgxs-tap-tests">
1696
1701
<term><varname>TAP_TESTS</varname></term>
1697
1702
<listitem>
1698
1703
<para>
@@ -1701,7 +1706,7 @@ include $(PGXS)
1701
1706
</listitem>
1702
1707
</varlistentry>
1703
1708
1704
- <varlistentry id="extend-pgxs-no-install">
1709
+ <varlistentry id="extend-postgres- pgxs-no-install">
1705
1710
<term><varname>NO_INSTALL</varname></term>
1706
1711
<listitem>
1707
1712
<para>
@@ -1711,7 +1716,7 @@ include $(PGXS)
1711
1716
</listitem>
1712
1717
</varlistentry>
1713
1718
1714
- <varlistentry id="extend-pgxs-no-installcheck">
1719
+ <varlistentry id="extend-postgres- pgxs-no-installcheck">
1715
1720
<term><varname>NO_INSTALLCHECK</varname></term>
1716
1721
<listitem>
1717
1722
<para>
@@ -1720,7 +1725,7 @@ include $(PGXS)
1720
1725
</listitem>
1721
1726
</varlistentry>
1722
1727
1723
- <varlistentry id="extend-pgxs-extra-clean">
1728
+ <varlistentry id="extend-postgres- pgxs-extra-clean">
1724
1729
<term><varname>EXTRA_CLEAN</varname></term>
1725
1730
<listitem>
1726
1731
<para>
@@ -1729,7 +1734,7 @@ include $(PGXS)
1729
1734
</listitem>
1730
1735
</varlistentry>
1731
1736
1732
- <varlistentry id="extend-pgxs-pg-cppflags">
1737
+ <varlistentry id="extend-postgres- pgxs-pg-cppflags">
1733
1738
<term><varname>PG_CPPFLAGS</varname></term>
1734
1739
<listitem>
1735
1740
<para>
@@ -1738,7 +1743,7 @@ include $(PGXS)
1738
1743
</listitem>
1739
1744
</varlistentry>
1740
1745
1741
- <varlistentry id="extend-pgxs-pg-cflags">
1746
+ <varlistentry id="extend-postgres- pgxs-pg-cflags">
1742
1747
<term><varname>PG_CFLAGS</varname></term>
1743
1748
<listitem>
1744
1749
<para>
@@ -1747,7 +1752,7 @@ include $(PGXS)
1747
1752
</listitem>
1748
1753
</varlistentry>
1749
1754
1750
- <varlistentry id="extend-pgxs-pg-cxxflags">
1755
+ <varlistentry id="extend-postgres- pgxs-pg-cxxflags">
1751
1756
<term><varname>PG_CXXFLAGS</varname></term>
1752
1757
<listitem>
1753
1758
<para>
@@ -1756,7 +1761,7 @@ include $(PGXS)
1756
1761
</listitem>
1757
1762
</varlistentry>
1758
1763
1759
- <varlistentry id="extend-pgxs-pg-ldflags">
1764
+ <varlistentry id="extend-postgres- pgxs-pg-ldflags">
1760
1765
<term><varname>PG_LDFLAGS</varname></term>
1761
1766
<listitem>
1762
1767
<para>
@@ -1765,7 +1770,7 @@ include $(PGXS)
1765
1770
</listitem>
1766
1771
</varlistentry>
1767
1772
1768
- <varlistentry id="extend-pgxs-pg-libs">
1773
+ <varlistentry id="extend-postgres- pgxs-pg-libs">
1769
1774
<term><varname>PG_LIBS</varname></term>
1770
1775
<listitem>
1771
1776
<para>
@@ -1774,7 +1779,7 @@ include $(PGXS)
1774
1779
</listitem>
1775
1780
</varlistentry>
1776
1781
1777
- <varlistentry id="extend-pgxs-shlib-link">
1782
+ <varlistentry id="extend-postgres- pgxs-shlib-link">
1778
1783
<term><varname>SHLIB_LINK</varname></term>
1779
1784
<listitem>
1780
1785
<para>
@@ -1783,7 +1788,7 @@ include $(PGXS)
1783
1788
</listitem>
1784
1789
</varlistentry>
1785
1790
1786
- <varlistentry id="extend-pgxs-pg-config">
1791
+ <varlistentry id="extend-postgres- pgxs-pg-config">
1787
1792
<term><varname>PG_CONFIG</varname></term>
1788
1793
<listitem>
1789
1794
<para>
@@ -1929,4 +1934,26 @@ make VPATH=/path/to/extension/source/tree install
1929
1934
</tip>
1930
1935
</sect1>
1931
1936
1937
+ <sect1 id="extend-postgres-meson">
1938
+ <title>postgresql-extension.pc</title>
1939
+
1940
+ <para>
1941
+ When Postgres is built by using meson, it generates
1942
+ <literal>postgresql-extension.pc</literal> pkg-config file. Extension
1943
+ libraries can use this file like <literal>PGXS</literal>
1944
+ (<xref linkend="extend-postgres-pgxs"/>).
1945
+
1946
+ To use the <literal>postgresql-extension.pc</literal> infrastructure for
1947
+ your extension, you must write a simple meson.build file. In the
1948
+ meson.build file, you need to include the
1949
+ <literal>postgresql-extension.pc</literal> pkg-config file. Here is an
1950
+ example that builds an extension module named isbn_issn, consisting of a
1951
+ shared library containing some C code, an extension control file, an SQL
1952
+ script, an include file (only needed if other modules might need to access
1953
+ the extension functions without going via SQL), and a documentation text
1954
+ file:
1955
+ </para>
1956
+
1957
+ </sect1>
1958
+
1932
1959
</chapter>
0 commit comments