meson: Add equivalent of configure --disable-rpath option

Discussion: https://www.postgresql.org/message-id/flat/33e957e6-4b4e-b0ed-1cc1-6335a24543ff%40enterprisedb.com
pull/131/head
Peter Eisentraut 3 years ago
parent 6da67a0c11
commit d2f44cc36e
  1. 23
      doc/src/sgml/installation.sgml
  2. 16
      meson.build
  3. 3
      meson_options.txt
  4. 2
      src/makefiles/meson.build

@ -2216,7 +2216,9 @@ ninja install
different subdirectories may render the installation non-relocatable, different subdirectories may render the installation non-relocatable,
meaning you won't be able to move it after installation. meaning you won't be able to move it after installation.
(The <literal>man</literal> and <literal>doc</literal> locations are (The <literal>man</literal> and <literal>doc</literal> locations are
not affected by this restriction.) not affected by this restriction.) For relocatable installs, you
might want to use the <literal>-Drpath=false</literal> option
described later.
</para> </para>
<variablelist> <variablelist>
@ -2856,6 +2858,25 @@ ninja install
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry id="configure-rpath-meson">
<term><option>-Drpath={ true | false }</option></term>
<listitem>
<para>
This option is set to true by default. If set to false,
do not mark <productname>PostgreSQL</productname>'s executables
to indicate that they should search for shared libraries in the
installation's library directory (see <option>--libdir</option>).
On most platforms, this marking uses an absolute path to the
library directory, so that it will be unhelpful if you relocate
the installation later. However, you will then need to provide
some other way for the executables to find the shared libraries.
Typically this requires configuring the operating system's
dynamic linker to search the library directory; see
<xref linkend="install-post-shlibs"/> for more detail.
</para>
</listitem>
</varlistentry>
<varlistentry id="configure-binary-name-meson"> <varlistentry id="configure-binary-name-meson">
<term><option>-D<replaceable>BINARY_NAME</replaceable>=<replaceable>PATH</replaceable></option></term> <term><option>-D<replaceable>BINARY_NAME</replaceable>=<replaceable>PATH</replaceable></option></term>
<listitem> <listitem>

@ -2572,7 +2572,6 @@ default_target_args = {
default_lib_args = default_target_args + { default_lib_args = default_target_args + {
'name_prefix': '', 'name_prefix': '',
'install_rpath': ':'.join(lib_install_rpaths),
} }
internal_lib_args = default_lib_args + { internal_lib_args = default_lib_args + {
@ -2583,14 +2582,25 @@ internal_lib_args = default_lib_args + {
default_mod_args = default_lib_args + { default_mod_args = default_lib_args + {
'name_prefix': '', 'name_prefix': '',
'install_dir': dir_lib_pkg, 'install_dir': dir_lib_pkg,
'install_rpath': ':'.join(mod_install_rpaths),
} }
default_bin_args = default_target_args + { default_bin_args = default_target_args + {
'install_dir': dir_bin, 'install_dir': dir_bin,
'install_rpath': ':'.join(bin_install_rpaths),
} }
if get_option('rpath')
default_lib_args += {
'install_rpath': ':'.join(lib_install_rpaths),
}
default_mod_args += {
'install_rpath': ':'.join(mod_install_rpaths),
}
default_bin_args += {
'install_rpath': ':'.join(bin_install_rpaths),
}
endif
# Helper for exporting a limited number of symbols # Helper for exporting a limited number of symbols

@ -67,6 +67,9 @@ option('extra_version', type : 'string', value: '',
option('darwin_sysroot', type : 'string', value: '', option('darwin_sysroot', type : 'string', value: '',
description: 'select a non-default sysroot path') description: 'select a non-default sysroot path')
option('rpath', type : 'boolean', value: true,
description: 'whether to embed shared library search path in executables')
# External dependencies # External dependencies

@ -53,7 +53,7 @@ pgxs_kv = {
'abs_top_srcdir': meson.source_root(), 'abs_top_srcdir': meson.source_root(),
'enable_thread_safety': 'yes', 'enable_thread_safety': 'yes',
'enable_rpath': 'yes', 'enable_rpath': get_option('rpath') ? 'yes' : 'no',
'enable_nls': libintl.found() ? 'yes' : 'no', 'enable_nls': libintl.found() ? 'yes' : 'no',
'enable_tap_tests': tap_tests_enabled ? 'yes' : 'no', 'enable_tap_tests': tap_tests_enabled ? 'yes' : 'no',
'enable_debug': get_option('debug') ? 'yes' : 'no', 'enable_debug': get_option('debug') ? 'yes' : 'no',

Loading…
Cancel
Save