Skip to content

Commit

Permalink
meson.build: be specific for library path
Browse files Browse the repository at this point in the history
If you run the typical configure script on a typical linux software
project say with ./configure --prefix=/usr/ then the libdir defaults
to /usr/lib/ however this is not true with meson.

With meson the current libdir path follows the one set by the prefix,
and so with the current setup with prefix forced by default to /usr/
we end up with libdir set to /usr/ as well and so libraries built
and installed also placed into /usr/ as well, not /usr/lib/ as we
would typically expect.

So you if you use today's defaults you end up with the libraries placed
into /usr/ and then a simple error such as:

cxl: error while loading shared libraries: libcxl.so.1: cannot open shared object file: No such file or directory

Folks may have overlooked this as their old library is still usable.

Fix this by forcing the default library path to /usr/lib, and so
requiring users to set both prefix and libdir if they want to
customize both.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Luis Chamberlain <[email protected]>
Signed-off-by: Vishal Verma <[email protected]>
  • Loading branch information
mcgrof authored and stellarhopper committed Aug 19, 2022
1 parent 9ce0fa9 commit 9a993ce
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ project('ndctl', 'c',
default_options : [
'c_std=gnu99',
'prefix=/usr',
'libdir=/usr/lib',
'sysconfdir=/etc',
'localstatedir=/var',
],
Expand Down

0 comments on commit 9a993ce

Please sign in to comment.