aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2019-11-20 17:24:49 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2019-11-20 17:24:49 +0000
commit52918a7b1bb332952a8871f182138cbfe4aec64d (patch)
treec23e1626cc5ebfc6a4a49019872dc2977a4432b4 /usr.bin
parent7cef5cac04a75733803482ab4a7ddb4388b477e6 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/xinstall/Makefile1
-rw-r--r--usr.bin/xinstall/xinstall.c11
2 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/xinstall/Makefile b/usr.bin/xinstall/Makefile
index 1d9cb63510f18..4bc0d006cb980 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 d9aca00d8efce..5510c9ab9aa4d 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