1 dnl Process this file with autoconf to produce a configure script.
2 dnl This is useful to force using autoreconf 2.5.x
4 AC_INIT([lordsawar], [0.1.7-pre2], [http://sv.nongnu.org/bugs/?group=lordsawar], [lordsawar])
5 AC_CONFIG_SRCDIR([config.h.in])
6 AM_CONFIG_HEADER(config.h)
7 AC_CONFIG_MACRO_DIR([m4])
14 IT_PROG_INTLTOOL([0.35.5])
16 GETTEXT_PACKAGE=lordsawar
17 AC_SUBST(GETTEXT_PACKAGE)
18 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],
19 [The domain to use with gettext])
22 PROGRAMNAME_LOCALEDIR=[${datadir}/locale]
23 AC_SUBST(PROGRAMNAME_LOCALEDIR)
25 dnl Checks for programs.
29 dnl The minimum SDL version required
32 ac_save_ldflags=$LDFLAGS
34 AM_PATH_SDL($SDL_VERSION,
36 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
39 LDFLAGS=$ac_save_ldflags
42 dnl And check for SDL_mixer. In detail, we need .ogg support
43 dnl we need some extended cflags or get problems
44 ac_save_cflags=$CFLAGS
45 ac_save_ldflags=$LDFLAGS
49 AC_ARG_ENABLE(sound, [ --enable-sound Enable or disable sound usage (default on)],
50 use_sound="$enableval", use_sound="yes")
53 if test $use_sound = yes; then
55 CFLAGS="$CFLAGS $SDL_CFLAGS"
56 LDFLAGS="$LDFLAGS -lSDL_mixer"
57 LIBS="-lSDL_mixer $LIBS"
59 dnl check if ogg vorbis support is enabled
60 dnl only under linux the SDL_mixer under windows supports it
61 if test $CC = "gcc" || test $CXX = "g++"; then
64 #include <SDL/SDL_mixer.h>
69 if (!Mix_LoadMUS("${srcdir}" "/dat/music/victory.ogg"))
73 ],, AC_MSG_ERROR([*** SDL_mixer is not installed or has not been compiled
74 *** with ogg vorbis support]),[])
76 AC_MSG_RESULT([Test SDL_Mixer Run OK.])
78 else AC_MSG_WARN([Skipping SDL_Mixer Run. We are cross-compiling for windows!])
81 AC_DEFINE([FL_SOUND], 1, [enables sound])
83 SDLSOUND_LIBS="-lSDL_mixer"
85 CFLAGS=$ac_save_CFLAGS
86 LDFLAGS="$ac_save_LDFLAGS"
89 AC_SUBST(SDLSOUND_LIBS)
94 AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
97 CPPFLAGS="$CPPFLAGS -I$withval/include"
98 LDFLAGS="$LDFLAGS -L$withval/lib"
103 if test $expat = 0 ; then
104 AC_CHECK_HEADERS(expat.h,[],AC_MSG_ERROR([*** Expat not found!]))
105 AC_CHECK_LIB(expat,XML_ParserCreate,[],[AC_MSG_ERROR([*** Expat not found!])])
110 AC_ARG_WITH(libtar, [ --with-libtar=<dir> Use libtar from here],
113 CPPFLAGS="$CPPFLAGS -I$withval/include"
114 LDFLAGS="$LDFLAGS -L$withval/lib"
118 if test $libtar = 0 ; then
119 AC_CHECK_HEADERS(libtar.h,[],AC_MSG_ERROR([*** Libtar not found!]))
120 AC_CHECK_LIB(tar,tar_open,[],[AC_MSG_ERROR([*** Libtar not found!])])
123 dnl this is needed in cross-compile with mingw32
124 AC_ARG_ENABLE(winlibs,
125 [ --enable-winlibs enable windows cross-compiling libs],
126 LIBS="-lmingw32 -lws2_32 -lintl -lz -lpthreadGC2 -lpthreadGCE2 $LIBS"
131 AM_CONDITIONAL(FL_RESRC, test x$flrc = xtrue)
133 dnl Now check gettext.h
135 #AC_ARG_ENABLE(winnls,
136 # [ --enable-winnls enable windows cross-compiling nls],
142 #if test $winnls = no ; then
143 AM_GNU_GETTEXT_VERSION([0.17])
144 AM_GNU_GETTEXT([external])
149 PKG_CHECK_MODULES(GLIBMM, glibmm-2.4)
151 AC_SUBST(GLIBMM_CFLAGS)
152 AC_SUBST(GLIBMM_LIBS)
156 PKG_CHECK_MODULES(GTKMM, gtkmm-2.4)
158 AC_SUBST(GTKMM_CFLAGS)
161 dnl Check for libgnet
163 PKG_CHECK_MODULES(LIBGNET, gnet-2.0)
165 AC_SUBST(LIBGNET_CFLAGS)
166 AC_SUBST(LIBGNET_LIBS)
169 dnl Finally, check for libsigc++
170 PKG_CHECK_MODULES(LIBSIGC, sigc++-2.0)
172 AC_SUBST(LIBSIGC_CFLAGS)
173 AC_SUBST(LIBSIGC_LIBS)
177 dnl----------------------------------------------------------------------
178 dnl Below here are options to modify default behaviour
180 dnl Do we want to compile the editor?
181 AC_ARG_ENABLE(editor,
182 [ --enable-editor compile editor (default=yes)],
183 use_editor="$enableval", use_editor="yes")
184 AM_CONDITIONAL([WANT_EDITOR], [test $use_editor = "yes"])
186 dnl Do we want to compile the play by mail server?
188 [ --enable-pbm compile play-by-mail (default=yes)],
189 use_pbm="$enableval", use_pbm="yes")
190 AM_CONDITIONAL([WANT_PBM], [test $use_pbm = "yes"])
192 dnl ...the standard screen resolution...
193 AC_ARG_WITH(resolution,
194 [ --with-resolution=RES standard resolution for lordsawar [default=800x600]],
195 SCREEN_RESOLUTION="$withval", SCREEN_RESOLUTION="800x600")
196 AC_SUBST(SCREEN_RESOLUTION)
198 dnl ...do we want to zip (and by the way obfuscate) the save files...
199 AC_ARG_ENABLE(zipfiles,
200 [ --enable-zipping zip save files (experimental) [default=no]],
201 zipfiles="$enableval", zipfiles="no")
204 if test x$zipfiles = xyes; then
210 dnl ..do we want to disable optimizations? (useful only for some debugging cases)...
211 AC_ARG_ENABLE(optimizations,
212 [ --enable-optimizations enable compiler optimizations (disable for debugging) [default=yes]],
213 use_opts="$enableval", use_opts="yes")
215 if test x$use_opts = xno; then
216 AC_MSG_WARN([Optimizations have been disabled])
221 AC_DEFUN([AC_CHOOSE_BOOST],[
222 am_boost_dir_default=ifelse([$1], , /usr/include, $1)
224 AC_ARG_WITH(boost_includedir,
225 AS_HELP_STRING([--with-boost-includedir=DIR],
226 [Use Boost library installed at specified path (default /usr/include)]),
227 [am_boost_dir=$withval],
228 [am_boost_dir=$am_boost_dir_default])
230 AC_MSG_CHECKING([for boost directory])
231 if test -d $am_boost_dir/boost; then
232 AC_MSG_RESULT([$am_boost_dir/boost])
233 BOOST_CPPFLAGS="-I$am_boost_dir"
234 old_CPPFLAGS=$CPPFLAGS
235 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
237 AC_CHECK_HEADERS([boost/version.hpp],
238 [ifelse([$2], , :, [$2])],
239 [ifelse([$3], , :, [$3])])
241 CPPFLAGS=$old_CPPFLAGS
242 AC_SUBST(BOOST_CPPFLAGS)
244 AC_MSG_RESULT([not found])
245 AC_MSG_ERROR([*** Can't find directory $am_boost_dir/boost])
246 ifelse([$3], , :, [$3])
250 AC_CHOOSE_BOOST(,,[AC_MSG_ERROR([*** Boost library not found! Install it.])])
253 dnl ...and finally a workaround to get the absolute data path
254 if test x$prefix = xNONE; then
260 LORDSAWAR_DATADIR="$datadir/lordsawar"
261 LORDSAWAR_DATADIR=${LORDSAWAR_DATADIR/'${prefix}'/$prefix}
262 AC_SUBST(LORDSAWAR_DATADIR)
267 dat/army/default/Makefile
268 dat/army/bigdefault/Makefile
269 dat/tilesets/Makefile
270 dat/tilesets/default/Makefile
271 dat/tilesets/bigdefault/Makefile
272 dat/tilesets/stark/Makefile
273 dat/tilesets/bigstark/Makefile
274 dat/tilesets/wesnoth/Makefile
275 dat/tilesets/bigwesnoth/Makefile
277 dat/shield/default/Makefile
278 dat/shield/plain/Makefile
279 dat/shield/dol/Makefile
280 dat/citysets/Makefile
281 dat/citysets/default/Makefile
282 dat/citysets/bigdefault/Makefile
283 dat/citysets/dol/Makefile
284 dat/citysets/bigdol/Makefile
286 dat/various/items/Makefile
287 dat/various/editor/Makefile
291 dat/glade/editor/Makefile
297 help/figures/Makefile
303 echo "LordsAWar is now configured. Type 'make' to compile it."
305 echo "Configuration:"
306 echo " Installation location : $prefix"
307 echo " Editor compilation : $use_editor"
308 echo " Play-by-mail : $use_pbm"
309 echo " Sound support : $use_sound"
311 echo "Extra Options:"
312 echo " Compiler Optimizations: $use_opts"