summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 16e4ced272c4b5b8839195033c3cef38c077810f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
AC_INIT([sdlex], [0.1.0], [pjm@nac.net])
AC_CONFIG_SRCDIR([src/main.c])

AM_INIT_AUTOMAKE([subdir-objects])

AC_PROG_CC()
AM_PROG_CC_C_O()

AC_C_INLINE()

AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_HEADERS([inttypes.h])

AC_TYPE_SIZE_T()

AC_FUNC_MALLOC()
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([strndup])

PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES([SDL], [sdl])
PKG_CHECK_MODULES([SDL_IMAGE], [SDL_image])
PKG_CHECK_MODULES([ZLIB], [zlib])
PKG_CHECK_MODULES([EXPAT], [expat])

if test "x$GCC" = "xyes"; then
	GCC_CFLAGS="-pedantic -Wall -Wextra -Werror"
	GCC_CFLAGS="${GCC_CFLAGS} -Wformat=2 -Wswitch -Wswitch-enum"
	GCC_CFLAGS="${GCC_CFLAGS} -Wdeclaration-after-statement -Wundef -Wshadow"
	GCC_CFLAGS="${GCC_CFLAGS} -Wpointer-arith -Wbad-function-cast"
	GCC_CFLAGS="${GCC_CFLAGS} -Wcast-qual -Wcast-align -Wwrite-strings"
	#GCC_CFLAGS="${GCC_CFLAGS} -Wconversion"
	GCC_CFLAGS="${GCC_CFLAGS} -Wlogical-op -Waggregate-return"
	GCC_CFLAGS="${GCC_CFLAGS} -Wstrict-prototypes -Wold-style-definition"
	GCC_CFLAGS="${GCC_CFLAGS} -Wmissing-prototypes -Wmissing-declarations"
	GCC_CFLAGS="${GCC_CFLAGS} -Wredundant-decls -Wnested-externs"
	GCC_CFLAGS="${GCC_CFLAGS} -Wunreachable-code -Winline"
	GCC_CFLAGS="${GCC_CFLAGS} -Wdisabled-optimization"
	GCC_CFLAGS="${GCC_CFLAGS} -fstack-protector -Wstack-protector"
fi
AC_SUBST(GCC_CFLAGS)

AC_ARG_ENABLE([debug-tmx],
	[AC_HELP_STRING([--enable-debug-tmx],
		[enable debug output from TMX parser])],
	[enable_debug_tmx=yes],
	[])
if test "x$enable_debug_tmx" = "xyes"; then
	AC_DEFINE([DEBUG_TMX], [1],
		[Define to 1 to enable debug output from TMX parser])
fi

AC_ARG_ENABLE([debug-compression],
	[AC_HELP_STRING([--enable-debug-compression],
		[enable debug output from tile data inflation])],
	[enable_debug_compression=yes],
	[])
if test "x$enable_debug_compression" = "xyes"; then
	AC_DEFINE([DEBUG_COMPRESSION], [1],
		[Define to 1 to enable debug output from tile data inflation])
fi

AC_ARG_ENABLE([debug-render],
	[AC_HELP_STRING([--enable-debug-render],
		[enable debug output from map layer blits and area rendering])],
	[enable_debug_render=yes],
	[])
if test "x$enable_debug_render" = "xyes"; then
	AC_DEFINE([DEBUG_RENDER], [1],
		[Define to 1 to enable debug output from map layer blits and
			area rendering])
fi

AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT()