git: 8929675e11c0 - main - libmagic: Add swap.c and magic.h to SRCS.

From: Xin LI <delphij_at_FreeBSD.org>
Date: Sat, 05 Sep 2026 23:58:14 UTC
The branch main has been updated by delphij:

URL: https://cgit.FreeBSD.org/src/commit/?id=8929675e11c0c64ff96a2441082794980c9c6b2e

commit 8929675e11c0c64ff96a2441082794980c9c6b2e
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2026-09-05 01:03:17 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2026-09-05 23:57:30 +0000

    libmagic: Add swap.c and magic.h to SRCS.
    
    file 5.48 added swap.c and swap.h for byte-swapping operations, which are
    required on hosts that lack <byteswap.h> or <sys/bswap.h> (e.g. macOS cross-building
    or older FreeBSD bootstrap environments).
    
    Also add magic.h to SRCS so object files depend on the generated header
    before compiling, avoiding falling back to the host's /usr/include/magic.h
    during parallel builds.
    
    Reported by:    wosch
    MFC after:      1 week
    Fixes:          7af41682a96b ("MFV: file 5.48")
---
 lib/libmagic/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile
index fe04f5ea68c8..bbb02eb7e7bf 100644
--- a/lib/libmagic/Makefile
+++ b/lib/libmagic/Makefile
@@ -19,7 +19,9 @@ SRCS=	apprentice.c apptype.c ascmagic.c buffer.c cdf.c cdf_time.c \
 	compress.c der.c encoding.c fsmagic.c funcs.c is_json.c \
 	is_csv.c \
 	is_simh.c \
-	is_tar.c magic.c print.c readcdf.c readelf.c seccomp.c softmagic.c
+	is_tar.c magic.c print.c readcdf.c readelf.c seccomp.c softmagic.c \
+	swap.c
+SRCS+=	magic.h
 INCS=	magic.h
 
 MAGICPATH?=	/usr/share/misc
@@ -62,7 +64,7 @@ CLEANFILES+=	mkmagic
 DEPENDOBJS+=	mkmagic
 build-tools: mkmagic
 # For the non-dirdeps build, HOST_CC is CC by default
-mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} ${BUILD_TOOLS_META}
+mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c swap.c ${INCS} ${BUILD_TOOLS_META}
 	${HOST_CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \
 	    ${.ALLSRC:N*.h:O:u} ${LDADD}