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

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