1 dnl ===========================================================================
4 dnl author: Duong-Khang NGUYEN
5 dnl neoneurone@users.sf.net
6 dnl ===========================================================================
8 dnl Process this file with autoconf to produce a configure script.
10 AC_INIT(SuperTux, 0.0.6-cvs)
11 AC_CONFIG_SRCDIR([src/supertux.c])
21 dnl Checks for header files.
24 AC_CHECK_HEADERS(unistd.h)
26 dnl Checks for typedefs, structures, and compiler characteristics.
29 dnl ===========================================================================
30 dnl Give advanced users some options to play with
32 AC_MSG_CHECKING(for gprof mode)
34 AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),, enable_gprof="no")
35 if test "x${enable_gprof}" != "xno"; then
37 AC_MSG_RESULT([enabled])
39 AC_MSG_RESULT([disabled])
42 AC_MSG_CHECKING(for debug mode)
44 AC_HELP_STRING([--enable-debug], [enable debugging mode]),, enable_debug="yes")
45 if test "x${enable_debug}" != "xno"; then
46 CFLAGS="$CFLAGS -DDEBUG"
47 AC_MSG_RESULT([enabled])
49 AC_MSG_RESULT([disabled])
52 AC_MSG_CHECKING(weather OpenGL should be used)
54 AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),, enable_opengl="yes")
55 if test "x${enable_opengl}" != "xno"; then
56 CFLAGS="$CFLAGS -D__OPENGL"
59 CFLAGS="$CFLAGS -DNOOPENGL"
63 AC_MSG_CHECKING(weather Sound should be supported)
65 AC_HELP_STRING([--disable-sound], [disable sound support]),, enable_sound="yes")
66 if test "x${enable_sound}" != "xno"; then
67 CFLAGS="$CFLAGS -D__SOUND"
70 CFLAGS="$CFLAGS -DNOSOUND"
74 dnl ===========================================================================
76 AM_PATH_SDL($SDL_VERSION,
78 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
80 CFLAGS="$CFLAGS $SDL_CFLAGS"
81 LDFLAGS="$LDFLAGS $SDL_LIBS"
83 dnl Checks for additional libraries.
84 if test "x${enable_sound}" != "xno"; then
85 AC_CHECK_LIB(SDL_mixer, SDL_OpenAudio,,
86 [CFLAGS="$CFLAGS -DNOSOUND"
90 AC_CHECK_LIB(SDL_image, IMG_Load, ,AC_MSG_ERROR(SDL_image library required))
92 if test "x${enable_opengl}" != "xno"; then
93 # grumbel: xlib path is needed on my system to get OpenGL right,
94 # else I end up with a black screen, might be a debian issue or a
95 # local issue on my system, not sure
97 CFLAGS="$CFLAGS $X_CFLAGS"
98 LDFLAGS="$LDFLAGS $X_LIBS"
100 AC_CHECK_LIB(GL, glBegin,,
101 [CFLAGS="$CFLAGS -DNOOPENGL"
106 CFLAGS="$CFLAGS -DDATA_PREFIX='\"$datadir/supertux/\"' -DLINUX"
108 dnl Checks for library functions.
109 AC_CHECK_FUNCS(mkdir strdup strstr)
111 AC_OUTPUT(Makefile src/Makefile data/Makefile)
116 echo " Profile Mode: $enable_gprof"
117 echo " Debug Mode: $enable_debug"
118 echo " OpenGL Support: $enable_opengl"
119 echo " Sound Support: $enable_sound"