kumquat-buildroot/package/mupdf/0004-Makefile-compile-hexdump.exe-with-HOSTCC.patch

41 lines
1.2 KiB
Diff
Raw Normal View History

From c0036573a995dc78d3cf60a30ff0af2b47f3680a Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 14 Nov 2021 23:24:27 +0100
Subject: [PATCH] Makefile: compile hexdump.exe with HOSTCC
hexdump.exe must be compiled for the host or the build will fail when
cross-compiling with HAVE_OBJCOPY=no
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://bugs.ghostscript.com/show_bug.cgi?id=704442]
---
Makefile | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Makefile b/Makefile
index 6492b1ca3..0732b358f 100644
--- a/Makefile
+++ b/Makefile
@@ -60,6 +60,8 @@ AR_CMD = $(QUIET_AR) $(MKTGTDIR) ; $(AR) cr $@ $^
ifdef RANLIB
RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
endif
+HOSTCC ?= $(CC)
+HOST_LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(HOSTCC) -o $@ $^
LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p --exclude=platform/python --exclude=platform/c++
WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
@@ -81,6 +83,9 @@ $(OUT)/%.a :
$(AR_CMD)
$(RANLIB_CMD)
+$(OUT)/scripts/hexdump.exe: scripts/hexdump.c
+ $(HOST_LINK_CMD)
+
$(OUT)/%.exe: %.c
$(LINK_CMD)
--
2.33.0