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_HEADERS(config.h)
16 AC_CONFIG_SRCDIR([src/supertux.cpp])
19 dnl This is obsolete see automake1.7 // AM_CONFIG_HEADER
21 # we don't want the stupid autoconf default -g -O2
22 test ".$CXXFLAGS" = "." && CXXFLAGS=" "
24 CXXFLAGS="$CXXFLAGS -ffast-math"
31 dnl Checks for header files.
34 AC_CHECK_HEADERS(unistd.h)
36 dnl Checks for typedefs, structures, and compiler characteristics.
39 dnl ===========================================================================
40 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"
48 AC_MSG_RESULT([enabled])
50 AC_MSG_RESULT([disabled])
53 AC_MSG_CHECKING(for debug mode)
55 AC_HELP_STRING([--enable-debug], [enable debugging mode]),
56 [enable_debug=$enableval], [enable_debug=no])
57 if test "$enable_debug" = "yes"; then
58 AC_DEFINE([DEBUG], 1, [define to compile in debug checks])
59 CXXFLAGS="$CXXFLAGS -Wall -Werror -O0 -g3"
60 AC_MSG_RESULT([enabled])
62 CXXFLAGS="$CXXFLAGS -O2 -g"
63 AC_MSG_RESULT([disabled])
66 AC_MSG_CHECKING(wether OpenGL should be used)
68 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),
69 [enable_opengl=$enableval], enable_opengl=yes)
70 if test "$enable_opengl" = "yes"; then
78 dnl ===========================================================================
81 AM_PATH_SDL($SDL_VERSION,
83 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
84 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
85 CFLAGS="$CFLAGS $SDL_CFLAGS"
86 LIBS="$LIBS $SDL_LIBS"
89 dnl Checks for additional libraries.
90 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
91 AC_MSG_ERROR([SDL_mixer library required]))
93 AC_CHECK_LIB(SDL_image, IMG_Load,,
94 AC_MSG_ERROR([SDL_image library required]))
96 if test "$enable_opengl" = "yes"; then
99 if test "$no_gl" = "yes" -o "$enable_opengl" = "no"; then
100 CXXFLAGS="$CXXFLAGS -DNOOPENGL"
103 CFLAGS="$CFLAGS $GL_CFLAGS"
104 CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
105 LIBS="$LIBS $GL_LIBS"
108 AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
110 CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'"
112 dnl Checks for library functions.
113 AC_CHECK_FUNCS(mkdir strdup strstr)
115 AC_OUTPUT(Makefile m4/Makefile intl/Makefile
124 echo " Profile Mode: $enable_gprof"
125 echo " Debug Mode: $enable_debug"
126 echo " OpenGL Support: $enable_opengl"