This tests whether logwtmp is declared in <utmp.h>, and if not we
assume we need to include our own logwtmp implementation. We assume
that if logwtmp is provided by the system then we need -lutil to get
it (as is the case for glibc).
This fixes compilation with musl libc and other libcs that don't
provide logwtmp.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
#
# pppd makefile for Linux
-# $Id: Makefile.linux,v 1.70 2007/06/19 02:08:34 carlsonj Exp $
+# Processed by configure to produce pppd/Makefile
#
# Default installation locations
# Enable EAP SRP-SHA1 authentication (requires libsrp)
#USE_SRP=y
-# Use libutil
+# Use libutil; test if logwtmp is declared in <utmp.h> to detect
+ifeq ($(shell echo '\#include <utmp.h>' | $(CC) -E - 2>/dev/null | grep -q logwtmp && echo yes),yes)
USE_LIBUTIL=y
+endif
# Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
USE_EAPTLS=y