File: configure.ac

package info (click to toggle)
hex-a-hop 1.1.0+git20140926-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 34,860 kB
  • sloc: cpp: 4,987; ansic: 1,876; xml: 430; makefile: 176; sh: 33
file content (118 lines) | stat: -rw-r--r-- 3,309 bytes parent folder | download
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
AC_PREREQ([2.58])
AC_INIT([Hex-a-hop],[1.2.0],[http://hexahop.sourceforge.net],[hex-a-hop])
AC_CONFIG_AUX_DIR([msc])
AC_CONFIG_MACRO_DIR([msc])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS([src/config.h])
AM_MAINTAINER_MODE([enable])

AC_SEARCH_LIBS([strerror],[cposix])
AC_PROG_CC
AC_PROG_CXX

AC_HEADER_STDC

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18])

AC_CHECK_HEADERS(stdint.h windows.h)
AC_CHECK_LIB(m, main)

AM_ICONV
if test "$am_cv_func_iconv" = yes; then
       AC_DEFINE_UNQUOTED(ICONV_CONST, [$am_cv_proto_iconv_arg1],
               [Define as const if the declaration of iconv() needs const.])
fi

# Check for SDL.
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION, :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))

# Arguments.
AC_ARG_ENABLE([debug], AS_HELP_STRING([--disable-debug],[Do not compile with debugging symbols]), [want_debug=$enableval], [want_debug=no])
AC_ARG_ENABLE([sound], AS_HELP_STRING([--disable-sound],[Do not compile with sound support]), [want_sound=$enableval], [want_sound=yes])
AC_ARG_ENABLE([sdlttf], AS_HELP_STRING([--disable-sdlttf],[Use SDL_Pango instead of SDL_ttf]), [want_ttf=$enableval], [want_ttf=no])
AC_ARG_ENABLE([relpath], AS_HELP_STRING([--enable-relpath],[Install everything under a single directory]), [want_relative=$enableval], [want_relative=no])

# Allow specifiying a hard-coded font file at build time
AC_ARG_WITH(font-path,
        AS_HELP_STRING([--with-font-path=file.ttf],
                [Path to the TTF font to use at runtime with SDL_ttf (DejaVu Sans Bold recommended)]),
        [FONT_PATH="$withval"],
        [FONT_PATH=""])

# Compilation flags.
if test "$want_debug" = yes; then
	DEBUG_FLAGS="-g -D_DEBUG"
else
	DEBUG_FLAGS="-DNDEBUG"
fi

# Check for SDL_image.
SDL_LIBS="$SDL_LIBS -lSDL_image"
SDL_CFLAGS="$SDL_CFLAGS"

# Conditional sound compilation.
if test "$want_sound" = yes; then
	MAYBE_SOUND="sound"

	# Check for SDL_mixer.
	SDL_LIBS="$SDL_LIBS -lSDL_mixer"
	SDL_CFLAGS="$SDL_CFLAGS"
else
	MAYBE_SOUND=
	SOUND_FLAGS="-DDISABLE_SOUND"
fi

# Conditional Pango/TTF support.
if test "$want_ttf" = yes; then
	# Check for SDL_ttf.
	SDL_LIBS="$SDL_LIBS -lSDL_ttf"
else
	# Check for SDL_Pango.
	SDL_LIBS="$SDL_LIBS -lSDL_Pango"
	TEXT_FLAGS="-DENABLE_PANGO"
fi

# Font path
if test "$want_ttf" = yes -a "x$FONT_PATH" != x ; then
        TEXT_FLAGS="$TEXT_FLAGS -DFONT_PATH=\"\\\"$FONT_PATH\\\"\""
elif test "$want_ttf" = yes; then
	AC_MSG_ERROR([Font path not configured, please use the --with-font-path configure argument])
fi

# Relative paths.
if test "$want_relative" = yes; then
	APPDIR="${prefix}/data"
	DATADIR="${prefix}/data"
	bindir="${prefix}"
	docdir="${prefix}/data"
	htmldir="${prefix}/data"
	mandir="${prefix}/data"
	PATH_CPPFLAGS="-DRELATIVE_PATHS"
	PATH_LDFLAGS="-Wl,-rpath -Wl,\\\$\$ORIGIN/lib"
else
	APPDIR="${datarootdir}/applications"
	DATADIR="${datadir}/${PACKAGE}"
	PATH_CPPFLAGS="-DDATADIR=\\\"\"$DATADIR\"\\\" "-DLOCALEDIR=\\\"\"$localedir\"\\\"
fi

# Export configuration.
AC_SUBST([DEBUG_FLAGS])
AC_SUBST([TEXT_FLAGS])
AC_SUBST([SOUND_FLAGS])
AC_SUBST([PATH_CPPFLAGS])
AC_SUBST([PATH_LDFLAGS])
AC_SUBST([APPDIR])
AC_SUBST([DATADIR])
AC_SUBST([MAYBE_SOUND])
AC_SUBST([SDL_LIBS])
AC_SUBST([SDL_CFLAGS])

AC_CONFIG_FILES([
Makefile
data/Makefile
src/Makefile
po/Makefile.in
])
AC_OUTPUT