[PATCH] configure.ac: crypt related fix for musl libc

maxin.john at gmail.com maxin.john at gmail.com
Tue May 24 11:40:27 UTC 2016


From: "Maxin B. John" <maxin.john at intel.com>

This patch fixes a case where it find crypt defined in libc (musl) but
not in specified libraries then it ends up assigning
LIBCRYPT="-l" which then goes into makefile cause all sort of problems
e.g.

ld: cannot find -l-m32
| collect2: error: ld returned 1 exit status

The reason is that -l appears on commandline without any library and compiler
treats the next argument as library name whatever it is.

Signed-off-by: Khem Raj <raj.khem at gmail.com>
Signed-off-by: Maxin B. John <maxin.john at intel.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index df39d07..e68d856 100644
--- a/configure.ac
+++ b/configure.ac
@@ -401,7 +401,7 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" = "xyes"],
   [crypt_libs="crypt"])
 
 BACKUP_LIBS=$LIBS
-AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="${ac_lib:+-l$ac_lib}", LIBCRYPT="")
+AC_SEARCH_LIBS([crypt],[$crypt_libs], [test "$ac_cv_search_crypt" = "none required" || LIBCRYPT="$ac_cv_search_crypt"])
 AC_CHECK_FUNCS(crypt_r crypt_gensalt_r)
 LIBS=$BACKUP_LIBS
 AC_SUBST(LIBCRYPT)
-- 
2.4.0




More information about the Pam-list mailing list