commited Matzes Win32 patch
[supertux.git] / configure.ac
1 dnl ===========================================================================
2 dnl    "configure.in"
3 dnl
4 dnl author: Duong-Khang NGUYEN
5 dnl         neoneurone@users.sf.net
6 dnl ===========================================================================
7
8 dnl Process this file with autoconf to produce a configure script.
9
10 AC_INIT(SuperTux, 0.0.7-cvs)
11 AC_CONFIG_SRCDIR([src/supertux.cpp])
12 AC_CANONICAL_TARGET
13 AM_INIT_AUTOMAKE
14
15 SDL_VERSION=1.2.4
16
17 AC_PROG_CC
18 AC_PROG_CXX
19 AC_PROG_INSTALL
20
21 dnl Checks for header files.
22 AC_HEADER_DIRENT
23 AC_HEADER_STDC
24 AC_CHECK_HEADERS(unistd.h)
25
26 dnl Checks for typedefs, structures, and compiler characteristics.
27 AC_C_CONST
28
29 dnl ===========================================================================
30 dnl Give advanced users some options to play with
31
32 AC_MSG_CHECKING(for gprof mode)
33 AC_ARG_ENABLE(gprof,
34               AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),, enable_gprof="no")
35 if test "x${enable_gprof}" != "xno"; then
36     CXXFLAGS="$CXXFLAGS -pg"
37     AC_MSG_RESULT([enabled])
38 else
39     AC_MSG_RESULT([disabled])
40 fi
41
42 AC_MSG_CHECKING(for debug mode)
43 AC_ARG_ENABLE(debug,
44               AC_HELP_STRING([--enable-debug], [enable debugging mode]),, enable_debug="yes")
45 if test "x${enable_debug}" != "xno"; then
46     CXXFLAGS="$CXXFLAGS -Wall -W -DDEBUG"
47     AC_MSG_RESULT([enabled])
48 else
49     AC_MSG_RESULT([disabled])
50 fi
51
52 AC_MSG_CHECKING(wether OpenGL should be used)
53 AC_ARG_ENABLE(opengl,
54               AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),, enable_opengl="yes")
55 if test "x${enable_opengl}" != "xno"; then
56     AC_MSG_RESULT([yes])
57 else
58     AC_MSG_RESULT([no])
59 fi
60
61 dnl ===========================================================================
62 dnl Check for SDL
63 AM_PATH_SDL($SDL_VERSION,
64             :,
65             AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
66 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
67 CFLAGS="$CFLAGS $SDL_CFLAGS"
68 LIBS="$LIBS $SDL_LIBS"
69
70 dnl Checks for additional libraries.
71 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
72         AC_MSG_ERROR([SDL_mixer library required]))
73
74 AC_CHECK_LIB(SDL_image, IMG_Load,,
75         AC_MSG_ERROR([SDL_image library required]))
76
77 if test "x${enable_opengl}" != "xno"; then
78   AX_CHECK_GL
79 fi
80 if test "x$no_gl" = "xyes" -o "x$enable_opengl" = "xno"; then
81   CXXFLAGS="$CXXFLAGS -DNOOPENGL"
82   enable_opengl="no"
83 else
84   CFLAGS="$CFLAGS $GL_CFLAGS"
85   CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
86   LIBS="$LIBS $GL_LIBS"
87 fi
88
89 AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
90
91 CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datatdir/supertux\"'" 
92
93 dnl Checks for library functions.
94 AC_CHECK_FUNCS(mkdir strdup strstr)
95
96 AC_OUTPUT(Makefile src/Makefile data/Makefile)
97
98 echo ""
99 echo "Features:"
100 echo "========="
101 echo " Profile Mode:   $enable_gprof"
102 echo " Debug Mode:     $enable_debug"
103 echo " OpenGL Support: $enable_opengl"
104 echo ""
105
106 # EOF #