source: trunk/configure.ac @ 178

Last change on this file since 178 was 178, checked in by sam, 10 years ago

Proper detection of libcaca and libpipi.

File size: 2.8 KB
Line 
1# $Id$
2
3AC_INIT(deushax, 0.0)
4AC_PREREQ(2.50)
5AC_CONFIG_AUX_DIR(.auto)
6AC_CANONICAL_SYSTEM
7AM_INIT_AUTOMAKE([no-define tar-ustar])
8dnl AM_MAINTAINER_MODE
9
10AM_CONFIG_HEADER(config.h)
11
12AM_PROG_CC_C_O
13AC_PROG_CPP
14AC_PROG_CXX
15AC_PROG_CXXCPP
16AC_PROG_RANLIB
17
18AC_LIBTOOL_WIN32_DLL
19AM_PROG_LIBTOOL
20AC_LIBTOOL_CXX
21
22AC_C_CONST
23AC_C_INLINE
24
25dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
26dnl now otherwise it might be set in an obscure if statement. Same thing for
27dnl PKG_PROG_PKG_CONFIG which needs to be called first.
28AC_EGREP_CPP(yes, foo)
29PKG_PROG_PKG_CONFIG()
30m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
31if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
32  export PKG_CONFIG_LIBDIR=/dev/null
33fi
34
35dnl conditional builds
36AC_ARG_ENABLE(debug,
37  [  --enable-debug          build debug versions of the game (default no)])
38AC_ARG_ENABLE(release,
39  [  --enable-release        build final release of the game (default no)])
40
41AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
42
43# Optimizations
44CXXFLAGS="${CXXFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
45# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
46CXXFLAGS="${CXXFLAGS} -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare"
47
48AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
49
50# Use SDL?
51ac_cv_my_have_sdl="no"
52save_CPPFLAGS="${CPPFLAGS}"
53AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
54if test "${SDL_CONFIG}" != "no"; then
55  CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
56fi
57AC_CHECK_HEADERS(SDL_image.h,
58 [ac_cv_my_have_sdl="yes"],
59 [ac_cv_my_have_sdl="no"])
60CPPFLAGS="${save_CPPFLAGS}"
61if test "${ac_cv_my_have_sdl}" != "no"; then
62  AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
63fi
64AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
65
66if test "${ac_cv_my_have_sdl}" = "no" -a "${ac_cv_my_have_imlib2}" = "no"; then
67  AC_MSG_ERROR([[cannot find SDL_Image or GTK+, please install one of them]])
68fi
69
70
71# Use libcaca? (required for font generation)
72ac_cv_my_have_caca="no"
73PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17, [ac_cv_my_have_caca="yes"], [:])
74if test "${ac_cv_my_have_caca}" != "no"; then
75  AC_DEFINE(USE_CACA, 1, Define to 1 to use libcaca)
76fi
77AM_CONDITIONAL(USE_CACA, test "${ac_cv_my_have_caca}" != "no")
78
79
80# Use libpipi? (required for video recording)
81ac_cv_my_have_pipi="no"
82PKG_CHECK_MODULES(PIPI, pipi, [ac_cv_my_have_pipi="yes"], [:])
83if test "${ac_cv_my_have_pipi}" != "no"; then
84  AC_DEFINE(USE_PIPI, 1, Define to 1 to use libpipi)
85fi
86AM_CONDITIONAL(USE_PIPI, test "${ac_cv_my_have_pipi}" != "no")
87
88
89if test "${enable_release}" = "yes"; then
90  AC_DEFINE(FINAL_RELEASE, 1, Define to 1 to activate final release)
91fi
92
93AC_SUBST(MATH_LIBS)
94
95AC_CONFIG_FILES([
96  Makefile
97  src/Makefile
98  tools/Makefile
99  art/Makefile
100  art/test/Makefile
101  gfx/Makefile
102  gfx/font/Makefile
103  maps/Makefile
104])
105
106AC_OUTPUT
107
Note: See TracBrowser for help on using the repository browser.