From 7779043081318e4e85328f0291e91f9e7bd42573 Mon Sep 17 00:00:00 2001 From: arichardson Date: Wed, 20 Nov 2019 17:24:49 +0000 Subject: [PATCH] Allow boostrapping xinstall on Linux Linux does not have st_flags so we have to avoid using it there. Reviewed By: emaste, imp Differential Revision: https://reviews.freebsd.org/D22446 --- usr.bin/xinstall/Makefile | 1 - usr.bin/xinstall/xinstall.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/usr.bin/xinstall/Makefile b/usr.bin/xinstall/Makefile index 1d9cb63510f1..4bc0d006cb98 100644 --- a/usr.bin/xinstall/Makefile +++ b/usr.bin/xinstall/Makefile @@ -11,7 +11,6 @@ MAN= install.1 .PATH: ${SRCTOP}/contrib/mtree CFLAGS+= -I${SRCTOP}/contrib/mtree CFLAGS+= -I${SRCTOP}/lib/libnetbsd -CFLAGS+= -DHAVE_STRUCT_STAT_ST_FLAGS=1 LIBADD= md diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index d9aca00d8efc..5510c9ab9aa4 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -75,6 +75,17 @@ __FBSDID("$FreeBSD$"); #include "mtree.h" +/* + * We need to build xinstall during the bootstrap stage when building on a + * non-FreeBSD system. Linux does not have the st_flags and st_birthtime + * members in struct stat so we need to omit support for changing those fields. + */ +#ifdef UF_SETTABLE +#define HAVE_STRUCT_STAT_ST_FLAGS 1 +#else +#define HAVE_STRUCT_STAT_ST_FLAGS 0 +#endif + #define MAX_CMP_SIZE (16 * 1024 * 1024) #define LN_ABSOLUTE 0x01