v
[gdash.git] / configure.in
blob809ee746d1cac1c73a6fe4457c733ce6ace83942
1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(GDash, 20130623unstable, [http://code.google.com/p/gdash/])
4 AC_CONFIG_SRCDIR([src/main.cpp])
5 AM_INIT_AUTOMAKE
6 AM_CONFIG_HEADER(config.h)
7 AM_SILENT_RULES([yes])
9 AC_CONFIG_MACRO_DIR([m4])
11 AC_PROG_CC
12 AC_PROG_CXX
13 AM_PROG_CC_C_O
14 PKG_PROG_PKG_CONFIG
16 AC_ISC_POSIX
17 AC_HEADER_STDC
19 AC_CHECK_FUNCS([setlocale])
21 AM_GNU_GETTEXT([external])
22 AM_GNU_GETTEXT_VERSION([0.17])
24 AC_PROG_INSTALL
26 AC_CHECK_HEADERS([stdint.h stdlib.h])
27 AC_CHECK_FUNCS([strchr strrchr])
28 AC_FUNC_MEMCMP
29 AC_FUNC_MALLOC
30 AC_TYPE_UINT32_T
32 AM_PATH_GLIB_2_0(2.12.0, :, AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.), gthread)
35 dnl
36 dnl GTK+ or SDL or both?
37 dnl
38 AC_ARG_WITH(gtk,
39   [AS_HELP_STRING([--without-gtk], [disables using gtk+])],
40   [with_gtk=$withval],
41   [with_gtk=yes])
42 AC_ARG_WITH(sdl,
43   [AS_HELP_STRING([--without-sdl], [disables using sdl])],
44   [with_sdl=$withval],
45   [with_sdl=yes])
47 if test x"$with_gtk" = "xno" -a x"$with_sdl" = "xno"; then
48   AC_MSG_ERROR(You cannot disable both SDL and GTK. Rerun with --with-gtk or --with-sdl.)
51 dnl this conditional must ALWAYS be run, not inside the if below.
52 AM_CONDITIONAL(GTK, test x"$with_gtk" = "xyes")
53 if test x"$with_gtk" = "xyes" ; then
54   AC_DEFINE(HAVE_GTK,,[Use GTK.])
55   AM_PATH_GTK_2_0(2.12.0, :, AC_MSG_ERROR(Test for GTK+ failed. See the file 'INSTALL' for help.))
56 else
57   GTK_CFLAGS=""
58   GTK_LIBS=""
61 AM_CONDITIONAL(SDL, test x"$with_sdl" = "xyes")
62 if test x"$with_sdl" = "xyes" ; then
63   AC_DEFINE(HAVE_SDL,,[Use SDL.])
64   AM_PATH_SDL(1.2.0, :, AC_MSG_ERROR(Test for SDL failed. See the file 'INSTALL' for help.))
65   SDL_LIBS="$SDL_LIBS -lSDL_mixer -lSDL_image"
66   AX_CHECK_GL
67 else
68   GL_CFLAGS=""
69   GL_LIBS=""
70   SDL_CFLAGS=""
71   SDL_LIBS=""
75 PKG_CHECK_MODULES(LIBPNG, [libpng], AC_DEFINE(HAVE_LIBPNG, 1, Define if you have libpng), [])
78 AC_CONFIG_FILES([
79 Makefile
80 po/Makefile.in
81 include/Makefile
82 src/Makefile
83 caves/Makefile
84 docs/Makefile
85 sound/Makefile
86 music/Makefile
87 shaders/Makefile
90 AC_OUTPUT