1 dnl handle various error-related things
3 dnl Thomas Vander Stichele <thomas@apestaart.org>
5 dnl Last modification: 2005-10-16
7 dnl GST_SET_ERROR_CFLAGS([ADD-WERROR])
8 dnl GST_SET_LEVEL_DEFAULT([IS-CVS-VERSION])
11 dnl Sets ERROR_CFLAGS to something the compiler will accept.
12 dnl AC_SUBST them so they are available in Makefile
14 dnl -Wall is added if it is supported
15 dnl -Werror is added if ADD-WERROR is not "no"
17 dnl These flags can be overridden at make time:
18 dnl make ERROR_CFLAGS=
19 AC_DEFUN([GST_SET_ERROR_CFLAGS],
21 AC_REQUIRE([AC_PROG_CC])
22 AC_REQUIRE([AS_COMPILER_FLAG])
24 dnl if we support -Wall, set it unconditionally
25 AS_COMPILER_FLAG(-Wall,
29 dnl if asked for, add -Werror if supported
30 if test "x$1" != "xno"
32 AS_COMPILER_FLAG(-Werror, ERROR_CFLAGS="$ERROR_CFLAGS -Werror")
35 AC_SUBST(ERROR_CFLAGS)
36 AC_MSG_NOTICE([set ERROR_CFLAGS to $ERROR_CFLAGS])
39 dnl Sets the default error level for debugging messages
40 AC_DEFUN([GST_SET_LEVEL_DEFAULT],
42 dnl define correct errorlevel for debugging messages. We want to have
43 dnl GST_ERROR messages printed when running cvs builds
44 if test "x[$1]" = "xyes"; then
45 GST_LEVEL_DEFAULT=GST_LEVEL_ERROR
47 GST_LEVEL_DEFAULT=GST_LEVEL_NONE
49 AC_DEFINE_UNQUOTED(GST_LEVEL_DEFAULT, $GST_LEVEL_DEFAULT,
50 [Default errorlevel to use])
51 dnl AC_SUBST so we can use it for win32/common/config.h
52 AC_SUBST(GST_LEVEL_DEFAULT)