anitazha / rpms / ndctl

Forked from rpms/ndctl 2 years ago
Clone
Jeff Moyer 2c91dc
From 9a993ce24fdd5de45774b65211570dd514cdf61d Mon Sep 17 00:00:00 2001
Jeff Moyer 2c91dc
From: Luis Chamberlain <mcgrof@kernel.org>
Jeff Moyer 2c91dc
Date: Wed, 17 Aug 2022 18:23:04 -0700
Jeff Moyer 2c91dc
Subject: [PATCH 213/217] meson.build: be specific for library path
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
If you run the typical configure script on a typical linux software
Jeff Moyer 2c91dc
project say with ./configure --prefix=/usr/ then the libdir defaults
Jeff Moyer 2c91dc
to /usr/lib/ however this is not true with meson.
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
With meson the current libdir path follows the one set by the prefix,
Jeff Moyer 2c91dc
and so with the current setup with prefix forced by default to /usr/
Jeff Moyer 2c91dc
we end up with libdir set to /usr/ as well and so libraries built
Jeff Moyer 2c91dc
and installed also placed into /usr/ as well, not /usr/lib/ as we
Jeff Moyer 2c91dc
would typically expect.
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
So you if you use today's defaults you end up with the libraries placed
Jeff Moyer 2c91dc
into /usr/ and then a simple error such as:
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
cxl: error while loading shared libraries: libcxl.so.1: cannot open shared object file: No such file or directory
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
Folks may have overlooked this as their old library is still usable.
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
Fix this by forcing the default library path to /usr/lib, and so
Jeff Moyer 2c91dc
requiring users to set both prefix and libdir if they want to
Jeff Moyer 2c91dc
customize both.
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
Link: https://lore.kernel.org/r/Yv2UeCIcA00lJC5j@bombadil.infradead.org
Jeff Moyer 2c91dc
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Jeff Moyer 2c91dc
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Jeff Moyer 2c91dc
---
Jeff Moyer 2c91dc
 meson.build | 1 +
Jeff Moyer 2c91dc
 1 file changed, 1 insertion(+)
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
diff --git a/meson.build b/meson.build
Jeff Moyer 2c91dc
index aecf461..802b38c 100644
Jeff Moyer 2c91dc
--- a/meson.build
Jeff Moyer 2c91dc
+++ b/meson.build
Jeff Moyer 2c91dc
@@ -9,6 +9,7 @@ project('ndctl', 'c',
Jeff Moyer 2c91dc
   default_options : [
Jeff Moyer 2c91dc
     'c_std=gnu99',
Jeff Moyer 2c91dc
     'prefix=/usr',
Jeff Moyer 2c91dc
+    'libdir=/usr/lib',
Jeff Moyer 2c91dc
     'sysconfdir=/etc',
Jeff Moyer 2c91dc
     'localstatedir=/var',
Jeff Moyer 2c91dc
   ],
Jeff Moyer 2c91dc
-- 
Jeff Moyer 2c91dc
2.27.0
Jeff Moyer 2c91dc