summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Dale <richard.dale@codethink.co.uk>2015-03-21 10:20:18 +0000
committerRichard Dale <richard.dale@codethink.co.uk>2015-03-22 07:32:01 +0000
commit245d1f20bb7d9dbbc0456e3d0d0c50ecd8b0054a (patch)
tree7f0936274292afa3b2d8a8d55a5e6ff4c150622a
parent93f57afe30ac586b88afac11aaef7d5610d06656 (diff)
downloadlinux-pam-245d1f20bb7d9dbbc0456e3d0d0c50ecd8b0054a.tar.gz
Handle the case when no crypt library is needed by a libc such as musl
-rwxr-xr-xconfigure11
-rw-r--r--configure.in9
2 files changed, 17 insertions, 3 deletions
diff --git a/configure b/configure
index 443c1d3..66f0e7d 100755
--- a/configure
+++ b/configure
@@ -13456,9 +13456,9 @@ $as_echo "$ac_cv_search_crypt" >&6; }
ac_res=$ac_cv_search_crypt
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- LIBCRYPT="-l$ac_lib"
+ lib_crypt="$ac_lib"
else
- LIBCRYPT=""
+ lib_crypt=""
fi
for ac_func in crypt_r crypt_gensalt_r
@@ -13475,6 +13475,13 @@ done
LIBS=$BACKUP_LIBS
+if test -z "$lib_crypt" ; then
+ LIBCRYPT=""
+else
+ LIBCRYPT="-l$lib_crypt"
+fi
+
+
if test "$LIBCRYPT" = "-lxcrypt" -a "$ac_cv_header_xcrypt_h" = "yes" ; then
$as_echo "#define HAVE_LIBXCRYPT 1" >>confdefs.h
diff --git a/configure.in b/configure.in
index 0da9c55..f56e01e 100644
--- a/configure.in
+++ b/configure.in
@@ -404,9 +404,16 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" = "xyes"],
[crypt_libs="crypt"])
BACKUP_LIBS=$LIBS
-AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
+AC_SEARCH_LIBS([crypt],[$crypt_libs], lib_crypt="$ac_lib", lib_crypt="")
AC_CHECK_FUNCS(crypt_r crypt_gensalt_r)
LIBS=$BACKUP_LIBS
+
+if test -z "$lib_crypt" ; then
+ LIBCRYPT=""
+else
+ LIBCRYPT="-l$lib_crypt"
+fi
+
AC_SUBST(LIBCRYPT)
if test "$LIBCRYPT" = "-lxcrypt" -a "$ac_cv_header_xcrypt_h" = "yes" ; then
AC_DEFINE([HAVE_LIBXCRYPT], 1, [Define to 1 if xcrypt support should be compiled in.])