use $cross_compiling that autotools already set up rather than trying to
do a custom & fragile job with compiler names

configure.in also needs AC_SUBST(cross_compiling) ...

http://bugs.gentoo.org/288881

--- a/configure
+++ b/configure
@@ -17300,6 +17300,7 @@
 s,@build_alias@,$build_alias,;t t
 s,@host_alias@,$host_alias,;t t
 s,@target_alias@,$target_alias,;t t
+s,@cross_compiling@,$cross_compiling,;t t
 s,@ECHO_C@,$ECHO_C,;t t
 s,@ECHO_N@,$ECHO_N,;t t
 s,@ECHO_T@,$ECHO_T,;t t
--- a/misc/run_tic.in
+++ b/misc/run_tic.in
@@ -52,8 +52,7 @@
 : ${ticdir=@TERMINFO@}
 : ${source=@TERMINFO_SRC@}
 : ${LN_S="@LN_S@"}
-: ${THAT_CC=cc}
-: ${THIS_CC=cc}
+: ${cross_compiling=@cross_compiling@}
 : ${ext_funcs=@NCURSES_EXT_FUNCS@}
 
 test -z "${DESTDIR}" && DESTDIR=
@@ -61,7 +60,7 @@
 # Allow tic to run either from the install-path, or from the build-directory.
 # Do not do this if we appear to be cross-compiling.  In that case, we rely
 # on the host's copy of tic to compile the terminfo database.
-if test "$THAT_CC" = "$THIS_CC" ; then
+if test "$cross_compiling" != "yes" ; then
 case "$PATH" in
 :*) PATH=../progs:../lib:${DESTDIR}$bindir$PATH ;;
 *) PATH=../progs:../lib:${DESTDIR}$bindir:$PATH ;;
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -59,6 +59,7 @@
 
 CC		= @CC@
 HOSTCC		= @BUILD_CC@
+cross_compiling	= @cross_compiling@
 
 tabsetdir	= $(datadir)/tabset
 ticdir		= @TERMINFO@
@@ -91,8 +92,7 @@
 	datadir=${datadir} \
 	ticdir=${ticdir} \
 	source=terminfo.tmp \
-	THIS_CC="$(CC)" \
-	THAT_CC="$(HOSTCC)" \
+	cross_compiling="${cross_compiling}" \
 	$(SHELL) ./run_tic.sh
 	@cd $(srcdir)/tabset && \
 		$(SHELL) -c 'for i in * ; do \