?RCS: $Id$
?RCS:
?RCS: Copyright (c) 2000, Jarkko Hietaniemi
-?RCS:
-?X:
+?RCS:
+?X:
?X: This unit produces a bit of shell code that must be dotted in order
?X: to make quick check on whether the current C compiler is working.
-?X:
+?X:
?MAKE:Checkcc ccname ccversion: rm cat test Myread startsh
?MAKE: -pick add $@ %<
?S:ccname:
# The most common problem is -D_REENTRANT for threads.
# This heuristic catches that case, but gets false positives
# if -Dusethreads was not actually specified. Better to
- # bail out here with a useful message than fail
+ # bail out here with a useful message than fail
# mysteriously later. Should we perhaps just try to
# re-invoke Configure -Dcc=gcc config_args ?
if $test -f usethreads.cbu; then
- $cat >&4 <<EOM
+ $cat >&4 <<EOM
*** However, any setting of the C compiler flags (e.g. for thread support)
*** will be lost. It may be necessary for you to restart Configure and
if $test -f UU/myread; then
. ./UU/myread
else
- echo "Cannot find myread, sorry. Aborting." >&2
+ echo "Cannot find myread, sorry. Aborting." >&4
exit 1
fi
- fi
+ fi
case "$ans" in
[yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
esac
$startsh
EOS
cat <<'EOSC' >>checkcc
-case "$cc" in
+case "$cc" in
'') ;;
-*) $rm -f try try.*
+*) $rm -f try try.*
$cat >try.c <<EOM
int main(int argc, char *argv[]) {
return 0;
if $test X"$despair" = Xyes; then
echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
fi
- $cat >&4 <<EOM
+ $cat >&4 <<EOM
You need to find a working C compiler.
Either (purchase and) install the C compiler supplied by your OS vendor,
or for a free C compiler try http://gcc.gnu.org/