~ubuntu-branches/ubuntu/intrepid/heroes/intrepid

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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
dnl Copyright 2000, 2001  Alexandre Duret-Lutz <duret_g@epita.fr>
dnl
dnl This file is part of Heroes.
dnl
dnl Heroes is free software; you can redistribute it and/or modify it under
dnl the terms of the GNU General Public License version 2 as published by
dnl the Free Software Foundation.
dnl
dnl Heroes is distributed in the hope that it will be useful, but WITHOUT
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dnl for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with this program; if not, write to the Free Software Foundation, Inc.,
dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl

AC_PREREQ(2.50)

AC_INIT([heroes], [0.21], [heroes-bugs@lists.sourceforge.net])
AC_CONFIG_AUX_DIR(tools)
AC_CONFIG_SRCDIR([src/heroes.c])
AM_INIT_AUTOMAKE([heroes], [0.21])

AC_COPYRIGHT([Copyright 2000, 2001, 2002  Alexandre Duret-Lutz])

heroes_CHECK_OBSOLETE_OPTIONS

AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([HOST],["$host"],[The canonical host])

# If the user didn't supplied a CFLAGS value,
# set an empty one to prevent autoconf to stick -O2 -g here.
test -z "$CFLAGS" && CFLAGS=""

# ===================
# Check for programs.
# ===================

AC_PROG_CC
AC_ISC_POSIX
AC_PROG_CC_STDC
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_AWK
AC_PROG_RANLIB
AC_PROG_LN_S

AM_MISSING_PROG([HELP2MAN], [help2man])
AM_MISSING_PROG([ZIP], [zip])
AM_MISSING_PROG([UNZIP], [unzip])
AM_MISSING_PROG([AUTOGEN], [autogen])

AC_PATH_PROG([GPERF], [gperf])
AM_CONDITIONAL(HAVE_GPERF, [test \! -z "$GPERF"])

AC_CACHE_SAVE

# Set _GNU_SOURCE before any other tests.
AC__GNU_SOURCE

# =====================
# Checks for libraries.
# =====================

dnl pass a third argument to AC_CHECK_LIB to
dnl prevent HAVE_LIBM from being defined (we don't need it).
AC_CHECK_LIB([m], [sin], [LIBS="-lm $LIBS"])
heroes_MEDIALIB_SELECTION

# ================================
# Check for any malloc() debugger.
# ================================

adl_WITH_MPATROL
adl_WITH_MTRACE
adl_WITH_DMALLOC
adl_WITH_EFENCE
adl_ENABLE_MEM_DEBUG

# ==============================================
# Now that we have all the libraries, check that
# compiled programs are still runnable.
# ==============================================

adl_RUN_CHECK

# ========================
# Checks for header files.
# ========================

AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS(
 [direct.h] dnl
 [io.h] dnl
 [memory.h] dnl
 [stdbool.h] dnl
 [stdint.h] dnl
 [string.h] dnl
 [strings.h] dnl
 [stdlib.h] dnl
 [sys/time.h] dnl
 [unistd.h] dnl
 [windows.h] dnl
)
AC_HEADER_TIME
AC_HEADER_STAT

# ==============================================================
# Checks for typedefs, structures, and compiler characteristics.
# ==============================================================

AM_C_PROTOTYPES
AC_C_CONST
AC_TYPE_UID_T     dnl This checks for gid_t too.
AC_CHECK_TYPES([ssize_t])

# =============================
# Checks for library functions.
# =============================

AC_CHECK_DECLS([malloc, realloc, calloc, free, memrchr, stpcpy, strcasecmp,
	        strnlen])
AC_CHECK_FUNCS([gettimeofday memcpy sleep getegid setgid setegid setregid])

adl_FUNC_READDIR

AC_FUNC_VPRINTF
AC_FUNC_MKDIR

AC_REPLACE_FUNCS([memrchr stpcpy strndup strcasecmp])
jm_FUNC_MALLOC

# We used to clear LIBS to work around a bug (?) on
# alphaev56-dec-osf4.0d where conftest (run by jm_FUNC_REALLOC) never
# exits when linked with `-lgii' or `-lggi'.  But today `-lggi' and
# `-lgii' are not put in LIBS any longer.
jm_FUNC_REALLOC

# for error.c
AC_CHECK_FUNCS([strerror])
AC_CHECK_DECLS([strerror])
AC_FUNC_STRERROR_R

jm_FUNC_FTRUNCATE
adl_FUNC_GETOPT_LONG
adl_FILELOCK

# ====================
# Check for endianess.
# ====================

AC_C_BIGENDIAN_CROSS

# ===============
# Filename style.
# ===============

jm_AC_DOS

# =====================
# Internationalization.
# =====================

ALL_LINGUAS="de fr it nl pt_BR sv"
AM_GNU_GETTEXT(,[need-ngettext])

# ===================================
# Setup the correct compiler options.
# ===================================

adl_ENABLE_DEVEL
adl_NDEBUG
adl_ENABLE_GPROF
adl_ENABLE_DEBUG
ad_GCC_OPTIM
ad_GCC_WARNINGS

# ==========================
# Directories configuration.
# ==========================

heroes_COMPUTE_PATHS

# ==============
# Misc. options.
# ==============

adl_ENABLE_HTML_DOC
heroes_DEBUG

# ============
# Output files
# ============

# Put config.h in the base directory because libintl expects it here,
# but keep src/config.h.in in the src/ directory to keep the base directory
# as clean as possible.
dnl Don't quote the following argument, it is parsed by automake.
AM_CONFIG_HEADER(config.h:src/config.h.in)

AC_CONFIG_FILES([
 Makefile
 doc/Makefile
 intl/Makefile
 lib/Makefile
 man/Makefile
 po/Makefile.in
 src/Makefile
 tests/Makefile
])
AC_OUTPUT

eval bindir="$bindir"
eval bindir="$bindir"
eval datadir="$datadir"
eval mandir="$mandir"
eval infodir="$infodir"
eval htmldir="$htmldir"

eval vkm_libalt_name='$adl_libalt_'$selection_vkm'_name'
eval j_libalt_name='$adl_libalt_'$selection_j'_name'
eval s_libalt_name='$adl_libalt_'$selection_s'_name'
eval m_libalt_name='$adl_libalt_'$selection_m'_name'

echo "
Heroes configuration
--------------------
Heroes version           : $VERSION
host                     : $host

binary install path      : $bindir
data install path        : ${datadir}/heroes
manual page install path : $mandir
info manual install path : $infodir
html doc install path    : $htmldir

compiler                 : $CC
general options
  CFLAGS                 : $CFLAGS $MORE_WARNINGS_CFLAGS
  LIBS                   : $LDFLAGS $LIBS

display, keyboard, mouse : ${vkm_libalt_name}
joystick                 : ${j_libalt_name}
sound                    : ${s_libalt_name}
main                     : ${m_libalt_name}"