]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: fix crypt() detection without -lcrypt
authorJohannes Nixdorf <mixi@shadowice.org>
Tue, 22 Jan 2019 18:17:55 +0000 (19:17 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Apr 2019 10:16:53 +0000 (12:16 +0200)
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

index a24c6d8ab389dd6cf5572e662c1e7c6f4dc1235e..0353c0ca830194ca48844b344086ccd67107eae0 100644 (file)
@@ -792,7 +792,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