solaris-find-valid-cc-for-compiling-kernel-20020813
authorHarald Barth <haba@stacken.kth.se>
Tue, 13 Aug 2002 20:07:44 +0000 (20:07 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 13 Aug 2002 20:07:44 +0000 (20:07 +0000)
configure test to find solaris cc since we can't (yet) compile
kernel module with gcc on solaris.

src/cf/solaris-cc.m4 [new file with mode: 0644]

diff --git a/src/cf/solaris-cc.m4 b/src/cf/solaris-cc.m4
new file mode 100644 (file)
index 0000000..0c114a5
--- /dev/null
@@ -0,0 +1,33 @@
+dnl
+dnl $Id$
+dnl 
+
+AC_DEFUN(AC_SOLARIS_CC_GOOD, [
+SOLARISCC="$CC"
+save_CC="$CC"
+if test -x "$CC" ; then
+  AC_CHECK_PROGS(SOLARISCC, "$CC" cc /opt/SUNWspro/bin/cc gcc)
+else
+  AC_CHECK_PROGS(SOLARISCC, cc /opt/SUNWspro/bin/cc gcc)
+fi
+CC="$SOLARISCC"
+AC_MSG_CHECKING(whether CC is a good enough Solaris cc)
+AC_CACHE_VAL(ac_cv_solaris_cc_good,
+[
+SUNPROVERSION=0x400
+AC_TRY_RUN(
+[
+#include<stdio.h>
+int main(void) { return __SUNPRO_C < $SUNPROVERSION;}
+], 
+ac_cv_solaris_cc_good=yes,
+ac_cv_solaris_cc_good=no,
+ac_cv_solaris_cc_good=no)
+AC_MSG_RESULT($ac_cv_solaris_cc_good)])
+if test "$ac_cv_solaris_cc_good" = "yes"; then
+  AC_CHECK_PROGS(CC, "$SOLARISCC")
+else
+  CC="$save_CC"
+fi
+])
+