From 3b32a7ece09a4652a5fd6186aa059fd0e2163f5a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 17 Nov 2019 14:45:42 +0100 Subject: Make libcrypt really optional * configure.ac (--without-libcrypt): Add option. Only test for libcrypt if it is not set. * utils/Makefile (login-LDLIBS, addauth-LDLIBS, setauth-LDLIBS): Only add -lcrypt when libcrypt is available. --- configure.ac | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index af04d051..897a9146 100644 --- a/configure.ac +++ b/configure.ac @@ -170,11 +170,15 @@ AC_CHECK_FUNCS(file_futimens) AC_DEFINE([UTIME_NOW],[-1]) AC_DEFINE([UTIME_OMIT],[-2]) -AC_CHECK_LIB([crypt], [crypt], - [HAVE_LIBCRYPT=1 - AC_DEFINE([HAVE_LIBCRYPT], [1], [Use libcrypt])]) -AC_SUBST([HAVE_LIBCRYPT]) +AC_ARG_WITH([libcrypt], + [AS_HELP_STRING([--without-libcrypt], [disable libcrypt])], , [with_libcrypt=yes]) +AS_IF([test "x$with_libcrypt" != xno], [ + AC_CHECK_LIB([crypt], [crypt], + [HAVE_LIBCRYPT=1 + AC_DEFINE([HAVE_LIBCRYPT], [1], [Use libcrypt])]) +]) +AC_SUBST([HAVE_LIBCRYPT]) # From glibc HEAD, 2007-11-07. AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl -- cgit v1.2.3