source: trunk/configure.ac @ 92

Last change on this file since 92 was 92, checked in by sam, 11 years ago

Convert everything to the autotools. Managing source dependencies will be
easier.

File size: 2.1 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 library (default no)])
38
39AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
40
41# Optimizations
42CXXFLAGS="${CXXFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
43# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
44CXXFLAGS="${CXXFLAGS} -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare"
45
46AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
47
48# Use SDL?
49ac_cv_my_have_sdl="no"
50save_CPPFLAGS="${CPPFLAGS}"
51AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
52if test "${SDL_CONFIG}" != "no"; then
53  CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
54fi
55AC_CHECK_HEADERS(SDL_image.h,
56 [ac_cv_my_have_sdl="yes"],
57 [ac_cv_my_have_sdl="no"])
58CPPFLAGS="${save_CPPFLAGS}"
59if test "${ac_cv_my_have_sdl}" != "no"; then
60  AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
61fi
62AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
63
64if test "${ac_cv_my_have_sdl}" = "no" -a "${ac_cv_my_have_imlib2}" = "no"; then
65  AC_MSG_ERROR([[cannot find SDL_Image or GTK+, please install one of them]])
66fi
67
68if test "${enable_debug}" = "yes"; then
69  AC_DEFINE(DEBUG, 1, Define to 1 to activate debug)
70fi
71
72AC_SUBST(MATH_LIBS)
73
74AC_CONFIG_FILES([
75  Makefile
76  src/Makefile
77  tools/Makefile
78  art/Makefile
79  art/test/Makefile
80  gfx/Makefile
81  gfx/font/Makefile
82])
83
84AC_OUTPUT
85
Note: See TracBrowser for help on using the repository browser.