diff options
author | Andres Freund <andres@anarazel.de> | 2022-09-26 19:44:05 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2022-09-26 19:44:05 -0700 |
commit | a1860071b3fc6b9475a09f0c306e432249bb8314 (patch) | |
tree | 5100e7b004be40b4f1f4f4479e8572ed19008540 | |
parent | 1330dcdec0f22fb2b7a621f9a0e6e729e21d50a4 (diff) | |
download | postgresql-a1860071b3fc6b9475a09f0c306e432249bb8314.tar.gz postgresql-a1860071b3fc6b9475a09f0c306e432249bb8314.zip |
meson: Set up absolute rpaths to libdir
While I (Andres) had planned to use relative rpaths, it looks like agreeing on
the precise path might take a bit. So set up absolute rpaths for now.
I'm pushing this fairly quickly after posting the patch as several hackers
fought with this issue.
Discussion: https://postgr.es/m/20220927011951.j3h4o7n6bhf7dwau@awork3.anarazel.de
-rw-r--r-- | meson.build | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 474a42a2559..38b2c3aae2e 100644 --- a/meson.build +++ b/meson.build @@ -2471,9 +2471,22 @@ bin_install_rpaths = [] lib_install_rpaths = [] mod_install_rpaths = [] -# Add extra_lib_dirs to rpath. Not needed on darwin, as the install_name of -# libraries in extra_lib_dirs will be used anyway. + +# Don't add rpaths on darwin for now - as long as only absolute references to +# libraries are needed, absolute LC_ID_DYLIB ensures libraries can be found in +# their final destination. if host_system != 'darwin' + # Add absolute path to libdir to rpath. This ensures installed binaries / + # libraries find our libraries (mainly libpq). + bin_install_rpaths += dir_prefix / dir_lib + lib_install_rpaths += dir_prefix / dir_lib + mod_install_rpaths += dir_prefix / dir_lib + + # Add extra_lib_dirs to rpath. This ensures we find libraries we depend on. + # + # Not needed on darwin even if we use relative rpaths for our own libraries, + # as the install_name of libraries in extra_lib_dirs will point to their + # location anyway. bin_install_rpaths += postgres_lib_d lib_install_rpaths += postgres_lib_d mod_install_rpaths += postgres_lib_d |