1 dnl ===========================================================================
5 dnl SuperTux development team
9 dnl neoneurone@users.sf.net
10 dnl ===========================================================================
12 dnl Process this file with autoconf to produce a configure script.
14 AC_INIT(supertux, 0.2-cvs)
15 AC_CONFIG_SRCDIR([src/supertux.cpp])
16 AC_CONFIG_AUX_DIR([mk/autoconf])
19 AC_CONFIG_HEADERS(config.h)
21 # we don't want the stupid autoconf default -g -O2
22 test ".$CXXFLAGS" = "." && CXXFLAGS=" "
24 CXXFLAGS="$CXXFLAGS -ffast-math"
30 dnl Checks for header files.
33 AC_CHECK_HEADERS(unistd.h)
35 dnl Checks for typedefs, structures, and compiler characteristics.
38 dnl ===========================================================================
39 dnl Give advanced users some options to play with
42 AC_MSG_CHECKING(for gprof mode)
44 AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),
45 [enable_gprof=$enableval], [enable_gprof=no])
46 if test "$enable_gprof" = "yes"; then
47 #CXXFLAGS="$CXXFLAGS -pg"
49 AC_MSG_RESULT([enabled])
51 AC_MSG_RESULT([disabled])
54 AC_MSG_CHECKING(for debug mode)
56 AC_HELP_STRING([--enable-debug], [enable debugging mode]),
57 [enable_debug=$enableval], [enable_debug=no])
58 if test "$enable_debug" = "yes"; then
59 AC_DEFINE([DEBUG], 1, [define to compile in debug checks])
60 #CXXFLAGS="$CXXFLAGS -Wall -Werror -O0 -g3"
62 AC_MSG_RESULT([enabled])
64 #CXXFLAGS="$CXXFLAGS -O2 -g"
66 AC_MSG_RESULT([disabled])
70 AC_MSG_CHECKING(wether OpenGL should be used)
72 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),
73 [enable_opengl=$enableval], enable_opengl=yes)
74 if test "$enable_opengl" = "yes"; then
80 AC_CHECK_LIB([iconv], [iconv_open])
81 AC_TRY_LINK([#include <iconv.h>], [iconv_open(0, 0);],,
82 AC_MSG_ERROR([Couldn't find iconv library]))
84 dnl ===========================================================================
87 AM_PATH_SDL($SDL_VERSION,
89 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
91 NP_FINDLIB([SDLMIXER], [SDL_mixer], [SDL_mixer >= 1.2],
92 NP_LANG_PROGRAM([#include <SDL_mixer.h>
93 #if MIX_MAJOR_VERSION < 1
94 # error SDLMix too old
96 # if MIX_MAJOR_VERSION == 1
97 # if MIX_MINOR_VERSION < 2
98 # error SDLMix too old
101 #endif], [Mix_OpenAudio(0, 0, 0, 0);]),
104 [AC_MSG_ERROR([Please install SDLMixer >=1.2.2])],
105 [$SDL_CFLAGS], [$SDL_LIBS])
107 NP_FINDLIB([SDLIMAGE], [SDL_image], [SDL_image >= 1.2],
108 NP_LANG_PROGRAM([#include <SDL_image.h>], [IMG_Load("");]),
111 [AC_MSG_ERROR([Please install SDLImage >= 1.2.1])],
112 [$SDL_CFLAGS], [$SDL_LIBS])
114 if test "$enable_opengl" = "yes"; then
117 if test "$no_gl" = "yes" -o "$enable_opengl" = "no"; then
119 AC_DEFINE([NOOPENGL],, [Define if opengl should not be used])
123 AC_SUBST([GL_AVAILABLE])
125 dnl Checks for library functions.
126 AC_CHECK_FUNCS(mkdir strdup strstr)
129 AC_CONFIG_FILES([Jamconfig])
136 echo " Profile Mode: $enable_gprof"
137 echo " Debug Mode: $enable_debug"
138 echo " OpenGL Support: $enable_opengl"
141 echo " NOTE: This project uses jam (and not make) as build tool"