Skip to contentSkip to conversation

build-sys: fix crypt() detection without -lcrypt

PATCH Applied Johannes Nixdorf 2 participants 2 messages Jan 22, 2019 – Jan 23, 2019 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build-sys: fix crypt() detection without -lcrypt

The check tested whether code using crypt() links without -lcrypt, but didn't set have_crypt to yes if it succeeded.

This fixes the check erroneously failing when compiling against musl libc.

---
 configure.ac | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
configure.ac +4 -1
index 4c8de521f..0bf422cda 100644
@@ -798,7 +798,10 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #endif
 ]], [[
 char *c = crypt("abc","pw");
-]])],[],[
+]])],[
+  have_libcrypt=no
+  have_crypt=yes
+],[
   LIBS="$LIBS -lcrypt"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
   #ifdef HAVE_CRYPT_H
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Johannes Nixdorf
 configure.ac | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com