acdec7abebcd559dd6bc78a483391a4eed8df7e1
[openafs.git] / src / cf / aix-cc.m4
1 dnl
2 dnl $Id$
3 dnl 
4
5 dnl We do not quite know how the version number of the xlc
6 dnl corresponds to the value of __IBMCC__ but 440 (decimal)
7 dnl seems to be the first compiler that works for us.
8 dnl 
9 dnl Guess:
10 dnl
11 dnl lslpp says                  __IBMCC__
12 dnl
13 dnl vac.C 4.4.0.0               440
14 dnl vac.C 5.0.2.1               502
15 dnl
16
17 AC_DEFUN(AC_AIX_CC_GOOD, [
18 AIXCC="$CC"
19 save_CC="$CC"
20 if test "$CC" ; then
21   AC_CHECK_PROGS(AIXCC, "$CC" xlc /usr/vac/bin/xlc gcc)
22 else
23   AC_CHECK_PROGS(AIXCC, xlc /usr/vac/bin/xlc gcc)
24 fi
25 CC="$AIXCC"
26 AC_MSG_CHECKING(whether CC is a good enough Aix cc)
27 AC_CACHE_VAL(ac_cv_aix_cc_good,
28 [
29 XLCVERSION=440
30 AC_TRY_RUN(
31 [
32 int main(void) { return __IBMC__ < $XLCVERSION;}
33 ], 
34 ac_cv_aix_cc_good=yes,
35 ac_cv_aix_cc_good=no,
36 ac_cv_aix_cc_good=no)
37 AC_MSG_RESULT($ac_cv_aix_cc_good)])
38 if test "$ac_cv_aix_cc_good" = "yes"; then
39   AC_CHECK_PROGS(CC, "$AIXCC")
40 else
41   CC="$save_CC"
42 fi
43 ])
44