util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] build-sys: fix crypt() detection without -lcrypt
@ 2019-01-22 18:17 Johannes Nixdorf
  2019-01-23 11:24 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Nixdorf @ 2019-01-22 18:17 UTC (permalink / raw)
  To: util-linux; +Cc: Johannes Nixdorf

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.

Signed-off-by: Johannes Nixdorf <mixi@shadowice.org>
---
 configure.ac | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 4c8de521f..0bf422cda 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-23 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 18:17 [PATCH] build-sys: fix crypt() detection without -lcrypt Johannes Nixdorf
2019-01-23 11:24 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).