chiark / gitweb /
Add a check in the new configure script to enable lots of gcc warning
[sgt-puzzles.git] / configure.ac
1 dnl Configure script for the Unix GTK build of puzzles.
2
3 AC_INIT([puzzles], rNNNN, [anakin@pobox.com])
4 AC_CONFIG_SRCDIR([midend.c])
5 AM_INIT_AUTOMAKE([foreign])
6 AC_PROG_CC
7 AM_PATH_GTK_2_0([2.0.0])
8
9 if test "x$GCC" = "xyes"; then
10   AC_MSG_CHECKING([for usable gcc warning flags])
11   gccwarningflags=
12   for flag in -Wall -Werror -ansi -pedantic; do
13     ac_save_CFLAGS="$CFLAGS"
14     ac_save_LIBS="$LIBS"
15     CFLAGS="$CFLAGS$gccwarningflags $flag $GTK_CFLAGS"
16     LIBS="$GTK_LIBS $LIBS"
17     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
18         #include <stdio.h>
19         #include <assert.h>
20         #include <stdlib.h>
21         #include <time.h>
22         #include <stdarg.h>
23         #include <string.h>
24         #include <errno.h>
25         #include <math.h>
26
27         #include <sys/time.h>
28         #include <sys/resource.h>
29
30         #include <gtk/gtk.h>
31         #include <gdk/gdkkeysyms.h>
32
33         #include <gdk-pixbuf/gdk-pixbuf.h>
34
35         #include <gdk/gdkx.h>
36         #include <X11/Xlib.h>
37         #include <X11/Xutil.h>
38         #include <X11/Xatom.h>
39     ],[
40         return 0;
41     ])], [gccwarningflags="$gccwarningflags $flag"], [])
42     CFLAGS="$ac_save_CFLAGS"
43     LIBS="$ac_save_LIBS"
44   done
45   AC_MSG_RESULT($gccwarningflags)
46   CFLAGS="$CFLAGS$gccwarningflags"
47 fi
48
49 AC_PROG_RANLIB
50 AC_PROG_INSTALL
51 AC_CONFIG_FILES([Makefile])
52 AC_OUTPUT