source: trunk/configure.ac @ 115

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

Fix the extra data in the autotools-created tarballs.

File size: 2.3 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
70if test "${enable_debug}" = "yes"; then
71  AC_DEFINE(DEBUG, 1, Define to 1 to activate debug)
72fi
73
74if test "${enable_release}" = "yes"; then
75  AC_DEFINE(FINAL_RELEASE, 1, Define to 1 to activate final release)
76fi
77
78AC_SUBST(MATH_LIBS)
79
80AC_CONFIG_FILES([
81  Makefile
82  src/Makefile
83  tools/Makefile
84  art/Makefile
85  art/test/Makefile
86  gfx/Makefile
87  gfx/font/Makefile
88  maps/Makefile
89])
90
91AC_OUTPUT
92
Note: See TracBrowser for help on using the repository browser.