From 1371bb1bec811b2671f5bd7652616e9180c52517 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Thu, 15 Aug 2002 22:10:23 +0000 Subject: [PATCH] compiler-autoconf-tests-20020815 attempt to find compilers we like --- src/cf/aix-cc.m4 | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/cf/solaris-cc.m4 | 9 +++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 src/cf/aix-cc.m4 diff --git a/src/cf/aix-cc.m4 b/src/cf/aix-cc.m4 new file mode 100644 index 0000000..acdec7a --- /dev/null +++ b/src/cf/aix-cc.m4 @@ -0,0 +1,44 @@ +dnl +dnl $Id$ +dnl + +dnl We do not quite know how the version number of the xlc +dnl corresponds to the value of __IBMCC__ but 440 (decimal) +dnl seems to be the first compiler that works for us. +dnl +dnl Guess: +dnl +dnl lslpp says __IBMCC__ +dnl +dnl vac.C 4.4.0.0 440 +dnl vac.C 5.0.2.1 502 +dnl + +AC_DEFUN(AC_AIX_CC_GOOD, [ +AIXCC="$CC" +save_CC="$CC" +if test "$CC" ; then + AC_CHECK_PROGS(AIXCC, "$CC" xlc /usr/vac/bin/xlc gcc) +else + AC_CHECK_PROGS(AIXCC, xlc /usr/vac/bin/xlc gcc) +fi +CC="$AIXCC" +AC_MSG_CHECKING(whether CC is a good enough Aix cc) +AC_CACHE_VAL(ac_cv_aix_cc_good, +[ +XLCVERSION=440 +AC_TRY_RUN( +[ +int main(void) { return __IBMC__ < $XLCVERSION;} +], +ac_cv_aix_cc_good=yes, +ac_cv_aix_cc_good=no, +ac_cv_aix_cc_good=no) +AC_MSG_RESULT($ac_cv_aix_cc_good)]) +if test "$ac_cv_aix_cc_good" = "yes"; then + AC_CHECK_PROGS(CC, "$AIXCC") +else + CC="$save_CC" +fi +]) + diff --git a/src/cf/solaris-cc.m4 b/src/cf/solaris-cc.m4 index 0c114a5..abb2e74 100644 --- a/src/cf/solaris-cc.m4 +++ b/src/cf/solaris-cc.m4 @@ -2,10 +2,16 @@ dnl dnl $Id$ dnl +dnl +dnl The Solaris compiler defines __SUNPRO_C as a hex number +dnl whose digits correspond to the digits in the compiler +dnl version. Thus compiler version 4.2.0 is 0x420. +dnl + AC_DEFUN(AC_SOLARIS_CC_GOOD, [ SOLARISCC="$CC" save_CC="$CC" -if test -x "$CC" ; then +if test "$CC" ; then AC_CHECK_PROGS(SOLARISCC, "$CC" cc /opt/SUNWspro/bin/cc gcc) else AC_CHECK_PROGS(SOLARISCC, cc /opt/SUNWspro/bin/cc gcc) @@ -17,7 +23,6 @@ AC_CACHE_VAL(ac_cv_solaris_cc_good, SUNPROVERSION=0x400 AC_TRY_RUN( [ -#include int main(void) { return __SUNPRO_C < $SUNPROVERSION;} ], ac_cv_solaris_cc_good=yes, -- 1.9.4