summaryrefslogtreecommitdiff
path: root/m4/cares-compilers.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-10-08 03:50:45 +0000
committerYang Tse <yangsita@gmail.com>2008-10-08 03:50:45 +0000
commit94d2a2869887c164db9d77f445a57ba2a3bfea03 (patch)
tree6a1fbb3df531ef1511b6dc247b5aa909b2160f79 /m4/cares-compilers.m4
parentd7cdbc18af5c71209208901bc3e3117a0fe42b54 (diff)
downloadc-ares-94d2a2869887c164db9d77f445a57ba2a3bfea03.tar.gz
c-ares-94d2a2869887c164db9d77f445a57ba2a3bfea03.tar.bz2
c-ares-94d2a2869887c164db9d77f445a57ba2a3bfea03.zip
Initial attempt to detect SUN C compiler
Diffstat (limited to 'm4/cares-compilers.m4')
-rw-r--r--m4/cares-compilers.m466
1 files changed, 48 insertions, 18 deletions
diff --git a/m4/cares-compilers.m4 b/m4/cares-compilers.m4
index db711c3..0bc7623 100644
--- a/m4/cares-compilers.m4
+++ b/m4/cares-compilers.m4
@@ -40,6 +40,7 @@ AC_DEFUN([CARES_CHECK_COMPILER], [
CARES_CHECK_COMPILER_IBM
CARES_CHECK_COMPILER_INTEL
CARES_CHECK_COMPILER_GNU
+ CARES_CHECK_COMPILER_SUN
#
if test "$compiler_id" = "unknown"; then
cat <<_EOF 1>&2
@@ -212,6 +213,28 @@ AC_DEFUN([CARES_CHECK_COMPILER_INTEL], [
])
+dnl CARES_CHECK_COMPILER_SUN
+dnl -------------------------------------------------
+dnl Verify if the C compiler being used is SUN's.
+
+AC_DEFUN([CARES_CHECK_COMPILER_SUN], [
+ AC_MSG_CHECKING([whether we are using the SUN C compiler])
+ CURL_CHECK_DEF([__SUNPRO_C], [], [silent])
+ if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then
+ AC_MSG_RESULT([yes])
+ compiler_id="SUNC"
+ flags_dbg_all="-g -s"
+ flags_dbg_yes="-g"
+ flags_dbg_off="-s"
+ flags_opt_all="-O -xO1 -xO2 -xO3 -xO4 -xO5"
+ flags_opt_yes="-xO2"
+ flags_opt_off=""
+ else
+ AC_MSG_RESULT([no])
+ fi
+])
+
+
dnl CARES_SET_COMPILER_BASIC_OPTS
dnl -------------------------------------------------
dnl Sets compiler specific options/flags which do not
@@ -414,24 +437,6 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
fi
fi
#
- if test "$compiler_id" = "HPC"; then
- if test "$want_warnings" = "yes"; then
- dnl Issue all warnings
- CFLAGS="$CFLAGS +w1"
- fi
- fi
- #
- if test "$compiler_id" = "ICC_unix"; then
- if test "$want_warnings" = "yes"; then
- if test "$compiler_num" -gt "600"; then
- dnl Show errors, warnings, and remarks
- CPPFLAGS="$CPPFLAGS -Wall"
- dnl Perform extra compile-time code checking
- CPPFLAGS="$CPPFLAGS -Wcheck"
- fi
- fi
- fi
- #
if test "$compiler_id" = "GNUC"; then
#
# FIXME: Some of these warnings should be changed into errors
@@ -487,6 +492,31 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
fi
fi
#
+ if test "$compiler_id" = "HPC"; then
+ if test "$want_warnings" = "yes"; then
+ dnl Issue all warnings
+ CFLAGS="$CFLAGS +w1"
+ fi
+ fi
+ #
+ if test "$compiler_id" = "ICC_unix"; then
+ if test "$want_warnings" = "yes"; then
+ if test "$compiler_num" -gt "600"; then
+ dnl Show errors, warnings, and remarks
+ CPPFLAGS="$CPPFLAGS -Wall"
+ dnl Perform extra compile-time code checking
+ CPPFLAGS="$CPPFLAGS -Wcheck"
+ fi
+ fi
+ fi
+ #
+ if test "$compiler_id" = "SUNC"; then
+ if test "$want_warnings" = "yes"; then
+ dnl Perform stricter semantic and lint-like checks
+ CFLAGS="$CFLAGS -v"
+ fi
+ fi
+ #
])