postgresql/config
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
..
Makefile Install our "missing" script where PGXS builds can find it. 2015-12-11 16:15:05 -05:00
ax_pthread.m4 Update config/ax_pthread.m4 to latest upstream version. 2018-11-19 15:05:33 -05:00
c-compiler.m4 Add definition pg_attribute_aligned() for MSVC 2022-09-21 10:11:23 +09:00
c-library.m4 Remove configure probes for sockaddr_storage members. 2022-08-22 17:50:30 +12:00
check_decls.m4 Fix configure's AC_CHECK_DECLS tests to work correctly with clang. 2018-11-19 12:01:47 -05:00
check_modules.pl Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
config.guess Update config.guess and config.sub 2022-04-07 07:45:25 +02:00
config.sub Update config.guess and config.sub 2022-04-07 07:45:25 +02:00
general.m4 Rename configure.in to configure.ac 2020-07-24 10:42:08 +02:00
install-sh Fix install-strip on Mac OS X 2012-08-21 23:42:43 -04:00
libtool.m4 Rename AC_PROG_LD* macros to PGAC_PROG_LD*. This avoids clashes with the 2004-07-17 18:53:56 +00:00
llvm.m4 jit: configure: Explicitly reference 'native' component. 2020-12-07 19:34:13 -08:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
missing Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
perl.m4 Bump minimum Perl version to 5.14 2022-09-14 12:37:04 +07:00
pkg.m4 Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
prep_buildtree Fix vpath build 2019-03-27 23:36:00 +01:00
programs.m4 Bump minimum version of Flex to 2.5.35 2022-09-09 12:55:23 +07:00
python.m4 Unify DLSUFFIX on Darwin 2022-07-06 07:41:33 +02:00
tcl.m4 configure: More use of AC_ARG_VAR 2019-01-18 08:38:34 +01:00