292 |
|
|
293 |
# look for possible C compilers |
# look for possible C compilers |
294 |
look_for_C_compilers() { |
look_for_C_compilers() { |
295 |
tmp="$MITGCM_CC $CC gcc c89 cc c99 mpicc icc" |
echo >> $LOGFILE |
296 |
p_CC= |
echo "running: look_for_C_compilers()" >> $LOGFILE |
297 |
for c in $tmp ; do |
rm -f ./genmake_hello.c ./genmake_hello |
298 |
rm -f ./genmake_hello.c ./genmake_hello |
cat >> genmake_hello.c << EOF |
|
cat >> genmake_hello.c << EOF |
|
299 |
#include <stdio.h> |
#include <stdio.h> |
300 |
int main(int argc, char **argv) { |
int main(int argc, char **argv) { |
301 |
printf("Hello!\n"); |
printf("Hello!\n"); |
302 |
return 0; |
return 0; |
303 |
} |
} |
304 |
EOF |
EOF |
305 |
$c -o genmake_hello genmake_hello.c > /dev/null 2>&1 |
tmp="$MITGCM_CC $CC gcc c89 cc c99 mpicc icc" |
306 |
|
p_CC= |
307 |
|
for c in $tmp ; do |
308 |
|
COMM="$c $CFLAGS -o genmake_hello genmake_hello.c" |
309 |
|
echo $COMM >> $LOGFILE |
310 |
|
$COMM >> $LOGFILE 2>&1 |
311 |
RETVAL=$? |
RETVAL=$? |
312 |
if test "x${RETVAL}" = x0 ; then |
if test "x${RETVAL}" = x0 ; then |
313 |
|
echo " $c test successful" >> $LOGFILE |
314 |
p_CC="$p_CC $c" |
p_CC="$p_CC $c" |
315 |
fi |
fi |
316 |
done |
done |
326 |
EOF |
EOF |
327 |
exit 1 |
exit 1 |
328 |
else |
else |
329 |
echo " The possible C compilers found in your path are:" |
echo " The possible C compilers found in your path are: $p_CC" | tee -a $LOGFILE |
|
echo " "$p_CC |
|
330 |
if test "x$CC" = x ; then |
if test "x$CC" = x ; then |
331 |
CC=`echo $p_CC | $AWK '{print $1}'` |
CC=`echo $p_CC | $AWK '{print $1}'` |
332 |
echo " Setting C compiler to: "$CC |
echo " Setting C compiler to: "$CC |
333 |
fi |
fi |
334 |
fi |
fi |
335 |
|
echo " --> set CC='$CC'" >> $LOGFILE |
336 |
} |
} |
337 |
|
|
338 |
# Guess possible config options for this host |
# Guess possible config options for this host |