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_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]),, enable_gprof="no")
42 if test "x${enable_gprof}" != "xno"; then
43 CXXFLAGS="$CXXFLAGS -pg"
44 AC_MSG_RESULT([enabled])
46 AC_MSG_RESULT([disabled])
49 AC_MSG_CHECKING(for debug mode)
51 AC_HELP_STRING([--enable-debug], [enable debugging mode]),, enable_debug="yes")
52 if test "x${enable_debug}" != "xno"; then
53 CXXFLAGS="$CXXFLAGS -Wall -Werror -DDEBUG -O3 -g"
54 AC_MSG_RESULT([enabled])
56 AC_MSG_RESULT([disabled])
59 AC_MSG_CHECKING(wether OpenGL should be used)
61 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),, enable_opengl="yes")
62 if test "x${enable_opengl}" != "xno"; then
70 dnl ===========================================================================
72 AM_PATH_SDL($SDL_VERSION,
74 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
75 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
76 CFLAGS="$CFLAGS $SDL_CFLAGS"
77 LIBS="$LIBS $SDL_LIBS"
80 dnl Checks for additional libraries.
81 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
82 AC_MSG_ERROR([SDL_mixer library required]))
84 AC_CHECK_LIB(SDL_image, IMG_Load,,
85 AC_MSG_ERROR([SDL_image library required]))
87 if test "x${enable_opengl}" != "xno"; then
90 if test "x$no_gl" = "xyes" -o "x$enable_opengl" = "xno"; then
91 CXXFLAGS="$CXXFLAGS -DNOOPENGL"
94 CFLAGS="$CFLAGS $GL_CFLAGS"
95 CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
99 AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
101 CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'"
103 dnl Checks for library functions.
104 AC_CHECK_FUNCS(mkdir strdup strstr)
106 AC_OUTPUT(Makefile m4/Makefile intl/Makefile
115 echo " Profile Mode: $enable_gprof"
116 echo " Debug Mode: $enable_debug"
117 echo " OpenGL Support: $enable_opengl"