Skip to content

Commit 41fa74f

Browse files
committed
build c2str.exe with the host compiler; default it to gcc if cross prefix given
1 parent b39cbc7 commit 41fa74f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ endif
256256
$S./c2str.exe $< $@
257257

258258
c2str.exe : conftest.c
259-
$S$(CC) -DC2STR $< -o $@
259+
$S$(HOST_CC) -DC2STR $< -o $@
260260

261261
# target specific object rule
262262
$(X)%.o : %.c $(LIBTCC_INC)

configure

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ build_cross=
5858
test -n "$CC" && cc="$CC"
5959
test -n "$AR" && ar="$AR"
6060

61+
host_cc="$CC"
62+
6163
# set default CFLAGS if unset in environment
6264
test -z "$CFLAGS" && CFLAGS="-Wall -O2"
6365

@@ -122,7 +124,7 @@ for opt do
122124
;;
123125
--source-path=*) assign_opt "$opt" source_path
124126
;;
125-
--cross-prefix=*) assign_opt "$opt" cross_prefix
127+
--cross-prefix=*) assign_opt "$opt" cross_prefix; assign_opt "gcc" host_cc
126128
;;
127129
--os-release=*) assign_opt "$opt" os_release
128130
;;
@@ -584,6 +586,7 @@ mandir=\$(DESTDIR)$mandir
584586
infodir=\$(DESTDIR)$infodir
585587
docdir=\$(DESTDIR)$docdir
586588
CC=$cc
589+
HOST_CC=$host_cc
587590
CC_NAME=$cc_name
588591
GCC_MAJOR=$gcc_major
589592
GCC_MINOR=$gcc_minor

0 commit comments

Comments
 (0)