removed obsolete AM_CONFIG_HEADER
[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 AC_PREREQ([2.54])
14 AC_INIT(SuperTux, 0.1.1)
15 AC_CONFIG_HEADERS(config.h)
16 AC_CONFIG_SRCDIR([src/supertux.cpp])
17 AC_CANONICAL_TARGET
18 AM_INIT_AUTOMAKE
19 dnl This is obsolete see automake1.7 // AM_CONFIG_HEADER
20
21 SDL_VERSION=1.2.4
22
23 AC_PROG_CC
24 AC_PROG_CXX
25 AC_PROG_INSTALL
26
27 dnl Checks for header files.
28 AC_HEADER_DIRENT
29 AC_HEADER_STDC
30 AC_CHECK_HEADERS(unistd.h)
31
32 dnl Checks for typedefs, structures, and compiler characteristics.
33 AC_C_CONST
34
35 dnl ===========================================================================
36 dnl Give advanced users some options to play with
37
38 AC_MSG_CHECKING(for gprof mode)
39 AC_ARG_ENABLE(gprof,
40               AC_HELP_STRING([--enable-gprof], [enable GNU profiling support]),, enable_gprof="no")
41 if test "x${enable_gprof}" != "xno"; then
42     CXXFLAGS="$CXXFLAGS -pg"
43     AC_MSG_RESULT([enabled])
44 else
45     AC_MSG_RESULT([disabled])
46 fi
47
48 AC_MSG_CHECKING(for debug mode)
49 AC_ARG_ENABLE(debug,
50               AC_HELP_STRING([--enable-debug], [enable debugging mode]),, enable_debug="yes")
51 if test "x${enable_debug}" != "xno"; then
52     CXXFLAGS="$CXXFLAGS -Wall -Werror -DDEBUG -O3 -g"
53     AC_MSG_RESULT([enabled])
54 else
55     AC_MSG_RESULT([disabled])
56 fi
57
58 AC_MSG_CHECKING(wether OpenGL should be used)
59 AC_ARG_ENABLE(opengl,
60               AC_HELP_STRING([--disable-opengl], [disable OpenGL support]),, enable_opengl="yes")
61 if test "x${enable_opengl}" != "xno"; then
62     AC_MSG_RESULT([yes])
63 else
64     AC_MSG_RESULT([no])
65 fi
66
67 AM_GNU_GETTEXT
68
69 dnl ===========================================================================
70 dnl Check for SDL
71 AM_PATH_SDL($SDL_VERSION,
72             :,
73             AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
74 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
75 CFLAGS="$CFLAGS $SDL_CFLAGS"
76 LIBS="$LIBS $SDL_LIBS"
77 GL_LIBS="-lGL"
78
79 dnl Checks for additional libraries.
80 AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
81         AC_MSG_ERROR([SDL_mixer library required]))
82
83 AC_CHECK_LIB(SDL_image, IMG_Load,,
84         AC_MSG_ERROR([SDL_image library required]))
85
86 if test "x${enable_opengl}" != "xno"; then
87   AX_CHECK_GL
88 fi
89 if test "x$no_gl" = "xyes" -o "x$enable_opengl" = "xno"; then
90   CXXFLAGS="$CXXFLAGS -DNOOPENGL"
91   enable_opengl="no"
92 else
93   CFLAGS="$CFLAGS $GL_CFLAGS"
94   CXXFLAGS="$CXXFLAGS $GL_CFLAGS"
95   LIBS="$LIBS $GL_LIBS"
96 fi
97
98 AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
99
100 CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'" 
101
102 dnl Checks for library functions.
103 AC_CHECK_FUNCS(mkdir strdup strstr)
104
105 AC_OUTPUT(Makefile m4/Makefile intl/Makefile
106           src/Makefile
107           data/Makefile
108           po/Makefile.in)
109
110 echo ""
111 echo "Features:"
112 echo "========="
113 echo " Profile Mode:   $enable_gprof"
114 echo " Debug Mode:     $enable_debug"
115 echo " OpenGL Support: $enable_opengl"
116 echo ""
117
118 # EOF #