From 13b92d3b11866e37b16556bcea0f724e874f98ea Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 12 Mar 2020 17:11:51 +0100 Subject: [PATCH] Fix crypt.h detection Signed-off-by: Nikos Mavrogiannopoulos --- configure.ac | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 46785539..c622c580 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ], [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 ]) -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])