Skip to content

Commit

Permalink
libmagic: Use HOST_CC when compiling hostprog used by build
Browse files Browse the repository at this point in the history
The "mkmagic" program should be built with the host compiler.

Only use BTOOLSPATH if not building for host

Obtained from:	Juniper Networks, Inc.
Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D44539
  • Loading branch information
Stephen J. Kiernan authored and Stephen J. Kiernan committed Mar 27, 2024
1 parent a6d8dcb commit 39f6f6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/libmagic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ magic.mgc: magic
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}
${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \
${HOST_CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} \
${.ALLSRC:N*.h:O:u} ${LDADD}

.endif
.if ${MK_DIRDEPS_BUILD} == "yes"
.if ${MK_DIRDEPS_BUILD} == "yes" && ${MACHINE} != "host"
BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR}
.else
magic.mgc: mkmagic
Expand Down

0 comments on commit 39f6f6f

Please sign in to comment.