From a4f9e3cf4c3580bf9e155c4918926010a32c5fcd Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev@web.de>
Date: Sun, 15 May 2022 23:18:41 +0200
Subject: [PATCH] configure: Use the environment variable CC when compiling tcc
 (resend)

Using the environment CC is a common used feature to
select a compiler to build any software,
so it should be supported when building tcc.

The old way using the parameter --cc still works.

(resend)

Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
---
 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 289987ad..cd96ea30 100755
--- a/configure
+++ b/configure
@@ -27,7 +27,8 @@ mandir=""
 infodir=""
 sysroot=""
 cross_prefix=""
-cc="gcc"
+test -z "$CC" && CC="gcc"
+test -z "$cc" && cc="$CC"
 ar="ar"
 bigendian="no"
 mingw32="no"
@@ -45,7 +46,7 @@ confvars=
 suggest="yes"
 gcc_major=0
 gcc_minor=0
-cc_name="gcc"
+cc_name="$cc"
 ar_set=
 darwin=
 cpu=