git: 572900bd93fd - releng/13.2 - stand: fix build userboot without zfs

From: Warner Losh <imp_at_FreeBSD.org>
Date: Thu, 02 Mar 2023 17:10:19 UTC
The branch releng/13.2 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=572900bd93fdbbc2b42f0ad7374f390d8dd54de8

commit 572900bd93fdbbc2b42f0ad7374f390d8dd54de8
Author:     Michael Paepcke <git@paepcke.de>
AuthorDate: 2023-02-28 02:58:03 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-03-02 17:09:32 +0000

    stand: fix build userboot without zfs
    
    Fix regression in building userboot -DWITHOUT_LOADER_ZFS
    
    Fixes: e307eb94ae520
    MFC After: 3 days
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/665
    Approved by: re@ (cperciva)
    
    (cherry picked from commit 4d59545d0cacb5881e2515eecce15e8478f07276)
    (cherry picked from commit 3464fc5f2a3376b4cd5612f1ee0986072b4a65f3)
---
 stand/userboot/userboot/Makefile | 4 ++++
 stand/userboot/userboot/main.c   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/stand/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile
index 43011b9577c9..986bfdccfdd6 100644
--- a/stand/userboot/userboot/Makefile
+++ b/stand/userboot/userboot/Makefile
@@ -36,9 +36,13 @@ SRCS+=		gfx_fb_stub.c
 
 CFLAGS+=	-Wall
 CFLAGS+=	-I${BOOTSRC}/userboot
+
+.if ${MK_LOADER_ZFS} != "no"
 CFLAGS.main.c+=	-I${BOOTSRC}/libsa/zfs
 CFLAGS.main.c+=	-I${SYSDIR}/contrib/openzfs/include
 CFLAGS.main.c+=	-I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs
+.endif
+
 CWARNFLAGS.main.c += -Wno-implicit-function-declaration
 CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken
 
diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c
index 40911f35020a..b134d86de9bd 100644
--- a/stand/userboot/userboot/main.c
+++ b/stand/userboot/userboot/main.c
@@ -32,13 +32,13 @@ __FBSDID("$FreeBSD$");
 #include <string.h>
 #include <setjmp.h>
 #include <sys/disk.h>
-#include <sys/zfs_bootenv.h>
 
 #include "bootstrap.h"
 #include "disk.h"
 #include "libuserboot.h"
 
 #if defined(USERBOOT_ZFS_SUPPORT)
+#include <sys/zfs_bootenv.h>
 #include "libzfs.h"
 
 static void userboot_zfs_probe(void);