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)
31 if test -n "$XGETTEXT" ; then
32 AC_MSG_CHECKING([if xgettext supports lisp])
33 if echo '(gettext "test")' | xgettext -o - -L Lisp - >& /dev/null; then
37 AC_MSG_WARN([It seems your gettext installation is too old, try updating it])
42 dnl Checks for header files.
45 AC_CHECK_HEADERS(unistd.h)
47 dnl Checks for typedefs, structures, and compiler characteristics.
50 dnl ===========================================================================
51 dnl Give advanced users some options to play with
54 AC_MSG_CHECKING(for gprof mode)
56 AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),
57 [enable_gprof=$enableval], [enable_gprof=no])
58 if test "$enable_gprof" = "yes"; then
59 #CXXFLAGS="$CXXFLAGS -pg"
61 AC_MSG_RESULT([enabled])
63 AC_MSG_RESULT([disabled])
66 AC_MSG_CHECKING(for debug mode)
68 AC_HELP_STRING([--enable-debug], [enable debugging mode]),
69 [enable_debug=$enableval], [enable_debug=no])
70 if test "$enable_debug" = "yes"; then
71 AC_DEFINE([DEBUG], 1, [define to compile in debug checks])
72 #CXXFLAGS="$CXXFLAGS -Wall -Werror -O0 -g3"
74 AC_MSG_RESULT([enabled])
76 #CXXFLAGS="$CXXFLAGS -O2 -g"
78 AC_MSG_RESULT([disabled])
82 AC_MSG_CHECKING(wether OpenGL should be used)
84 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),
85 [enable_opengl=$enableval], enable_opengl=yes)
86 if test "$enable_opengl" = "yes"; then
93 AC_MSG_CHECKING([for iconv])
94 AC_TRY_LINK([#include <iconv.h>], [iconv_open(0, 0);], [iconv_found="yes"])
95 AS_IF([test "$iconv_found" = no],
97 AC_TRY_LINK([#include <iconv.h>], [iconv_open(0, 0);], [iconv_found="yes"]))
98 AS_IF([test "$iconv_found" = no],
99 AC_MSG_ERROR([Couldn't find iconv library]),
100 AC_MSG_RESULT([found]))
102 dnl ===========================================================================
105 AM_PATH_SDL($SDL_VERSION,
107 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
109 NP_FINDLIB([SDLMIXER], [SDL_mixer], [SDL_mixer >= 1.2],
110 NP_LANG_PROGRAM([#include <SDL_mixer.h>
111 #if MIX_MAJOR_VERSION < 1
112 # error SDLMix too old
114 # if MIX_MAJOR_VERSION == 1
115 # if MIX_MINOR_VERSION < 2
116 # error SDLMix too old
119 #endif], [Mix_OpenAudio(0, 0, 0, 0);]),
122 [AC_MSG_ERROR([Please install SDLMixer >=1.2.2])],
123 [$SDL_CFLAGS], [$SDL_LIBS])
125 NP_FINDLIB([SDLIMAGE], [SDL_image], [SDL_image >= 1.2],
126 NP_LANG_PROGRAM([#include <SDL_image.h>], [IMG_Load("");]),
129 [AC_MSG_ERROR([Please install SDLImage >= 1.2.1])],
130 [$SDL_CFLAGS], [$SDL_LIBS])
132 if test "$enable_opengl" = "yes"; then
135 if test "$no_gl" = "yes" -o "$enable_opengl" = "no"; then
137 AC_DEFINE([NOOPENGL],, [Define if opengl should not be used])
141 AC_SUBST([GL_AVAILABLE])
143 dnl Checks for library functions.
144 AC_CHECK_FUNCS(mkdir strdup strstr)
147 AC_CONFIG_FILES([Jamconfig])
154 echo " Profile Mode: $enable_gprof"
155 echo " Debug Mode: $enable_debug"
156 echo " OpenGL Support: $enable_opengl"
159 echo " NOTE: This project uses jam (and not make) as build tool"