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.
15 AC_INIT(SuperTux, 0.1.1)
16 AC_CONFIG_SRCDIR([src/supertux.cpp])
18 AM_INIT_AUTOMAKE(dist-bzip2)
26 dnl Checks for header files.
29 AC_CHECK_HEADERS(unistd.h)
31 dnl Checks for typedefs, structures, and compiler characteristics.
34 dnl ===========================================================================
35 dnl Give advanced users some options to play with
37 AC_MSG_CHECKING(for gprof mode)
39 AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),, enable_gprof="no")
40 if test "x${enable_gprof}" != "xno"; then
41 CXXFLAGS="$CXXFLAGS -pg"
42 AC_MSG_RESULT([enabled])
44 AC_MSG_RESULT([disabled])
47 AC_MSG_CHECKING(for debug mode)
49 AC_HELP_STRING([--enable-debug], [enable debugging mode]),, enable_debug="yes")
50 if test "x${enable_debug}" != "xno"; then
51 CXXFLAGS="$CXXFLAGS -Wall -W -DDEBUG -O0 -g3"
52 AC_MSG_RESULT([enabled])
54 AC_MSG_RESULT([disabled])
57 AC_MSG_CHECKING(wether OpenGL should be used)
59 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),, enable_opengl="yes")
60 if test "x${enable_opengl}" != "xno"; then
66 dnl ===========================================================================
68 AM_PATH_SDL($SDL_VERSION,
70 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
71 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
72 CFLAGS="$CFLAGS $SDL_CFLAGS"
73 LIBS="$LIBS $SDL_LIBS"
76 dnl Checks for additional libraries.
77 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
78 AC_MSG_ERROR([SDL_mixer library required]))
80 AC_CHECK_LIB(SDL_image, IMG_Load,,
81 AC_MSG_ERROR([SDL_image library required]))
83 if test "x${enable_opengl}" != "xno"; then
86 if test "x$no_gl" = "xyes" -o "x$enable_opengl" = "xno"; then
87 CXXFLAGS="$CXXFLAGS -DNOOPENGL"
90 CFLAGS="$CFLAGS $GL_CFLAGS"
91 CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
95 AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
97 CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'"
99 dnl Checks for library functions.
100 AC_CHECK_FUNCS(mkdir strdup strstr)
102 AC_OUTPUT(Makefile src/Makefile data/Makefile)
107 echo " Profile Mode: $enable_gprof"
108 echo " Debug Mode: $enable_debug"
109 echo " OpenGL Support: $enable_opengl"