2009050
[gdash.git] / configure.in
bloba854704e024cb9125746860b98dc6a07c8921b3f
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])
5 AM_INIT_AUTOMAKE
6 AM_CONFIG_HEADER(config.h)
8 AC_PROG_CC
9 AM_PROG_CC_C_O
11 AC_ISC_POSIX
12 AC_HEADER_STDC
14 AC_C_CONST
15 AC_C_INLINE
16 AC_CHECK_FUNCS([setlocale putenv])
18 AM_GNU_GETTEXT([external])
19 AM_GNU_GETTEXT_VERSION([0.17])
21 AC_PROG_INSTALL
23 AC_CHECK_HEADERS([stdlib.h unistd.h string.h])
24 AC_CHECK_FUNCS([strchr strrchr memset strtol])
25 AC_FUNC_MEMCMP
27 AC_ARG_WITH(gtk,
28   [AS_HELP_STRING([--without-gtk], [disables gtk+ version (gdash)])],
29   [with_gtk=$withval],
30   [with_gtk=yes])
31 AC_ARG_WITH(sdl,
32   [AS_HELP_STRING([--without-sdl], [disables sdl version (sdash)])],
33   [with_sdl=$withval],
34   [with_sdl=yes])
35 AC_ARG_ENABLE(sound,
36   [AS_HELP_STRING([--disable-sound], [disables sound support])],
37   [enable_sound=$enableval],
38   [enable_sound=yes])
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.])
71 AC_CONFIG_FILES([
72 Makefile
73 po/Makefile.in
74 include/Makefile
75 src/Makefile
76 caves/Makefile
77 util/Makefile
78 docs/Makefile
79 sound/Makefile
80 music/Makefile
82 AC_OUTPUT