changed the refresh hotkey
[giggle.git] / acinclude.m4
blobb69dc7ee5c75793a53d36aa77da38c2031ded311
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"
5     else
6         default_compile_warnings="no"
7     fi
8                                                                                 
9     AC_ARG_WITH(compile-warnings, [  --with-compile-warnings=[no/yes/error] Compiler warnings ], [enable_compile_warnings="$withval"], [enable_compile_warnings="$default_compile_warnings"])
10                                                                                 
11     warnCFLAGS=
12     if test "x$GCC" != xyes; then
13         enable_compile_warnings=no
14     fi
15                                                                                 
16     warning_flags=
17     realsave_CFLAGS="$CFLAGS"
18                                                                                 
19     case "$enable_compile_warnings" in
20     no)
21         warning_flags=
22         ;;
23     yes)
24         warning_flags="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
25         ;;
26     maximum|error)
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
30                 SAVE_CFLAGS="$CFLAGS"
31                 CFLAGS="$CFLAGS $option"
32                 AC_MSG_CHECKING([whether gcc understands $option])
33                 AC_TRY_COMPILE([], [],
34                         has_option=yes,
35                         has_option=no,)
36                 CFLAGS="$SAVE_CFLAGS"
37                 AC_MSG_RESULT($has_option)
38                 if test $has_option = yes; then
39                   warning_flags="$warning_flags $option"
40                 fi
41                 unset has_option
42                 unset SAVE_CFLAGS
43         done
44         unset option
45         if test "$enable_compile_warnings" = "error" ; then
46             warning_flags="$warning_flags -Werror"
47         fi
48         ;;
49     *)
50         AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
51         ;;
52     esac
53     CFLAGS="$realsave_CFLAGS"
54     AC_MSG_CHECKING(what warning flags to pass to the C compiler)
55     AC_MSG_RESULT($warning_flags)
56                                                                                 
57     WARN_CFLAGS="$warning_flags"
58     AC_SUBST(WARN_CFLAGS)
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
69         carbon_ok=no
70         AC_TRY_CPP([
71         #include <Carbon/Carbon.h>
72         #include <CoreServices/CoreServices.h>
73         ], carbon_ok=yes)
74         if test $carbon_ok = yes; then
75           IGE_PLATFORM=osx
76           IGE_PLATFORM_NAME="GTK+ OS X"
77           AC_DEFINE(IGE_PLATFORM_OSX, 1, [whether GTK+ OS X is available])
78         fi
79     elif test "x$gdk_target" = "xx11"; then
80         IGE_PLATFORM=x11
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
84         IGE_PLATFORM=win32
85         IGE_PLATFORM_NAME="GTK+ Windows"
86         AC_DEFINE(IGE_PLATFORM_WIN32, 1, [whether GTK+ WIN32 is available])
87     else
88         AC_MSG_ERROR([Could not detect the platform])
89     fi
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)