anitazha / rpms / ndctl

Forked from rpms/ndctl a year ago
Clone

Blame SOURCES/0213-meson.build-be-specific-for-library-path.patch

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