- fixed some minor issues
[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.6-cvs)
11 AC_CONFIG_SRCDIR([src/supertux.c])
12 AC_CANONICAL_TARGET
13 AM_INIT_AUTOMAKE
14
15 SDL_VERSION=1.2.4
16
17 AC_PROG_CC
18 AC_PROG_INSTALL
19 AC_LANG(C)
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     CFLAGS="$CFLAGS -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="no"))
45 if test "x${enable_debug}" != "xno"; then
46     AC_MSG_RESULT([enabled])
47 else
48     AC_MSG_RESULT([disabled])
49 fi
50
51 dnl ===========================================================================
52 dnl Check for SDL
53 AM_PATH_SDL($SDL_VERSION,
54             :,
55             AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
56
57 CFLAGS="$CFLAGS $SDL_CFLAGS"
58 LDFLAGS="$LDFLAGS $SDL_LIBS"
59
60 dnl Checks for additional libraries.
61 AC_CHECK_LIB(SDL_mixer, SDL_OpenAudio, ,AC_MSG_ERROR(SDL_mixer library required))
62 AC_CHECK_LIB(SDL_image, IMG_Load, ,AC_MSG_ERROR(SDL_image library required))
63 AC_CHECK_LIB(GL, glBegin, ,AC_MSG_ERROR(GL library required))
64
65 # FIXME: Evil
66 CFLAGS="$CFLAGS -DDATA_PREFIX=\\\"$PWD/data\\\" -DLINUX"
67
68 dnl Checks for library functions.
69 AC_CHECK_FUNCS(mkdir strdup strstr)
70
71 AC_OUTPUT(Makefile src/Makefile data/Makefile)
72
73 # EOF #