Skip to content

Commit

Permalink
meson: allow to fallback to use libxcrypt.pc or glibc's libcrypt
Browse files Browse the repository at this point in the history
Some distributions still use glibc's libcrypt. In that case, libcrypt.pc
does not exist and dependency() will fail.
Also, even if libxcrypt is used, there may not be a symlink
from libcrypt.pc to libxcrypt.pc. So, let's add a secondary name.

Follow-up for d625f71.

Fixes #28289.
  • Loading branch information
yuwata authored and bluca committed Jul 7, 2023
1 parent 91c96f9 commit 5557378
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,11 @@ threads = dependency('threads')
librt = cc.find_library('rt')
libm = cc.find_library('m')
libdl = cc.find_library('dl')
libcrypt = dependency('libcrypt')
libcrypt = dependency('libcrypt', 'libxcrypt', required : false)
if not libcrypt.found()
# fallback to use find_library() if libcrypt is provided by glibc, e.g. for LibreELEC.
libcrypt = cc.find_library('crypt')
endif
libcap = dependency('libcap')

# On some architectures, libatomic is required. But on some installations,
Expand Down

0 comments on commit 5557378

Please sign in to comment.