mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-07 00:09:25 +02:00
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
186 lines
5.4 KiB
Meson
186 lines
5.4 KiB
Meson
# Data layout influencing options
|
|
|
|
option('blocksize', type : 'combo',
|
|
choices : ['1', '2', '4', '8', '16', '32'],
|
|
value : '8',
|
|
description: 'set relation block size in kB')
|
|
|
|
option('wal_blocksize', type : 'combo',
|
|
choices: ['1', '2', '4', '8', '16', '32', '64'],
|
|
value: '8',
|
|
description : '''WAL block size, in kilobytes''')
|
|
|
|
option('segsize', type : 'integer', value : 1,
|
|
description : '''Segment size, in gigabytes''')
|
|
|
|
|
|
# Miscellaneous options
|
|
|
|
option('krb_srvnam', type : 'string', value : 'postgres',
|
|
description : '''Default Kerberos service principal for GSSAPI''')
|
|
|
|
option('system_tzdata', type: 'string', value: '',
|
|
description: 'use system time zone data in specified directory')
|
|
|
|
|
|
# Defaults
|
|
|
|
option('pgport', type : 'integer', value : 5432,
|
|
min: 1, max: 65535,
|
|
description : '''Default port number for server and clients''')
|
|
|
|
|
|
# Developer options
|
|
|
|
option('cassert', type : 'boolean', value: false,
|
|
description: 'enable assertion checks (for debugging)')
|
|
|
|
option('tap_tests', type : 'feature', value : 'auto',
|
|
description : 'Whether to enable tap tests')
|
|
|
|
option('PG_TEST_EXTRA', type : 'string', value: '',
|
|
description: 'Enable selected extra tests')
|
|
|
|
option('atomics', type : 'boolean', value: true,
|
|
description: 'whether to use atomic operations')
|
|
|
|
option('spinlocks', type : 'boolean', value: true,
|
|
description: 'whether to use spinlocks')
|
|
|
|
|
|
# Compilation options
|
|
|
|
option('extra_include_dirs', type : 'array', value: [],
|
|
description: 'non-default directories to be searched for headers')
|
|
|
|
option('extra_lib_dirs', type : 'array', value: [],
|
|
description: 'non-default directories to be searched for libs')
|
|
|
|
option('extra_version', type : 'string', value: '',
|
|
description: 'append STRING to the PostgreSQL version number')
|
|
|
|
option('darwin_sysroot', type : 'string', value: '',
|
|
description: 'select a non-default sysroot path')
|
|
|
|
|
|
# External dependencies
|
|
|
|
option('bonjour', type : 'feature', value: 'auto',
|
|
description: 'build with Bonjour support')
|
|
|
|
option('bsd_auth', type : 'feature', value: 'auto',
|
|
description: 'build with BSD Authentication support')
|
|
|
|
option('dtrace', type : 'feature', value: 'disabled',
|
|
description: 'DTrace support')
|
|
|
|
option('gssapi', type : 'feature', value: 'auto',
|
|
description: 'GSSAPI support')
|
|
|
|
option('icu', type : 'feature', value: 'auto',
|
|
description: 'ICU support')
|
|
|
|
option('ldap', type : 'feature', value: 'auto',
|
|
description: 'LDAP support')
|
|
|
|
option('libedit_preferred', type : 'boolean', value: false,
|
|
description: 'Prefer BSD Libedit over GNU Readline')
|
|
|
|
option('libxml', type : 'feature', value: 'auto',
|
|
description: 'XML support')
|
|
|
|
option('libxslt', type : 'feature', value: 'auto',
|
|
description: 'XSLT support in contrib/xml2')
|
|
|
|
option('llvm', type : 'feature', value: 'disabled',
|
|
description: 'whether to use llvm')
|
|
|
|
option('lz4', type : 'feature', value: 'auto',
|
|
description: 'LZ4 support')
|
|
|
|
option('nls', type: 'feature', value: 'auto',
|
|
description: 'native language support')
|
|
|
|
option('pam', type : 'feature', value: 'auto',
|
|
description: 'build with PAM support')
|
|
|
|
option('plperl', type : 'feature', value: 'auto',
|
|
description: 'build Perl modules (PL/Perl)')
|
|
|
|
option('plpython', type : 'feature', value: 'auto',
|
|
description: 'build Python modules (PL/Python)')
|
|
|
|
option('pltcl', type : 'feature', value: 'auto',
|
|
description: 'build with TCL support')
|
|
|
|
option('tcl_version', type : 'string', value : 'tcl',
|
|
description: 'specify TCL version')
|
|
|
|
option('readline', type : 'feature', value : 'auto',
|
|
description: 'use GNU Readline or BSD Libedit for editing')
|
|
|
|
option('selinux', type : 'feature', value : 'disabled',
|
|
description: 'build with SELinux support')
|
|
|
|
option('ssl', type : 'combo', choices : ['none', 'openssl'],
|
|
value : 'none',
|
|
description: 'use LIB for SSL/TLS support (openssl)')
|
|
|
|
option('systemd', type : 'feature', value: 'auto',
|
|
description: 'build with systemd support')
|
|
|
|
option('uuid', type : 'combo', choices : ['none', 'bsd', 'e2fs', 'ossp'],
|
|
value : 'none',
|
|
description: 'build contrib/uuid-ossp using LIB')
|
|
|
|
option('zlib', type : 'feature', value: 'auto',
|
|
description: 'whether to use zlib')
|
|
|
|
option('zstd', type : 'feature', value: 'auto',
|
|
description: 'whether to use zstd')
|
|
|
|
|
|
# Programs
|
|
|
|
option('BISON', type : 'array', value: ['bison', 'win_bison'],
|
|
description: 'path to bison binary')
|
|
|
|
option('DTRACE', type : 'string', value: 'dtrace',
|
|
description: 'path to dtrace binary')
|
|
|
|
option('FLEX', type : 'array', value: ['flex', 'win_flex'],
|
|
description: 'path to flex binary')
|
|
|
|
option('GZIP', type : 'string', value: 'gzip',
|
|
description: 'path to gzip binary')
|
|
|
|
option('LZ4', type : 'string', value: 'lz4',
|
|
description: 'path to lz4 binary')
|
|
|
|
option('PERL', type : 'string', value: 'perl',
|
|
description: 'path to perl binary')
|
|
|
|
option('PROVE', type : 'string', value: 'prove',
|
|
description: 'path to prove binary')
|
|
|
|
option('PYTHON', type : 'array', value: ['python3', 'python'],
|
|
description: 'path to python binary')
|
|
|
|
option('SED', type : 'string', value: 'gsed',
|
|
description: 'path to sed binary')
|
|
|
|
option('TAR', type : 'string', value: 'tar',
|
|
description: 'path to tar binary')
|
|
|
|
option('XMLLINT', type : 'string', value: 'xmllint',
|
|
description: 'path to xmllint binary')
|
|
|
|
option('XSLTPROC', type : 'string', value: 'xsltproc',
|
|
description: 'path to xsltproc binary')
|
|
|
|
option('ZSTD', type : 'string', value: 'zstd',
|
|
description: 'path to zstd binary')
|
|
|
|
option('ZIC', type : 'string', value: 'zic',
|
|
description: 'path to zic binary, when cross-compiling')
|