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.1.1)
15 AC_CONFIG_SRCDIR([src/supertux.cpp])
25 dnl Checks for header files.
28 AC_CHECK_HEADERS(unistd.h)
30 dnl Checks for typedefs, structures, and compiler characteristics.
33 dnl ===========================================================================
34 dnl Give advanced users some options to play with
36 AC_MSG_CHECKING(for gprof mode)
38 AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),, enable_gprof="no")
39 if test "x${enable_gprof}" != "xno"; then
40 CXXFLAGS="$CXXFLAGS -pg"
41 AC_MSG_RESULT([enabled])
43 AC_MSG_RESULT([disabled])
46 AC_MSG_CHECKING(for debug mode)
48 AC_HELP_STRING([--enable-debug], [enable debugging mode]),, enable_debug="yes")
49 if test "x${enable_debug}" != "xno"; then
50 CXXFLAGS="$CXXFLAGS -Wall -Werror -DDEBUG -O0 -g3"
51 AC_MSG_RESULT([enabled])
53 AC_MSG_RESULT([disabled])
56 AC_MSG_CHECKING(wether OpenGL should be used)
58 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),, enable_opengl="yes")
59 if test "x${enable_opengl}" != "xno"; then
67 dnl ===========================================================================
69 AM_PATH_SDL($SDL_VERSION,
71 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
72 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
73 CFLAGS="$CFLAGS $SDL_CFLAGS"
74 LIBS="$LIBS $SDL_LIBS"
77 dnl Checks for additional libraries.
78 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
79 AC_MSG_ERROR([SDL_mixer library required]))
81 AC_CHECK_LIB(SDL_image, IMG_Load,,
82 AC_MSG_ERROR([SDL_image library required]))
84 if test "x${enable_opengl}" != "xno"; then
87 if test "x$no_gl" = "xyes" -o "x$enable_opengl" = "xno"; then
88 CXXFLAGS="$CXXFLAGS -DNOOPENGL"
91 CFLAGS="$CFLAGS $GL_CFLAGS"
92 CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
96 AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
98 CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'"
100 dnl Checks for library functions.
101 AC_CHECK_FUNCS(mkdir strdup strstr)
103 AC_OUTPUT(Makefile m4/Makefile intl/Makefile
111 echo " Profile Mode: $enable_gprof"
112 echo " Debug Mode: $enable_debug"
113 echo " OpenGL Support: $enable_opengl"