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