From 248c11d375c54a8b5fc61c6659be2f8826e889ec Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 1 Jan 2021 11:26:48 +1100 Subject: [PATCH] pppd: Use a run-time test to detect libutil availability on Linux This tests whether logwtmp is declared in , 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 --- pppd/Makefile.linux | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux index 15fb8da..958cc29 100644 --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux @@ -1,6 +1,6 @@ # # 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 @@ -78,8 +78,10 @@ PLUGIN=y # Enable EAP SRP-SHA1 authentication (requires libsrp) #USE_SRP=y -# Use libutil +# Use libutil; test if logwtmp is declared in to detect +ifeq ($(shell echo '\#include ' | $(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 -- 2.39.2