Skip to content

Commit

Permalink
meson: Don't look for libraries in lib dir
Browse files Browse the repository at this point in the history
1. First of all, this doesn't work in nixpkgs. Per [1], gcc ignores `-L`
   for purposes of `--print-file-dirs`, which breaks horribly on linux. But
   if we don't pass extra dirs, meosn first just tries `-l...`, which does
   work.

2. Even if it did work, `libdir` means where we are installing libs, not
   where libs are expected to be found. Those are not necessarily the
   same (again, nixpkgs), and even when they are and non-standard, it is
   better to use DESTDIR or have a modified toolchain.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87758
  • Loading branch information
Ericson2314 committed Oct 25, 2019
1 parent 7ae66bb commit a142164
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ tar = find_program('tar', required : true)
bzip2 = find_program('bzip2', required : true)
gzip = find_program('gzip', required : true)
xz = find_program('xz', required : true)
dot = find_program('dot', required : true)
lsof = find_program('lsof', required : true)
dot = find_program('dot', required : false)
lsof = find_program('lsof', required : false)
tr = find_program('tr', required : true)
coreutils = run_command('dirname', cat.path()).stdout().strip()

Expand Down Expand Up @@ -377,9 +377,9 @@ description : 'Whether link() works on symlinks')
#--------------------------------------------------
boost_dep = declare_dependency(
dependencies : [
cpp.find_library('libboost_system', dirs : libdir),
cpp.find_library('libboost_context', dirs : libdir),
cpp.find_library('libboost_thread', dirs : libdir)],
cpp.find_library('boost_system'),
cpp.find_library('boost_context'),
cpp.find_library('boost_thread')],
link_args : get_option('boost_link_args'))

if (boost_dep.found())
Expand All @@ -406,7 +406,7 @@ libbrotli_dep = declare_dependency(
# Look for OpenSSL, a required dependency.
#--------------------------------------------------
openssl_dep = declare_dependency(
dependencies: cpp.find_library('libssl', dirs : libdir),
dependencies: cpp.find_library('ssl'),
link_args : get_option('openssl_link_args'))


Expand Down Expand Up @@ -434,14 +434,14 @@ pthread_dep = declare_dependency(
# Look for libdl, a required dependency.
#--------------------------------------------------
libdl_dep = declare_dependency(
dependencies : cpp.find_library('dl', dirs : libdir),
dependencies : cpp.find_library('dl'),
link_args : get_option('dl_link_args'))


# Look for libbz2, a required dependency.
#--------------------------------------------------
libbz2_dep = declare_dependency(
dependencies : cpp.find_library('bz2', dirs : libdir),
dependencies : cpp.find_library('bz2'),
link_args : get_option('bz2_link_args'))


Expand All @@ -453,7 +453,7 @@ libbz2_dep = declare_dependency(
# editline.h when the pkg-config approach fails.

editline_dep = declare_dependency(
dependencies : cpp.find_library('libeditline'),
dependencies : cpp.find_library('editline'),
link_args : get_option('editline_link_args'))

if not (
Expand All @@ -476,7 +476,7 @@ endif
#--------------------------------------------------
if (get_option('with_libsodium'))
libsodium_dep = declare_dependency(
dependencies : cpp.find_library('libsodium', dirs : libdir),
dependencies : cpp.find_library('sodium'),
link_args : get_option('sodium_link_args'))
config_h.set('HAVE_SODIUM', 1, description : 'Whether to use libsodium for cryptography.')
else
Expand Down

0 comments on commit a142164

Please sign in to comment.