-Wno-missing-field-initializers -Wno-unused-parameter \
-Wno-attributes -Wno-long-long -Winline"
+# -Wunused-but-set-variable is too noisy at present
+NO_WARN="-Wno-unused-but-set-variable"
+
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.
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 -flto"
+
+dnl -flto working really needs a test link, not just a compile
+
+safe_MAYBE_WARN="$MAYBE_WARN"
+MAYBE_WARN="$MAYBE_WARN -flto"
+AC_TRY_LINK([],[
+ int main(int argc, char **argv) { return 0; }
+],[],[
+ MAYBE_WARN="$safe_MAYBE_WARN"
+])
+
+MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"
dnl Also to turn various gcc/glibc-specific preprocessor checks
MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2"
+MAYBE_WARN="$MAYBE_WARN $NO_WARN"
+
# invalidate cached value if MAYBE_WARN has changed
if test "x$cairo_cv_warn_maybe" != "x$MAYBE_WARN"; then
unset cairo_cv_warn_cflags
dnl check linker flags
AC_CACHE_CHECK([how to allow undefined symbols in shared libraries used by test suite], cairo_cv_test_undefined_ldflags,
- [CAIRO_CC_TRY_FLAG([-Wl,--allow-shlib-undefined], [],
+ [CAIRO_CC_TRY_FLAG_SILENT([-Wl,--allow-shlib-undefined], [],
[cairo_cv_test_undefined_ldflags="-Wl,--allow-shlib-undefined]")])
CAIRO_TEST_UNDEFINED_LDFLAGS="$cairo_cv_test_undefined_ldflags"
AC_SUBST(CAIRO_TEST_UNDEFINED_LDFLAGS)