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-svn)
15 AC_CONFIG_SRCDIR([src/main.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])
45 AC_CHECK_PROGS([BISON], bison)
48 dnl Checks for header files.
51 AC_CHECK_HEADERS(unistd.h)
53 dnl Checks for typedefs, structures, and compiler characteristics.
56 dnl ===========================================================================
57 dnl Give advanced users some options to play with
60 AC_MSG_CHECKING(for gprof mode)
62 AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),
63 [enable_gprof=$enableval], [enable_gprof=no])
64 if test "$enable_gprof" = "yes"; then
65 #CXXFLAGS="$CXXFLAGS -pg"
67 AC_MSG_RESULT([enabled])
69 AC_MSG_RESULT([disabled])
72 AC_MSG_CHECKING(for debug mode)
74 AC_HELP_STRING([--enable-debug], [enable debugging mode]),
75 [enable_debug=$enableval], [enable_debug=no])
76 if test "$enable_debug" = "yes"; then
77 AC_DEFINE([DEBUG], 1, [define to compile in debug checks])
79 AC_MSG_RESULT([enabled])
82 AC_MSG_RESULT([disabled])
86 AC_MSG_CHECKING(whether OpenGL should be used)
88 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),
89 [enable_opengl=$enableval], enable_opengl=yes)
90 if test "$enable_opengl" = "yes"; then
97 AC_MSG_CHECKING([for iconv])
98 AC_TRY_LINK([#include <iconv.h>], [iconv_open(0, 0);], [iconv_found="yes"])
99 AS_IF([test "$iconv_found" = no],
101 AC_TRY_LINK([#include <iconv.h>], [iconv_open(0, 0);], [iconv_found="yes"]))
102 AS_IF([test "$iconv_found" = no],
103 AC_MSG_ERROR([Couldn't find iconv library]),
104 AC_MSG_RESULT([found]))
106 dnl ===========================================================================
109 AM_PATH_SDL($SDL_VERSION,
111 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
113 NP_FINDLIB([SDLMIXER], [SDL_mixer], [SDL_mixer >= 1.2],
114 NP_LANG_PROGRAM([#include <SDL_mixer.h>
115 #if MIX_MAJOR_VERSION < 1
116 # error SDLMix too old
118 # if MIX_MAJOR_VERSION == 1
119 # if MIX_MINOR_VERSION < 2
120 # error SDLMix too old
123 #endif], [Mix_OpenAudio(0, 0, 0, 0);]),
126 [AC_MSG_ERROR([Please install SDLMixer >=1.2.2])],
127 [$SDL_CFLAGS], [$SDL_LIBS])
129 NP_FINDLIB([SDLIMAGE], [SDL_image], [SDL_image >= 1.2],
130 NP_LANG_PROGRAM([#include <SDL_image.h>], [IMG_Load("");]),
133 [AC_MSG_ERROR([Please install SDLImage >= 1.2.1])],
134 [$SDL_CFLAGS], [$SDL_LIBS])
136 if test "$enable_opengl" = "yes"; then
139 if test "$no_gl" = "yes" -o "$enable_opengl" = "no"; then
141 AC_DEFINE([NOOPENGL],, [Define if opengl should not be used])
145 AC_SUBST([GL_AVAILABLE])
147 dnl Checks for library functions.
148 AC_CHECK_FUNCS(mkdir strdup strstr)
151 AC_CONFIG_FILES([Jamconfig])
158 echo " Profile Mode: $enable_gprof"
159 echo " Debug Mode: $enable_debug"
160 echo " OpenGL Support: $enable_opengl"
163 echo " NOTE: This project uses jam (and not make) as build tool"