From d3dc1f361e73f7e2ee4732cc82eb5279596b548d Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Fri, 3 Nov 2023 10:06:00 -0700 Subject: [PATCH v2 7/7] meson: Add -Dpkglibdir option Author: Reviewed-by: Discussion: https://postgr.es/m/20231103163848.26egkh5qdgw3vmil@awork3.anarazel.de Backpatch: --- meson.build | 9 ++++++--- meson_options.txt | 3 +++ doc/src/sgml/installation.sgml | 18 +++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 0f086757e17..9f38433285b 100644 --- a/meson.build +++ b/meson.build @@ -492,9 +492,12 @@ endif dir_lib = get_option('libdir') -dir_lib_pkg = dir_lib -if not (dir_prefix_contains_pg or dir_lib_pkg.contains('pgsql') or dir_lib_pkg.contains('postgres')) - dir_lib_pkg = dir_lib_pkg / pkg +dir_lib_pkg = get_option('pkglibdir') +if dir_lib_pkg == '' + dir_lib_pkg = dir_lib + if not (dir_prefix_contains_pg or dir_lib_pkg.contains('pgsql') or dir_lib_pkg.contains('postgres')) + dir_lib_pkg = dir_lib_pkg / pkg + endif endif dir_pgxs = dir_lib_pkg / 'pgxs' diff --git a/meson_options.txt b/meson_options.txt index be1b327f544..82441b4d524 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -70,6 +70,9 @@ option('darwin_sysroot', type: 'string', value: '', option('rpath', type: 'boolean', value: true, description: 'Embed shared library search path in executables') +option('pkglibdir', type: 'string', value: '', + description: 'Directory to install / load dynamically loadable modules from') + # External dependencies diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index d7fefa0918c..8345bb68e92 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -2254,9 +2254,21 @@ ninja install - Sets the location to install libraries and dynamically loadable - modules. The default is - PREFIX/lib. + Sets the location to install libraries. The default is + PREFIX/lib. This + option, unless is + specified, also controls where dynamically loadable modules get + installed. + + + + + + + + + Sets the location to dynamically loadable modules. The default is set + by . -- 2.38.0