diff options
author | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2009-09-02 04:29:18 +0100 |
---|---|---|
committer | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2009-09-02 06:38:15 +0300 |
commit | c086b40a93057a6fd47d23c85c5026d6fe2f524a (patch) | |
tree | 56042b53c1d89cb3726f3166e5efb53f86e16d92 | |
parent | f081a5ff554267eebecea4652bb483eea11d1484 (diff) |
[build] Hush the Solaris compiler about enum abuse.
Sun Studio 12 doesn't like it when we mix our
enum values and types. We do that a lot on purpose
so the warnings from compiles were very verbose.
-rw-r--r-- | build/aclocal.cairo.m4 | 23 | ||||
-rw-r--r-- | build/configure.ac.warnings | 6 |
2 files changed, 27 insertions, 2 deletions
diff --git a/build/aclocal.cairo.m4 b/build/aclocal.cairo.m4 index 021c22fc..5eec262e 100644 --- a/build/aclocal.cairo.m4 +++ b/build/aclocal.cairo.m4 @@ -111,21 +111,40 @@ AC_DEFUN([CAIRO_CC_TRY_FLAG_SILENT], fi ]) +dnl find a -Werror equivalent +AC_DEFUN([CAIRO_CC_CHECK_WERROR], +[dnl + _test_WERROR=${WERROR+set} + if test "z$_test_WERROR" != zset; then + WERROR="" + for _werror in -Werror -errwarn; do + AC_MSG_CHECKING([whether $CC supports $_werror]) + CAIRO_CC_TRY_FLAG_SILENT( + [$_werror],, + [WERROR="$WERROR $_werror"], + [:]) + AC_MSG_RESULT($cairo_cc_flag) + done + fi +]) + dnl check compiler flags possibly using -Werror if available. AC_DEFUN([CAIRO_CC_TRY_FLAG], [dnl (flags..., optional program, true-action, false-action) + CAIRO_CC_CHECK_WERROR AC_MSG_CHECKING([whether $CC supports $1]) - CAIRO_CC_TRY_FLAG_SILENT([-Werror $1], [$2], [$3], [$4]) + CAIRO_CC_TRY_FLAG_SILENT([$WERROR $1], [$2], [$3], [$4]) AC_MSG_RESULT([$cairo_cc_flag]) ]) dnl check compiler/ld flags AC_DEFUN([CAIRO_CC_TRY_LINK_FLAG], [dnl + CAIRO_CC_CHECK_WERROR AC_MSG_CHECKING([whether $CC supports $1]) _save_cflags="$CFLAGS" - CFLAGS="$CFLAGS -Werror $1" + CFLAGS="$CFLAGS $WERROR $1" AC_LINK_IFELSE([int main(void){ return 0;} ], [cairo_cc_flag=yes], [cairo_cc_flag=no]) diff --git a/build/configure.ac.warnings b/build/configure.ac.warnings index 7bd4144f..53eacb19 100644 --- a/build/configure.ac.warnings +++ b/build/configure.ac.warnings @@ -19,6 +19,12 @@ MAYBE_WARN="-Wall -Wextra \ -Wno-missing-field-initializers -Wno-unused-parameter \ -Wno-attributes -Wno-long-long -Winline" +dnl Sun Studio 12 likes to rag at us for abusing enums like +dnl having cairo_status_t variables hold cairo_int_status_t +dnl values. It's bad, we know. Now please be quiet. +MAYBE_WARN="$MAYBE_WARN -erroff=E_ENUM_TYPE_MISMATCH_ARG \ + -erroff=E_ENUM_TYPE_MISMATCH_OP" + dnl We also abuse the warning-flag facility to enable other compiler dnl options. Namely, the following: MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common" |