Fix off-by-one memory error
[warzone2100:mainline.git] / configure.ac
1 AC_PREREQ([2.56])
2 AC_INIT([Warzone 2100],[master],[http://wz2100.net/],[warzone2100])
3
4 AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-xz])
5
6 # Set to the default or stupid automake will use the much slower but useless -e(xtreme!!!) option.
7 AC_SUBST([XZ_OPT], ["-6"])
8
9 AC_CONFIG_MACRO_DIR([m4])
10 AC_CONFIG_SRCDIR([lib/framework/frame.cpp])
11
12
13 # HACK
14 # Workaround stupid autoconf CFLAGS default
15 # (Bash considers set but empty variables different from null for the ${VAR:+alt} operator)
16 CFLAGS="${CFLAGS}"
17 CXXFLAGS="${CXXFLAGS}"
18
19
20 # Make cross compilation options available in --help
21 AC_CANONICAL_HOST
22
23 # Checks for programs.
24 AC_PROG_CC_STDC
25 AC_CHECK_PROG(CCOMPILER, ${CC}, ccompiler)
26 test -z "${CCOMPILER}" && AC_MSG_ERROR(No C compiler found!)
27 AC_PROG_RANLIB
28
29 AC_PROG_CXX
30 AC_CHECK_PROG(CXXCOMPILER, ${CXX}, cxxcompiler)
31 test -z "${CXXCOMPILER}" && AC_MSG_ERROR(No C++ compiler found!)
32
33 AX_WITH_PROG([PERL], [perl])
34 AX_PROG_PERL_VERSION([5.10], [], [ PERL="" ])
35 AC_SUBST([PERL])
36 AM_CONDITIONAL([PERL_AVAILABLE], test -n "$PERL")
37
38 AC_CHECK_PROG(ZIP, zip, zip)
39 test -z "${ZIP}" && AC_MSG_ERROR(Zip not found!)
40 AC_CHECK_PROG(UNZIP, unzip, unzip)
41 test -z "${UNZIP}" && AC_MSG_ERROR(Unzip not found!)
42 # --filesync was added in zip 3.0, older versions need -u
43 ZIP_UPDATE="-u"
44 zip -q --filesync filesynctest.zip $srcdir/ChangeLog 2> /dev/null && export ZIP_UPDATE="--filesync"
45 rm -f filesynctest.zip
46 AC_SUBST([ZIP_UPDATE], [${ZIP_UPDATE}])
47
48 AC_CHECK_PROG(A2X, a2x, a2x)
49 AC_CHECK_PROG(WKHTMLTOPDF, wkhtmltopdf, wkhtmltopdf)
50 AM_CONDITIONAL([A2X_AVAILABLE], test -n "$A2X")
51 AM_CONDITIONAL([WKHTMLTOPDF_AVAILABLE], test -n "$WKHTMLTOPDF")
52
53 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex)
54 AC_CHECK_PROG(HEVEA, hevea, hevea)
55 AC_CHECK_PROG(HACHA, hacha, hacha)
56 AM_CONDITIONAL(PDFLATEX, test -n "$PDFLATEX")
57 AM_CONDITIONAL(HEVEA, test -n "$HEVEA")
58 AM_CONDITIONAL(HACHA, test -n "$HACHA")
59
60 # Enable Compiler/LibC GNU extensions
61 AC_GNU_SOURCE
62
63 # __builtin_expect
64 AX_C___BUILTIN_EXPECT
65
66 # Check for the strlcpy and strlcat functions
67 AX_CHECK_STRLCPY
68 AX_CHECK_STRLCAT
69
70 # Use -fstack-protector if possible
71 AX_STACK_PROTECT_CC
72 AX_STACK_PROTECT_CXX
73
74 AC_CHECK_HEADERS(alloca.h sys/ucontext.h)
75
76 # Check for gettext
77 AM_GNU_GETTEXT([external])
78 AM_GNU_GETTEXT_VERSION([0.15])
79
80 # Check for pkg-config
81 PKG_PROG_PKG_CONFIG
82 AC_PROG_VERSION_CHECK([pkg-config], [0.9])
83
84 AC_MSG_CHECKING([for backend])
85 AC_ARG_WITH([backend],
86         AS_HELP_STRING([--with-backend=sdl/qt], [Backend rendering code to use [sdl]]),
87         [ backend=${withval} ], [ backend="sdl" ])
88 AM_CONDITIONAL([BACKEND_QT], test "$backend" = "qt")
89 AM_CONDITIONAL([BACKEND_SDL], test "$backend" = "sdl")
90
91 # Check for Qt
92 if test "$backend" = "qt"; then
93         AC_MSG_RESULT([Qt])
94         PKG_CHECK_MODULES(QT4, QtCore QtGui QtOpenGL QtNetwork QtScript,,[:])
95 else
96         AC_MSG_RESULT([SDL])
97         PKG_CHECK_MODULES(QT4, QtCore QtGui QtNetwork QtScript,,[:])
98 fi
99 if test "$pkg_failed" = "yes" ; then
100         AC_MSG_ERROR([Qt not found - required!])
101 fi
102 QT4_INCLUDES=$QT4_FRONTEND_CFLAGS
103 QT4_LDFLAGS=$QT4_FRONTEND_LIBS
104 QT4_LIB=$QT4_FRONTEND_LIBS
105 QT4_VERSION=`$PKG_CONFIG --modversion QtCore`
106 AC_SUBST(QT4_VERSION)
107 AC_PATH_PROGS(MOC4, [moc-qt4 moc])
108 AC_PATH_PROGS(UIC4, [uic-qt4 uic])
109 AC_PATH_PROGS(RCC4, [rcc-qt4 rcc])
110
111 # Check for compiler
112 case ${CC} in
113         icc)
114                 cc_icc=yes
115                 ;;
116 esac
117
118
119 # Check for operating system
120 case ${host_os} in
121         *mingw32*)
122                 host_os_mingw32=yes
123                 AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found]))
124                 WIN32_LIBS='-ldbghelp -lshfolder -lshlwapi -lpsapi -lshell32 -lwinmm -lws2_32 -liphlpapi'
125                 AC_SUBST([WIN32_LIBS], [${WIN32_LIBS}])
126                 LDFLAGS="-Wl,-subsystem,windows ${LDFLAGS}"
127                 ;;
128         *)
129                 # Some platforms don't need _XOPEN_SOURCE
130                 case ${host_os} in
131                         *bsd* | dragonfly* | bitrig*) ;;
132                         *)
133                                 AC_DEFINE([_XOPEN_SOURCE], 600, [Enable POSIX extensions if present])
134                                 ;;
135                 esac
136
137                 # Make sure that backtrace_symbols_fd (GNU raw back trace extension) has some symbols to work  with
138                 LDFLAGS="-rdynamic ${LDFLAGS}"
139                 ;;
140 esac
141 AM_CONDITIONAL([MINGW32], test "x$host_os_mingw32" = "xyes")
142
143
144 # Check for X11 (for qtgame and scrap)
145 if test "x$host_os_mingw32" != "xyes" ; then
146         X_LIBS=""
147         AC_PATH_X
148         if test x$no_x != "xyes"; then
149                 X_LIBS="-lX11 -lXrandr ${X_LIBS}"
150         fi
151         AC_SUBST(X_LIBS)
152 fi
153
154 # Set compilers to use when building for the build system in a cross compile build
155 # Fallback to the system compilers
156 AC_ARG_VAR([CXX_FOR_BUILD], [C++ compiler that produces binaries that will run
157             on the build system])
158 AS_IF([test -z "$CXX_FOR_BUILD"],[
159     AC_SUBST([CXX_FOR_BUILD], [${CXX}])
160 ])
161
162 AC_ARG_VAR([CC_FOR_BUILD], [C compiler that produces binaries that will run on
163             the build system])
164 AS_IF([test -z "$CC_FOR_BUILD"],[
165     AC_SUBST([CC_FOR_BUILD], [${CC}])
166 ])
167
168 AC_ARG_VAR([CFLAGS_FOR_BUILD], [Flags to use for the C
169             compiler that produces binaries for the build system])
170 AS_IF([test -z "$CFLAGS_FOR_BUILD"],[
171     AC_SUBST([CFLAGS_FOR_BUILD], [${CFLAGS}])
172 ])
173
174 AC_ARG_VAR([CXXFLAGS_FOR_BUILD], [Flags to use for the C++
175             compiler that produces binaries for the build system])
176 AS_IF([test -z "$CXXFLAGS_FOR_BUILD"],[
177     AC_SUBST([CXXFLAGS_FOR_BUILD], [${CXXFLAGS}])
178 ])
179
180 AC_ARG_VAR([CPPFLAGS_FOR_BUILD], [Preprocessor flags to use for the C and C++
181             compilers that produce binaries for the build system])
182 AS_IF([test -z "$CPPFLAGS_FOR_BUILD"],[
183     AC_SUBST([CPPFLAGS_FOR_BUILD], [${CPPFLAGS}])
184 ])
185
186
187 # pkg-config hooks:
188
189 AC_ARG_VAR([PKGCONFIG_PREFIX], [Prefix path to look in for pkg-config templates])
190 AS_IF([test -n "$PKGCONFIG_PREFIX"],[
191         PKG_CONFIG="${PKG_CONFIG} --define-variable=prefix=${PKGCONFIG_PREFIX}"
192 ])
193
194 AC_ARG_VAR([PKGCONFIG_DEFAULT_PREFIX], [Prefix path to look in for pkg-config templates])
195 AS_IF([test -n "$PKGCONFIG_DEFAULT_PREFIX"],[
196         PKG_CONFIG="${PKG_CONFIG} --define-variable=__PREFIX__=${PKGCONFIG_DEFAULT_PREFIX}"
197 ])
198
199 # Variable fixes for older autoconf versions:
200
201 AS_IF([test -z "$docdir"],[
202         AC_SUBST([docdir], [${datarootdir}/doc/${AC_PACKAGE_TARNAME}])
203 ])
204 AS_IF([test -z "$localedir"],[
205         AC_SUBST([localedir], [${datadir}/locale])
206 ])
207
208
209 # Installation directories
210
211 AC_ARG_WITH(icondir,
212         AS_HELP_STRING([--with-icondir=DIR],[icon files [DATADIR/icons]]),
213         [ with_icondir=${withval} ], [ with_icondir=${datadir}/icons ])
214 AC_SUBST([icondir], [${with_icondir}])
215
216 AC_ARG_WITH(applicationdir,
217         AS_HELP_STRING([--with-applicationdir=DIR],[application files [DATADIR/applications]]),
218         [ with_applicationdir=${withval} ], [ with_applicationdir=${datadir}/applications ])
219 AC_SUBST([applicationdir], [${with_applicationdir}])
220
221
222 # Commandline options - enable:
223
224 AC_ARG_ENABLE([installer],
225         AS_HELP_STRING([--enable-installer], [Build NSIS installer [no]]),
226         [ enable_installer=${enableval} ], [ enable_installer=no ])
227 AM_CONDITIONAL(INSTALLER, test "x$enable_installer" = "xyes")
228 AC_MSG_CHECKING([whether to build NSIS installer])
229 AC_MSG_RESULT([${enable_installer}])
230
231 AC_ARG_ENABLE([static],
232         AS_HELP_STRING([--enable-static], [Link statically [no]]),
233         [ enable_static=${enableval} ], [ enable_static=no ])
234 if test "x$enable_static" = "xyes" ; then
235         # Add libs where even pkg-config cannot help statically linking them,
236         # where one would otherwise have to provide them via commandline
237         WIN32_LIBS="${WIN32_LIBS} -lz -lintl -liconv"
238         # Tell pkg-config to link against static libraries, incl. all dependencies
239         PKG_CONFIG="${PKG_CONFIG} --static"
240 fi
241
242 # -O0 turns off all optimizations; this is necessary for accurate debugging
243 # -Wno-unused-label is necessary because flex produces unused labels that we cannot fix
244 # Add later for stricter checking: -Wextra -Wmissing-declarations -Wstrict-prototypes
245 AC_ARG_ENABLE([debug],
246         AS_HELP_STRING([--enable-debug[=yes/relaxed/profile/debugprofile/optimised/no]],[Compile debug version [[yes]]]),
247         [ enable_debug=${enableval} ], [ enable_debug=yes ])
248 AC_MSG_CHECKING([whether to compile in debug mode])
249 AC_MSG_RESULT([${enable_debug}])
250
251 # gcc 4.5 added some warnings to -Wall that weren't even valid in previous
252 # versions. The -Werror is necessary since otherwise gcc prints a warning that
253 # the option is only valid for c++/objc++, but the test succeeds. The order is
254 # also important, it doesn't work if -Werror comes last.
255 AX_C_CHECK_FLAG([-Werror -Wno-switch], , , CFLAGS_IGNORE_WARNINGS="${CFLAGS_IGNORE_WARNINGS} -Wno-switch")
256 AX_C_CHECK_FLAG([-Werror -Wno-enum-compare], , , CFLAGS_IGNORE_WARNINGS="${CFLAGS_IGNORE_WARNINGS} -Wno-enum-compare")
257 # Only needed for CXX, actually.
258 WZ_CPPFLAGS="${WZ_CPPFLAGS} -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
259
260 # zlib
261 LDFLAGS="-lz ${LDFLAGS}"
262
263 if test "x$enable_warnings" = "xyes" ; then
264         # Only disable -Werror for the warning.
265         WZ_Wno_="-Wno-error="
266 else
267         # Disable warning completely.
268         WZ_Wno_="-Wno-"
269 fi
270
271 WZ_WARNINGS_GCC="-Wall -Wextra ${WZ_Wno_}unused-parameter ${WZ_Wno_}sign-compare -Wcast-align -Wwrite-strings -Wpointer-arith ${WZ_Wno_}format-security"
272 WZ_WARNINGS_GCC_C="${WZ_WARNINGS_GCC} -Wstrict-prototypes -Wdeclaration-after-statement ${CFLAGS_IGNORE_WARNINGS}"
273 WZ_WARNINGS_GCC_CXX="${WZ_Wno_}enum-compare ${WZ_WARNINGS_GCC}"
274 if test "x$enable_debug" = "xyes" ; then
275         if test "x$cc_icc" = "xyes" ; then
276                 WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -Wcheck -Werror"
277                 WZ_CXXFLAGS="${WZ_CXXFLAGS} -O0 -g -Wcheck -Werror"
278                 WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
279         else
280                 WZ_CFLAGS="${WZ_CFLAGS} -O0 -g -Werror ${WZ_WARNINGS_GCC_C}"
281                 WZ_CXXFLAGS="${WZ_CXXFLAGS} -O0 -g -Werror ${WZ_WARNINGS_GCC_CXX}"
282                 WZ_C99FLAGS="${WZ_C99FLAGS} -Wno-declaration-after-statement"
283                 WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
284         fi
285 elif test "x$enable_debug" = "xoptimised" ; then
286         WZ_CFLAGS="${WZ_CFLAGS} -O2 -g -Werror ${WZ_WARNINGS_GCC_C}"
287         WZ_CXXFLAGS="${WZ_CXXFLAGS} -O2 -g -Werror ${WZ_WARNINGS_GCC_CXX}"
288         WZ_C99FLAGS="${WZ_C99FLAGS} -Wno-declaration-after-statement"
289         WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
290 elif test "x$enable_debug" = "xrelaxed" ; then
291         WZ_CFLAGS="${WZ_CFLAGS} -g -O0 ${WZ_WARNINGS_GCC_C}"
292         WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -O0 ${WZ_WARNINGS_GCC_CXX}"
293         WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
294 elif test "x$enable_debug" = "xdebugprofile" ; then
295         WZ_CFLAGS="${WZ_CFLAGS} -g -O0 -pg ${WZ_WARNINGS_GCC_C}"
296         WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -O0 -pg ${WZ_WARNINGS_GCC_CXX}"
297         WZ_CPPFLAGS="${WZ_CPPFLAGS} -DDEBUG"
298         LDFLAGS="-pg ${LDFLAGS}"
299 elif test "x$enable_debug" = "xprofile" ; then
300         WZ_CFLAGS="${WZ_CFLAGS} -g -Os -pg ${WZ_WARNINGS_GCC_C}"
301         WZ_CXXFLAGS="${WZ_CXXFLAGS} -g -Os -pg ${WZ_WARNINGS_GCC_CXX}"
302         WZ_CPPFLAGS="${WZ_CPPFLAGS} -DNDEBUG"
303         LDFLAGS="-pg ${LDFLAGS}"
304 else
305         WZ_CFLAGS="${WZ_CFLAGS} -g ${WZ_WARNINGS_GCC_C}"
306         WZ_CXXFLAGS="${WZ_CXXFLAGS} -g ${WZ_WARNINGS_GCC_CXX}"
307         WZ_CPPFLAGS="${WZ_CPPFLAGS} -DNDEBUG"
308 fi
309
310
311 # Commandline options - with:
312
313 AC_ARG_WITH([distributor],
314         AS_HELP_STRING([--with-distributor], [Name of distributor compiling this package]),
315         [ with_distributor=${withval} ], [ with_distributor="UNKNOWN" ])
316 AC_DEFINE_UNQUOTED([PACKAGE_DISTRIBUTOR], ["${with_distributor}"], [Name of distributor compiling this package])
317
318 AC_ARG_WITH([makensis],
319         AS_HELP_STRING([--with-makensis], [Path to makensis]))
320
321 AC_ARG_WITH([installer_compression],
322         AS_HELP_STRING([--with-installer-compression], [Compression method to use when building NSIS [lzma]]),
323         [ with_installer_compression=${withval} ], [ with_installer_compression="lzma" ])
324 AC_SUBST([INSTALLER_COMPRESSION], [${with_installer_compression}])
325
326 AC_ARG_WITH([installer_extdir],
327         AS_HELP_STRING([--with-installer-extdir], [Path to external data for NSIS script]))
328
329 AC_ARG_WITH([installer_version],
330         AS_HELP_STRING([--with-installer-version], [4-tuble version of the installer. i.e. 1.2.3.4]))
331
332 if test "x$enable_installer" = "xyes" ; then
333         if test "x$with_makensis" = "x" ; then
334                 AC_CHECK_TOOL([MAKENSIS], [makensis], [no])
335                 if test "x$MAKENSIS" = "xno" ; then
336                         AC_MSG_ERROR([makensis not found])
337                 fi
338         else
339                 AC_MSG_CHECKING([for makensis])
340                 AC_MSG_RESULT([${with_makensis}])
341                 AC_SUBST([MAKENSIS], [${with_makensis}])
342         fi
343         # Doing that check here, because without enable-installer it is not an error
344         if test "x$with_installer_version" = "x" ; then
345                 AC_MSG_ERROR([installer version invalid])
346         else
347                 AC_MSG_CHECKING([for installer version])
348                 AC_MSG_RESULT([${with_installer_version}])
349                 AC_SUBST([INSTALLER_VERSION], [${with_installer_version}])
350         fi
351         # Doing that check here, because without enable-installer it is not an error
352         if test "x$with_installer_extdir" = "x" ; then
353                 AC_MSG_ERROR([installer external dir not found])
354         else
355                 AC_MSG_CHECKING([for installer extdir])
356                 AC_MSG_RESULT([${with_installer_extdir}])
357                 AC_SUBST([INSTALLER_EXTDIR], [${with_installer_extdir}])
358         fi
359 fi
360
361
362 # Checks for modules:
363
364 if test "$backend" = "sdl"; then
365         PKG_CHECK_MODULES([SDL], [sdl >= 1.2])
366 fi
367 PKG_CHECK_MODULES([PNG], [libpng >= 1.2])
368 PKG_CHECK_MODULES([THEORA], [theora >= 1.0])
369 PKG_CHECK_MODULES([OPENAL], [openal >= 0.0.8])
370 PKG_CHECK_MODULES([VORBIS], [vorbis >= 1.1])
371 PKG_CHECK_MODULES([VORBISFILE], [vorbisfile >= 1.1])
372
373 PKG_CHECK_MODULES([GLEW], [glew >= 1.5.2])
374
375 # Checks for libraries:
376
377 # check for nearbyint()
378 AC_CHECK_LIB(m, nearbyint, [MATH_LIB=""], AC_MSG_ERROR([nearbyint not found.]))
379
380 # When (cross-)compiling for Windows (MinGW) we need to link in iberty for the Dr. MinGW derived exception handler.
381 if test "x$host_os_mingw32" = "xyes" ; then
382     AC_CHECK_LIB(iberty, main, AC_SUBST([IBERTY_LIBS], [-liberty]), AC_MSG_ERROR([libiberty not found.]))
383
384     WIN32_LIBS="${WIN32_LIBS} ${IBERTY_LIBS}"
385 fi
386
387 # Look for PhysicsFS
388 AC_CHECK_HEADER(physfs.h, , AC_MSG_ERROR([PhysicsFS header not found.]))
389 AC_CHECK_LIB(physfs, PHYSFS_mount, AC_SUBST([PHYSFS_LIBS], [-lphysfs]), AC_MSG_ERROR([PhysicsFS 2 not found.]), [${WIN32_LIBS}])
390
391 if test "x$host_os_mingw32" != "xyes" ; then
392         AC_CHECK_HEADER(X11/extensions/Xrandr.h, , AC_MSG_ERROR([Xrandr header not found.]))
393 fi
394
395
396 # Look for OpenGL
397 AC_CHECK_LIB(GL, main,
398         OPENGL_LIBS="-lGL",
399         AC_CHECK_LIB(opengl32, main,
400                 OPENGL_LIBS="-lopengl32",
401                 AC_MSG_ERROR([OpenGL library not found.])))
402 AC_CHECK_LIB(GLU, main,
403         OPENGL_LIBS="${OPENGL_LIBS} -lGLU",
404         AC_CHECK_LIB(glu32, main,
405                 OPENGL_LIBS="${OPENGL_LIBS} -lglu32",
406                 AC_MSG_ERROR([GLU library not found.]),
407                 [${OPENGL_LIBS} -lm]), [${OPENGL_LIBS} -lm])
408 AC_SUBST([OPENGL_LIBS], [${OPENGL_LIBS}])
409
410 # OpenGLC stuff
411 ACX_PTHREAD
412 CC="$PTHREAD_CC"
413 AX_TLS
414
415 PKG_CHECK_MODULES([FRIBIDI], [fribidi])
416 PKG_CHECK_MODULES([FREETYPE], [freetype2])
417 AC_CHECK_LIB(freetype, FTC_Manager_New,
418              AC_DEFINE([HAVE_FT_CACHE], [1],
419                        [Define if FreeType supports the caching routines]))
420 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig])
421
422 OPENGLC_LIBS="${FRIBIDI_LIBS} ${FREETYPE_LIBS} ${FONTCONFIG_LIBS} ${PTHREAD_LIBS} ${OPENGL_LIBS} ${GLEW_LIBS}"
423 AC_SUBST([OPENGLC_LIBS], [${OPENGLC_LIBS}])
424
425 # When (cross-)compiling for Windows (MinGW) we need to link in BFD for the Dr.
426 # MinGW derived exception handler.
427 if test "x$host_os_mingw32" = "xyes" ; then
428     AC_CHECK_HEADER(bfd.h, , AC_MSG_ERROR([BFD header not found.]))
429     AC_CHECK_LIB(bfd, bfd_openr, AC_SUBST([BFD_LIBS], [-lbfd]), AC_MSG_ERROR([BFD not found.]), [${WIN32_LIBS}])
430
431     WIN32_LIBS="${BFD_LIBS} ${WIN32_LIBS} -lstdc++"
432 fi
433
434 WZ_CPPFLAGS="${WZ_CPPFLAGS} -DWZ_DATADIR=\"\\\"\${datadir}/\${PACKAGE}\\\"\""
435 WZ_CPPFLAGS="${WZ_CPPFLAGS} -DLOCALEDIR=\"\\\"\${localedir}\\\"\""
436 WZ_CPPFLAGS="${WZ_CPPFLAGS} -I\$(top_srcdir)"
437
438 # 3rdparty libs
439 WZ_CPPFLAGS="${WZ_CPPFLAGS} -I\$(top_srcdir)/3rdparty -I\$(top_srcdir)/3rdparty/quesoglc"
440
441
442 AC_SUBST([WZ_CPPFLAGS], [${WZ_CPPFLAGS}])
443 AC_SUBST([WZ_CFLAGS], [${WZ_CFLAGS}])
444 AC_SUBST([WZ_CXXFLAGS], [${WZ_CXXFLAGS}])
445 AC_SUBST([WZ_C99FLAGS], [${WZ_C99FLAGS}])
446
447
448 AC_CONFIG_HEADER([config.h])
449 AC_CONFIG_FILES([Makefile
450                 po/Makefile.in
451                 doc/Makefile
452                 icons/Makefile
453                 data/Makefile
454                 data/music/Makefile
455                 pkg/nsis/Makefile
456                 win32/Makefile
457                 tests/Makefile
458                 3rdparty/miniupnpc/Makefile
459                 3rdparty/quesoglc/Makefile
460                 lib/framework/Makefile
461                 lib/exceptionhandler/Makefile
462                 lib/gamelib/Makefile
463                 lib/ivis_opengl/Makefile
464                 lib/netplay/Makefile
465                 lib/qtgame/Makefile
466                 lib/sdl/Makefile
467                 lib/script/Makefile
468                 lib/sequence/Makefile
469                 lib/sound/Makefile
470                 lib/widget/Makefile
471                 tools/map/Makefile
472                 src/Makefile])
473 AC_OUTPUT
474
475 AS_IF([test "x$enable_debug" = "xyes"],[
476         AC_MSG_NOTICE()
477         AC_MSG_NOTICE([*** Running in debug mode! ***])
478 ])
479
480 AS_IF([test "x$with_distributor" = "xUNKNOWN"],[
481         AC_MSG_NOTICE()
482         AC_MSG_WARN([Distributor unknown!])
483         AC_MSG_NOTICE([Use --with-distributor when compiling package for distribution])
484 ])
485
486 AS_IF([test -z "$PERL"],[
487         AC_MSG_NOTICE()
488         AC_MSG_WARN([Perl >= 5.10 isn't installed, autogeneration of some sources will not work.])
489 ])
490
491 AS_IF([test -z "$A2X" -o -z "$WKHTMLTOPDF"],[
492         AC_MSG_NOTICE()
493         AC_MSG_WARN([a2x (asciidoc) or wkhtmltopdf not found, can't convert documentation. This doesn't affect building the game,
494                 but means that things like "make dist" and building a Windows installer will fail.])
495 ])
496
497 AC_MSG_NOTICE()
498 AC_MSG_NOTICE(Backend used: ${backend})