1AC_PREREQ([2.68])
2AC_INIT([TecnoballZ], [0.93.1], [info@tlkgames.com])
3dnl AC_CONFIG_SRCDIR([src/list_sprites.cc])
4AC_CONFIG_HEADERS([config.h])
5AM_INIT_AUTOMAKE([foreign])
6
7AC_ARG_ENABLE(devel,
8[  --enable-devel          Development version (default disabled)],
9enable_devel=yes, enable_devel=no)
10
11
12# Checks for programs.
13AC_PROG_CXX
14AC_CHECK_LIB(m, sincos)
15
16# Checks for libraries.
17AM_PATH_SDL
18LDFLAGS="${LDFLAGS} ${SDL_LIBS}"
19AC_CHECK_LIB(SDL_mixer, Mix_GetChunk, [
20  SDL_LIBS="-lSDL_mixer ${SDL_LIBS}"
21],[
22  AC_MSG_ERROR(Could not find -lSDL_mixer)
23])
24AC_CHECK_LIB(SDL_image, main, [
25  SDL_LIBS="-lSDL_image ${SDL_LIBS}"
26],[
27  AC_MSG_ERROR(Could not find -lSDL_image)
28])
29AC_CHECK_LIB(SDL_mixer, Mix_GetChunk, [
30  SDL_LIBS="-lSDL_mixer ${SDL_LIBS}"
31],[
32  AC_MSG_ERROR(Could not find -lSDL_mixer)
33])
34AC_CHECK_LIB(mikmod, Player_Stop, [
35  MIKMOD_LIBS="-lmikmod"
36  MIKMOD_FLAGS="-pthread -D_REENTRANT"
37],[
38  AC_MSG_ERROR(Could not find the Mikmod library : -lmikmod)
39])
40AC_SUBST(MIKMOD_FLAGS)
41AC_SUBST(MIKMOD_LIBS)
42
43AC_LANG_PUSH([C++])
44
45AC_CHECK_LIB([tinyxml], [main], [
46  TINYXML_LIBS="-ltinyxml"
47],[
48  AC_MSG_ERROR([tinyxml library is not present in your system])
49])
50AC_SUBST(TINYXML_LIBS)
51
52AC_LANG_POP([C++])
53
54# Checks for header files.
55AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/time.h unistd.h])
56
57# Checks for typedefs, structures, and compiler characteristics.
58AC_HEADER_STDBOOL
59AC_C_INLINE
60AC_TYPE_SIZE_T
61AC_TYPE_SSIZE_T
62AC_CHECK_TYPES([ptrdiff_t])
63
64# Checks for library functions.
65AC_FUNC_MALLOC
66AC_CHECK_FUNCS([atexit memmove strchr strdup strerror])
67
68if test "x${enable_devel}" = "xyes"; then
69  AC_DEFINE(UNDER_DEVELOPMENT,  1, Define to enable development version)
70#  CXXFLAGS="-Werror -O2 -Wall -pedantic -Wextra -std=gnu++98 -g"
71else
72#  CXXFLAGS="-O2 -Werror -Wall -pedantic -Wextra -std=gnu++98"
73fi
74
75AC_OUTPUT(
76  Makefile
77  src/Makefile
78  src/TecnoballZ/Makefile
79  src/TecnoballZ/hires/Makefile
80  src/TecnoballZ/lores/Makefile
81  src/TecnoballZ/textures/Makefile
82  src/TecnoballZ/musics/Makefile
83  src/TecnoballZ/sounds/Makefile
84  src/TecnoballZ/texts/Makefile)
85
86echo "
87
88TecnoballZ ready for building!
89
90  enable_devel      : $enable_devel
91
92Type 'make' to build.
93
94"
95
96
97
98
99
100