1 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
2 AC_DEFUN([IMENDIO_COMPILE_WARNINGS],[
3 if test -f $srcdir/autogen.sh; then
4 default_compile_warnings="error"
6 default_compile_warnings="no"
9 AC_ARG_WITH(compile-warnings, [ --with-compile-warnings=[no/yes/error] Compiler warnings ], [enable_compile_warnings="$withval"], [enable_compile_warnings="$default_compile_warnings"])
12 if test "x$GCC" != xyes; then
13 enable_compile_warnings=no
17 realsave_CFLAGS="$CFLAGS"
19 case "$enable_compile_warnings" in
24 warning_flags="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
27 warning_flags="-Wall -Wunused -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -std=c99"
28 CFLAGS="$warning_flags $CFLAGS"
29 for option in -Wno-sign-compare -Wno-pointer-sign; do
31 CFLAGS="$CFLAGS $option"
32 AC_MSG_CHECKING([whether gcc understands $option])
33 AC_TRY_COMPILE([], [],
37 AC_MSG_RESULT($has_option)
38 if test $has_option = yes; then
39 warning_flags="$warning_flags $option"
45 if test "$enable_compile_warnings" = "error" ; then
46 warning_flags="$warning_flags -Werror"
50 AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
53 CFLAGS="$realsave_CFLAGS"
54 AC_MSG_CHECKING(what warning flags to pass to the C compiler)
55 AC_MSG_RESULT($warning_flags)
57 WARN_CFLAGS="$warning_flags"
61 AC_DEFUN([IGE_PLATFORM_CHECK],[
62 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
64 AC_MSG_CHECKING([which GTK+ platform to use...])
66 gdk_target=`$PKG_CONFIG --variable=target gtk+-2.0`
68 if test "x$gdk_target" = "xquartz"; then
71 #include <Carbon/Carbon.h>
72 #include <CoreServices/CoreServices.h>
74 if test $carbon_ok = yes; then
76 IGE_PLATFORM_NAME="GTK+ OS X"
77 AC_DEFINE(IGE_PLATFORM_OSX, 1, [whether GTK+ OS X is available])
79 elif test "x$gdk_target" = "xx11"; then
81 IGE_PLATFORM_NAME="GTK+ X11"
82 AC_DEFINE(IGE_PLATFORM_X11, 1, [whether GTK+ X11 is available])
83 elif test "x$gdk_target" = "xwin32"; then
85 IGE_PLATFORM_NAME="GTK+ Windows"
86 AC_DEFINE(IGE_PLATFORM_WIN32, 1, [whether GTK+ WIN32 is available])
88 AC_MSG_ERROR([Could not detect the platform])
91 AC_MSG_RESULT([$IGE_PLATFORM_NAME])
93 AM_CONDITIONAL(IGE_PLATFORM_X11, test $IGE_PLATFORM = x11)
94 AM_CONDITIONAL(IGE_PLATFORM_OSX, test $IGE_PLATFORM = osx)
95 AM_CONDITIONAL(IGE_PLATFORM_WIN32, test $IGE_PLATFORM = win32)