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 /build/aclocal.cairo.m4 | |
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.
Diffstat (limited to 'build/aclocal.cairo.m4')
-rw-r--r-- | build/aclocal.cairo.m4 | 23 |
1 files changed, 21 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]) |