postgresql/contrib
Andres Freund e6927270cd meson: Add initial version of meson based build system
Autoconf is showing its age, fewer and fewer contributors know how to wrangle
it. Recursive make has a lot of hard to resolve dependency issues and slow
incremental rebuilds. Our home-grown MSVC build system is hard to maintain for
developers not using Windows and runs tests serially. While these and other
issues could individually be addressed with incremental improvements, together
they seem best addressed by moving to a more modern build system.

After evaluating different build system choices, we chose to use meson, to a
good degree based on the adoption by other open source projects.

We decided that it's more realistic to commit a relatively early version of
the new build system and mature it in tree.

This commit adds an initial version of a meson based build system. It supports
building postgres on at least AIX, FreeBSD, Linux, macOS, NetBSD, OpenBSD,
Solaris and Windows (however only gcc is supported on aix, solaris). For
Windows/MSVC postgres can now be built with ninja (faster, particularly for
incremental builds) and msbuild (supporting the visual studio GUI, but
building slower).

Several aspects (e.g. Windows rc file generation, PGXS compatibility, LLVM
bitcode generation, documentation adjustments) are done in subsequent commits
requiring further review. Other aspects (e.g. not installing test-only
extensions) are not yet addressed.

When building on Windows with msbuild, builds are slower when using a visual
studio version older than 2019, because those versions do not support
MultiToolTask, required by meson for intra-target parallelism.

The plan is to remove the MSVC specific build system in src/tools/msvc soon
after reaching feature parity. However, we're not planning to remove the
autoconf/make build system in the near future. Likely we're going to keep at
least the parts required for PGXS to keep working around until all supported
versions build with meson.

Some initial help for postgres developers is at
https://wiki.postgresql.org/wiki/Meson

With contributions from Thomas Munro, John Naylor, Stone Tickle and others.

Author: Andres Freund <andres@anarazel.de>
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Author: Peter Eisentraut <peter@eisentraut.org>
Reviewed-By: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Discussion: https://postgr.es/m/20211012083721.hvixq4pnh2pixr3j@alap3.anarazel.de
2022-09-21 22:37:17 -07:00
..
adminpack meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
amcheck meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
auth_delay meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
auto_explain meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
basebackup_to_shell meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
basic_archive meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
bloom meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
bool_plperl meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
btree_gin meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
btree_gist meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
citext meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
cube meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
dblink meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
dict_int meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
dict_xsyn meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
earthdistance meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
file_fdw meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
fuzzystrmatch meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
hstore meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
hstore_plperl meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
hstore_plpython meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
intagg meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
intarray meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
isn meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
jsonb_plperl meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
jsonb_plpython meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
lo meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
ltree meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
ltree_plpython meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
oid2name meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
old_snapshot meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pageinspect meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
passwordcheck meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_buffercache meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_freespacemap meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_prewarm meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_stat_statements meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_surgery meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_trgm meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_visibility meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_walinspect meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pgcrypto meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pgrowlocks meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pgstattuple meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
postgres_fdw meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
seg meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
sepgsql meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
spi meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
sslinfo meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
start-scripts Remove contrib/start-scripts/osx/. 2017-11-17 12:53:20 -05:00
tablefunc meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
tcn meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
test_decoding meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
tsm_system_rows meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
tsm_system_time meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
unaccent meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
uuid-ossp meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
vacuumlo meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
xml2 meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
Makefile Add contrib/pg_walinspect. 2022-04-08 00:26:44 -07:00
README Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
contrib-global.mk Respect TEMP_CONFIG when pg_regress_check and friends are called 2016-02-27 12:28:21 -05:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00

README

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.