diff -Naur libcap-2.65.orig/Make.Rules libcap-2.65/Make.Rules --- libcap-2.65.orig/Make.Rules 2022-08-25 21:32:12.478981513 -0400 +++ libcap-2.65/Make.Rules 2022-08-25 21:33:55.027444454 -0400 @@ -63,7 +63,7 @@ KERNEL_HEADERS := $(topdir)/libcap/include/uapi LIBCAP_INCLUDES = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -SYSTEM_HEADERS = /usr/include +SYSTEM_HEADERS = $(SYSROOT)/usr/include SUDO := sudo CC := $(CROSS_COMPILE)gcc @@ -121,7 +121,7 @@ # Force enabled with "make DYNAMIC=yes ...". DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo $(SHARED); else echo no ; fi) -PAM_CAP ?= $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo $(SHARED) ; else echo no ; fi) +PAM_CAP ?= $(shell if [ -f $(SYSTEM_HEADERS)/security/pam_modules.h ]; then echo $(SHARED) ; else echo no ; fi) # If your system does not support pthreads, override this as "no". #