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 AC_CHECK_PROGS(XGETTEXT, xgettext)
32 dnl Checks for header files.
35 AC_CHECK_HEADERS(unistd.h)
37 dnl Checks for typedefs, structures, and compiler characteristics.
40 dnl ===========================================================================
41 dnl Give advanced users some options to play with
44 AC_MSG_CHECKING(for gprof mode)
46 AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),
47 [enable_gprof=$enableval], [enable_gprof=no])
48 if test "$enable_gprof" = "yes"; then
49 #CXXFLAGS="$CXXFLAGS -pg"
51 AC_MSG_RESULT([enabled])
53 AC_MSG_RESULT([disabled])
56 AC_MSG_CHECKING(for debug mode)
58 AC_HELP_STRING([--enable-debug], [enable debugging mode]),
59 [enable_debug=$enableval], [enable_debug=no])
60 if test "$enable_debug" = "yes"; then
61 AC_DEFINE([DEBUG], 1, [define to compile in debug checks])
62 #CXXFLAGS="$CXXFLAGS -Wall -Werror -O0 -g3"
64 AC_MSG_RESULT([enabled])
66 #CXXFLAGS="$CXXFLAGS -O2 -g"
68 AC_MSG_RESULT([disabled])
72 AC_MSG_CHECKING(wether OpenGL should be used)
74 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),
75 [enable_opengl=$enableval], enable_opengl=yes)
76 if test "$enable_opengl" = "yes"; then
83 AC_MSG_CHECKING([for iconv])
84 AC_TRY_LINK([#include <iconv.h>], [iconv_open(0, 0);], [iconv_found="yes"])
85 AS_IF([test "$iconv_found" = no],
87 AC_TRY_LINK([#include <iconv.h>], [iconv_open(0, 0);], [iconv_found="yes"]))
88 AS_IF([test "$iconv_found" = no],
89 AC_MSG_ERROR([Couldn't find iconv library]),
90 AC_MSG_RESULT([found]))
92 dnl ===========================================================================
95 AM_PATH_SDL($SDL_VERSION,
97 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
99 NP_FINDLIB([SDLMIXER], [SDL_mixer], [SDL_mixer >= 1.2],
100 NP_LANG_PROGRAM([#include <SDL_mixer.h>
101 #if MIX_MAJOR_VERSION < 1
102 # error SDLMix too old
104 # if MIX_MAJOR_VERSION == 1
105 # if MIX_MINOR_VERSION < 2
106 # error SDLMix too old
109 #endif], [Mix_OpenAudio(0, 0, 0, 0);]),
112 [AC_MSG_ERROR([Please install SDLMixer >=1.2.2])],
113 [$SDL_CFLAGS], [$SDL_LIBS])
115 NP_FINDLIB([SDLIMAGE], [SDL_image], [SDL_image >= 1.2],
116 NP_LANG_PROGRAM([#include <SDL_image.h>], [IMG_Load("");]),
119 [AC_MSG_ERROR([Please install SDLImage >= 1.2.1])],
120 [$SDL_CFLAGS], [$SDL_LIBS])
122 if test "$enable_opengl" = "yes"; then
125 if test "$no_gl" = "yes" -o "$enable_opengl" = "no"; then
127 AC_DEFINE([NOOPENGL],, [Define if opengl should not be used])
131 AC_SUBST([GL_AVAILABLE])
133 dnl Checks for library functions.
134 AC_CHECK_FUNCS(mkdir strdup strstr)
137 AC_CONFIG_FILES([Jamconfig])
144 echo " Profile Mode: $enable_gprof"
145 echo " Debug Mode: $enable_debug"
146 echo " OpenGL Support: $enable_opengl"
149 echo " NOTE: This project uses jam (and not make) as build tool"