]> 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>
Wed, 23 Jan 2019 11:20:47 +0000 (12:20 +0100)
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 4c8de521f71d7b4d58428b92ab86477b5861eb4f..0bf422cda228fc2b628ea8c03b3c2b9951c6d937 100644 (file)
@@ -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