Fix crypt.h detection

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
Nikos Mavrogiannopoulos
2020-03-12 17:11:51 +01:00
committed by Nikos Mavrogiannopoulos
parent 780fbb89a0
commit 13b92d3b11

View File

@@ -323,8 +323,16 @@ fi
gl_INIT
AC_CHECK_HEADERS([net/if_tun.h linux/if_tun.h netinet/in_systm.h crypt.h], [], [], [])
if test "$ac_cv_header_crypt_h" = yes;then
crypt_header="crypt.h"
else
crypt_header="unistd.h"
fi
AC_LIB_HAVE_LINKFLAGS(crypt,, [#define _XOPEN_SOURCE
#include <unistd.h>], [crypt(0,0);])
#include <${crypt_header}>], [crypt(0,0);])
AC_ARG_WITH(utmp,
AS_HELP_STRING([--without-utmp], [do not use libutil for utmp support]),
@@ -358,8 +366,6 @@ AC_CHECK_MEMBER([struct sockaddr.sa_len],
#include <sys/socket.h>
])
AC_CHECK_HEADERS([net/if_tun.h linux/if_tun.h netinet/in_systm.h crypt.h], [], [], [])
AC_CHECK_FUNCS([setproctitle vasprintf clock_gettime isatty pselect ppoll getpeereid sigaltstack])
AC_CHECK_FUNCS([strlcpy posix_memalign malloc_trim strsep])