In message <[EMAIL PROTECTED]>, "Paul D. Smith" writes:
> 1) Have AC_CANONICAL_HOST require AC_PROG_CC, as Ossama suggested. One
> problem here is that not all runs of config.guess _do_ require a C
> compiler, and it's a minor drag that you can't use AC_CANONICAL_HOST
> without a C compiler; couldn't we write a configure.in for some
> system that _didn't_ need a C compiler? Or is that already right out?
It should be possible. In fact I believe autoconf's own configure.in
is just such a beast.
BTW this problem doesn't just occur on RedHat Linux boxes without a C
compiler. I have a RedHat 6.1 box here which has gcc installed, but
only as `gcc' and not as `cc'. I'm not totally sure how it got this
way since the egcs rpm does have /usr/bin/cc in. I suspect I built
gcc-2.95.2 from scratch with egcs-1.1.2 and then uninstalled egcs to
make sure that nothing could use it by mistake.
Anyway, if CC, HOST_CC, and CC_FOR_BUILD are all unset then
config.guess just tries `cc', fails to find it, and dies with the
unhelpful "can not guess host type; you must specify one".
I'm fairly sure I've seen other machines with gcc installed but not as
cc (typically when the vendor charges for the compiler and so a
prebuilt gcc has been installed).
Perhaps a patch along these lines is appropriate:
--- config.guess 1999/10/31 01:16:52 1.158
+++ config.guess 2000/02/28 23:51:34
@@ -45,7 +45,12 @@
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
- CC_FOR_BUILD=cc
+ cc > /dev/null 2> /dev/null
+ if test $? != 127; then
+ CC_FOR_BUILD=cc
+ else
+ CC_FOR_BUILD=gcc
+ fi
fi
fi
fi
Problem with this as it stands is that it will try to run `cc' unless
CC, HOST_CC, or CC_FOR_BUILD is set, even though it is never used on
many platforms. This may incur a noticable overhead.
Cheers,
Olly