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
28 dnl Checks for header files.
31 AC_CHECK_HEADERS(unistd.h)
33 dnl Checks for typedefs, structures, and compiler characteristics.
36 dnl ===========================================================================
37 dnl Give advanced users some options to play with
39 AC_MSG_CHECKING(for gprof mode)
41 AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),
42 [enable_gprof=$enableval], [enable_gprof=no])
43 if test "$enable_gprof" = "no"; then
44 CXXFLAGS="$CXXFLAGS -pg"
45 AC_MSG_RESULT([enabled])
47 AC_MSG_RESULT([disabled])
50 AC_MSG_CHECKING(for debug mode)
52 AC_HELP_STRING([--enable-debug], [enable debugging mode]),
53 [enable_debug=$enableval], [enable_debug=no])
54 if test "$enable_debug" = "yes"; then
55 CXXFLAGS="$CXXFLAGS -Wall -Werror -DDEBUG -O0 -g3"
56 AC_MSG_RESULT([enabled])
58 AC_MSG_RESULT([disabled])
61 AC_MSG_CHECKING(wether OpenGL should be used)
63 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),
64 [enable_opengl=$enableval], enable_opengl=yes)
65 if test "$enable_opengl" = "yes"; then
73 dnl ===========================================================================
75 AM_PATH_SDL($SDL_VERSION,
77 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
78 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
79 CFLAGS="$CFLAGS $SDL_CFLAGS"
80 LIBS="$LIBS $SDL_LIBS"
83 dnl Checks for additional libraries.
84 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
85 AC_MSG_ERROR([SDL_mixer library required]))
87 AC_CHECK_LIB(SDL_image, IMG_Load,,
88 AC_MSG_ERROR([SDL_image library required]))
90 if test "$enable_opengl" = "yes"; then
93 if test "$no_gl" = "yes" -o "$enable_opengl" = "no"; then
94 CXXFLAGS="$CXXFLAGS -DNOOPENGL"
97 CFLAGS="$CFLAGS $GL_CFLAGS"
98 CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
102 AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
104 CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'"
106 dnl Checks for library functions.
107 AC_CHECK_FUNCS(mkdir strdup strstr)
109 AC_OUTPUT(Makefile m4/Makefile intl/Makefile
118 echo " Profile Mode: $enable_gprof"
119 echo " Debug Mode: $enable_debug"
120 echo " OpenGL Support: $enable_opengl"