From 41fa74fc8485be8e7f6eb92de93997d8e3b0a7f7 Mon Sep 17 00:00:00 2001 From: Urja Rannikko Date: Sat, 17 Jan 2026 20:47:00 +0200 Subject: [PATCH] build c2str.exe with the host compiler; default it to gcc if cross prefix given --- Makefile | 2 +- configure | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d21f1cad..56c27c16 100644 --- a/Makefile +++ b/Makefile @@ -256,7 +256,7 @@ endif $S./c2str.exe $< $@ c2str.exe : conftest.c - $S$(CC) -DC2STR $< -o $@ + $S$(HOST_CC) -DC2STR $< -o $@ # target specific object rule $(X)%.o : %.c $(LIBTCC_INC) diff --git a/configure b/configure index c1abffc9..2217029c 100755 --- a/configure +++ b/configure @@ -58,6 +58,8 @@ build_cross= test -n "$CC" && cc="$CC" test -n "$AR" && ar="$AR" +host_cc="$CC" + # set default CFLAGS if unset in environment test -z "$CFLAGS" && CFLAGS="-Wall -O2" @@ -122,7 +124,7 @@ for opt do ;; --source-path=*) assign_opt "$opt" source_path ;; - --cross-prefix=*) assign_opt "$opt" cross_prefix + --cross-prefix=*) assign_opt "$opt" cross_prefix; assign_opt "gcc" host_cc ;; --os-release=*) assign_opt "$opt" os_release ;; @@ -584,6 +586,7 @@ mandir=\$(DESTDIR)$mandir infodir=\$(DESTDIR)$infodir docdir=\$(DESTDIR)$docdir CC=$cc +HOST_CC=$host_cc CC_NAME=$cc_name GCC_MAJOR=$gcc_major GCC_MINOR=$gcc_minor