1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(GDash, 20090503, cirix@fw.hu)
4 AC_CONFIG_SRCDIR([src/gameplay.c])
6 AM_CONFIG_HEADER(config.h)
16 AC_CHECK_FUNCS([setlocale putenv])
18 AM_GNU_GETTEXT([external])
19 AM_GNU_GETTEXT_VERSION([0.17])
23 AC_CHECK_HEADERS([stdlib.h unistd.h string.h])
24 AC_CHECK_FUNCS([strchr strrchr memset strtol])
28 [AS_HELP_STRING([--without-gtk], [disables gtk+ version (gdash)])],
32 [AS_HELP_STRING([--without-sdl], [disables sdl version (sdash)])],
36 [AS_HELP_STRING([--disable-sound], [disables sound support])],
37 [enable_sound=$enableval],
40 if test x"$with_gtk" = "xno" -a x"$with_sdl" = "xno"; then
41 AC_MSG_ERROR(You cannot disable both SDL and GTK. Rerun with --with-gtk or --with-sdl.)
44 if test x"$enable_sound" = "xyes" -a x"$with_sdl" = "xno"; then
45 AC_MSG_ERROR(Sound support requires the SDL libraries. Rerun with --with-sdl or --disable-sound.)
48 AM_PATH_GLIB_2_0(2.12.0, :, AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.), gthread)
50 dnl this conditional must ALWAYS be run, not inside the if below.
51 AM_CONDITIONAL(GTK, test x"$with_gtk" = "xyes")
52 if test x"$with_gtk" = "xyes" ; then
53 AC_DEFINE(USE_GTK,,[Use GTK.])
54 AM_PATH_GTK_2_0(2.12.0, :, AC_MSG_ERROR(Test for GTK+ failed. See the file 'INSTALL' for help.))
57 AM_CONDITIONAL(SDL, test x"$with_sdl" = "xyes")
58 if test x"$with_sdl" = "xyes" ; then
59 AC_DEFINE(USE_SDL,,[Use SDL.])
60 AM_PATH_SDL(1.2.0, :, AC_MSG_ERROR(Test for SDL failed. See the file 'INSTALL' for help.))
63 PKG_CHECK_MODULES(LIBPNG, [libpng], AC_DEFINE(HAVE_LIBPNG, 1, Define if you have libpng), [])
66 AM_CONDITIONAL(SOUND, test x"$enable_sound" = "xyes")
67 if test x"$enable_sound" = "xyes" ; then
68 AC_DEFINE(GD_SOUND,,[Enable sound.])