make em ready for something some strange people would actually call an official relea...
[supertux.git] / configure.ac
1 dnl ===========================================================================
2 dnl    "configure.in"
3 dnl
4 dnl current contact:
5 dnl          SuperTux development team
6 dnl
7 dnl original author:
8 dnl          Duong-Khang NGUYEN
9 dnl          neoneurone@users.sf.net
10 dnl ===========================================================================
11
12 dnl Process this file with autoconf to produce a configure script.
13
14 AC_PREREQ([2.54])
15 AC_INIT(SuperTux, 0.1.1)
16 AC_CONFIG_SRCDIR([src/supertux.cpp])
17 AC_CANONICAL_TARGET
18 AM_INIT_AUTOMAKE(dist-bzip2)
19
20 SDL_VERSION=1.2.4
21
22 AC_PROG_CC
23 AC_PROG_CXX
24 AC_PROG_INSTALL
25
26 dnl Checks for header files.
27 AC_HEADER_DIRENT
28 AC_HEADER_STDC
29 AC_CHECK_HEADERS(unistd.h)
30
31 dnl Checks for typedefs, structures, and compiler characteristics.
32 AC_C_CONST
33
34 dnl ===========================================================================
35 dnl Give advanced users some options to play with
36
37 AC_MSG_CHECKING(for gprof mode)
38 AC_ARG_ENABLE(gprof,
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])
43 else
44     AC_MSG_RESULT([disabled])
45 fi
46
47 AC_MSG_CHECKING(for debug mode)
48 AC_ARG_ENABLE(debug,
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])
53 else
54     AC_MSG_RESULT([disabled])
55 fi
56
57 AC_MSG_CHECKING(wether OpenGL should be used)
58 AC_ARG_ENABLE(opengl,
59               AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),, enable_opengl="yes")
60 if test "x${enable_opengl}" != "xno"; then
61     AC_MSG_RESULT([yes])
62 else
63     AC_MSG_RESULT([no])
64 fi
65
66 dnl ===========================================================================
67 dnl Check for SDL
68 AM_PATH_SDL($SDL_VERSION,
69             :,
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"
74
75 dnl Checks for additional libraries.
76 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
77         AC_MSG_ERROR([SDL_mixer library required]))
78
79 AC_CHECK_LIB(SDL_image, IMG_Load,,
80         AC_MSG_ERROR([SDL_image library required]))
81
82 if test "x${enable_opengl}" != "xno"; then
83   AX_CHECK_GL
84 fi
85 if test "x$no_gl" = "xyes" -o "x$enable_opengl" = "xno"; then
86   CXXFLAGS="$CXXFLAGS -DNOOPENGL"
87   enable_opengl="no"
88 else
89   CFLAGS="$CFLAGS $GL_CFLAGS"
90   CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
91   LIBS="$LIBS $GL_LIBS"
92 fi
93
94 AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
95
96 CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'" 
97
98 dnl Checks for library functions.
99 AC_CHECK_FUNCS(mkdir strdup strstr)
100
101 AC_OUTPUT(Makefile src/Makefile data/Makefile)
102
103 echo ""
104 echo "Features:"
105 echo "========="
106 echo " Profile Mode:   $enable_gprof"
107 echo " Debug Mode:     $enable_debug"
108 echo " OpenGL Support: $enable_opengl"
109 echo ""
110
111 # EOF #