1
## Process this file with autoconf to produce a configure script.
2
AC_INIT([Ember],[0.7.2],[erik@ogenvik.org])
4
AC_CONFIG_MACRO_DIR([m4])
8
# Detect the canonical host and target build environment.
11
# We have to use "foreign" since we supply README.md instead of the GNU canonical README file.
12
AM_INIT_AUTOMAKE([tar-ustar nostdinc dist-bzip2 color-tests parallel-tests foreign])
13
AM_SILENT_RULES([yes])
16
AC_CONFIG_HEADERS([src/config.h])
19
AC_COPYRIGHT([This script is under the GPL and is owned by the people in AUTHORS])
21
#will disable verbose linking checks, which fail even if there is no problem.
22
lt_cv_deplibs_check_method=pass_all
32
AC_PATH_PROG([XMLLINT], [xmllint], [true])
34
# Check for C libraries:
37
AX_CXX_COMPILE_STDCXX_11
42
# Checks for header files.
44
AC_CHECK_HEADER(stdlib.h)
45
AC_CHECK_HEADER(math.h)
46
AC_CHECK_HEADER([signal.h])
48
# Checks for typedefs, structures, and compiler characteristics.
53
# check sighandler_t in C++
55
AC_CHECK_TYPES([sighandler_t],[],[],[
61
# Checks for library functions.
65
AC_CHECK_FUNCS([memset select])
71
AC_ARG_ENABLE(static_build,
72
[AS_HELP_STRING([--enable-static-build],[enable static link of some libs (default=no)])],
74
if test "$enableval" = "yes"; then
76
STATIC_LIBSTDCPP=`$CXX -print-file-name=libstdc++.a`
77
STATIC_LIBGCC=`$CXX -print-file-name=libgcc.a`
85
AM_CONDITIONAL([BUILD_STATIC], [test x"$link_static" = xtrue])
89
**************************************
90
* Checking for SDL Libraries
91
**************************************
97
AC_MSG_ERROR(Couldn't find SDL or insufficent version found. Please goto http://www.libsdl.org/ and get at least version $SDL_VERSION)
100
#dnl don't add SDL flags yet, SDL_main confuses later checks
102
#We check for OpenGL only because we want to check whether indirect rendering is used or not. If the code is altered to not having to check with OpenGL direct (for example going through Ogre) this check can be removed.
103
WF_CHECK_GL_SINGLE_LIB
108
**************************************
109
* Checking for C Libraries
110
**************************************
117
cygwin* | mingw* | cegcc*)
118
LIBS="$LIBS -lshlwapi"
119
AC_CHECK_TOOL(WINDRES, windres, "windres")
120
AC_MSG_RESULT([Building for windows.])
124
AC_MSG_RESULT([Building for Mac OS X.])
129
AM_CONDITIONAL([WIN32], [test x$WIN32 = xtrue])
130
AM_CONDITIONAL([OSX], [test x$OSX = xtrue])
136
LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS $BOOST_DATE_TIME_LDFLAGS"
137
LIBS="$LIBS $BOOST_THREAD_LIBS $BOOST_DATE_TIME_LIBS"
138
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
140
AC_ARG_ENABLE(webember,
141
[AS_HELP_STRING([--enable-webember], [enable building of webember (default=no)])],
143
if test "$enableval" = "yes"; then
144
webember_enabled="true"
145
CXXFLAGS="$CXXFLAGS -DBUILD_WEBEMBER"
147
webember_enabled="false"
150
webember_enabled="false"
154
AM_CONDITIONAL([BUILD_WEBEMBER], [test x"$webember_enabled" = xtrue])
156
if test "$webember_enabled" = "true" -a "$WIN32" = "false" -a "$OSX" = "false" ; then
157
# needed for some autotools versions. This is needed on POSIX ELF shared libraries only.
158
CXXFLAGS="$CXXFLAGS -fPIC"
160
AC_CHECK_HEADER([boost/interprocess/ipc/message_queue.hpp], [],
161
[AC_MSG_ERROR(You need the Boost interprocess library.)])
167
# make sure binreloc funtionality is used
170
# Try to find system-wide installation of tinyxml
171
# If found, add define to config.h, set LIBS and add automake conditional
172
AC_CHECK_LIB(tinyxml, main,
174
AC_DEFINE(HAVE_LIBTINYXML, 1, [Define to 1 if you have the `tinyxml' library (-ltinyxml).])
175
LIBS="-ltinyxml $LIBS"
182
AM_CONDITIONAL(HAVE_LIBTINYXML, [test x$have_tinyxml = xtrue])
184
# Check for C++ libraries:
189
**************************************
190
* Checking for C++ Libraries
191
**************************************
198
PKG_CHECK_MODULES(OPENAL, openal >= $OPENAL_VERSION,
200
CXXFLAGS="$CXXFLAGS $OPENAL_CFLAGS"
201
LIBS="$LIBS $OPENAL_LIBS"
204
AC_MSG_ERROR([Couldn't find OpenAL or tests failed. Error: $OPENAL_PKG_ERRORS. Please go to http://www.openal.org to get the latest, or check config.log to see why the tests failed, and fix it.])
209
#PKG_CHECK_MODULES(OGG, ogg >= $OGG_VERSION,
211
# CXXFLAGS="$CXXFLAGS $OGG_CFLAGS"
212
# LIBS="$LIBS $OGG_LIBS"
215
# AC_MSG_ERROR([Couldn't find libogg or tests failed. Error: $OGG_PKG_ERRORS. Please go to http://www.vorbis.com to get the latest, or check config.log to see why the tests failed, and fix it.])
219
#VORBIS_VERSION=1.2.0
220
#PKG_CHECK_MODULES(VORBIS, vorbis >= $VORBIS_VERSION,
222
# CXXFLAGS="$CXXFLAGS $VORBIS_CFLAGS"
223
# LIBS="$LIBS $VORBIS_LIBS"
226
# AC_MSG_ERROR([Couldn't find libvorbis or tests failed. Error: $VORBIS_PKG_ERRORS. Please go to http://www.vorbis.com to get the latest, or check config.log to see why the tests failed, and fix it.])
229
#check for vorbisfile
230
#VORBISF_VERSION=1.2.0
231
#PKG_CHECK_MODULES(VORBISF, vorbisfile >= $VORBISF_VERSION,
233
# CXXFLAGS="$CXXFLAGS $VORBISF_CFLAGS"
234
# LIBS="$LIBS $VORBISF_LIBS"
237
# AC_MSG_ERROR([Couldn't find vorbisfile tests failed. Error: $VORBISF_PKG_ERRORS. Please go to http://www.vorbis.com to get the latest, or check config.log to see why the tests failed, and fix it.])
241
FREEALUT_VERSION=1.0.0
242
PKG_CHECK_MODULES(FREEALUT, freealut >= $FREEALUT_VERSION,
244
CXXFLAGS="$CXXFLAGS $FREEALUT_CFLAGS"
245
LIBS="$LIBS $FREEALUT_LIBS"
248
AC_MSG_ERROR([Couldn't find FreeALUT or tests failed. Error: $FREEALUT_PKG_ERRORS. Please go to http://www.openal.org to get the latest, or check config.log to see why the tests failed, and fix it.])
251
# check for sigc++ separately from the WF checks
252
PKG_CHECK_MODULES(SIG, [sigc++-2.0 >= 2.0],
254
CXXFLAGS="$CXXFLAGS $SIG_CFLAGS"
255
LIBS="$LIBS $SIG_LIBS"
258
AC_MSG_ERROR([Couldn't find SIGC++2.0])
261
# Check for the WorldForge libs
262
PKG_CHECK_MODULES(WF, [eris-1.3 >= 1.3.23 \
263
varconf-1.0 >= 0.6.7 mercator-0.3 >= 0.3.3 atlascpp-0.6 >= 0.6.3 wfmath-1.0 >= 1.0.0 libwfut-0.2 >= 0.2.2],
265
CXXFLAGS="$CXXFLAGS $WF_CFLAGS"
266
LIBS="$LIBS $WF_LIBS"
268
AC_MSG_ERROR([Couldn't find some of the required WorldForge libraries: $WF_PKG_ERRORS
269
Please visit http://worldforge.org/dev/eng/libraries to get the latest versions.])
274
OGRE_MAX_VERSION=1.9.9
275
PKG_CHECK_MODULES(OGRE, [OGRE >= $OGRE_VERSION OGRE < $OGRE_MAX_VERSION],
277
CXXFLAGS="$CXXFLAGS $OGRE_CFLAGS"
278
LIBS="$LIBS $OGRE_LIBS"
279
AC_DEFINE_UNQUOTED([OGRE_PLUGINDIR], "`pkg-config --variable=plugindir OGRE`", [The Ogre plugin dir])
282
AC_MSG_ERROR([Couldn't find OGRE or tests failed:
284
Please goto http://www.ogre3d.org to get the latest, or check config.log to
285
see why the tests failed, and fix it.])
288
# Check for OGRE Overlay Component separately
289
OGRE_OVERLAY_VERSION=1.9.0
290
PKG_CHECK_MODULES(OGRE_OVERLAY, [OGRE-Overlay >= OGRE_OVERLAY_VERSION],
292
CXXFLAGS="$CXXFLAGS $OGRE_OVERLAY_CFLAGS"
293
LIBS="$LIBS $OGRE_OVERLAY_LIBS"
295
AC_MSG_ERROR([Could not find the required OGRE Overlay component:
296
$OGRE_OVERLAY_PKG_ERRORS
297
Please goto http://www.ogre3d.org to get the full OGRE libraries, or check config.log to
298
see why the tests failed, and fix it.])
300
AC_SUBST([OGRE_OVERLAY_CFLAGS])
301
AC_SUBST([OGRE_OVERLAY_LIBS])
303
# Check for OGRE Terrain Component separately
304
OGRE_TERRAIN_VERSION=1.9.0
305
PKG_CHECK_MODULES(OGRE_TERRAIN, [OGRE-Terrain >= OGRE_TERRAIN_VERSION],
307
CXXFLAGS="$CXXFLAGS $OGRE_TERRAIN_CFLAGS"
308
LIBS="$LIBS $OGRE_TERRAIN_LIBS"
310
AC_MSG_ERROR([Could not find the required OGRE Terrain component:
311
$OGRE_TERRAIN_PKG_ERRORS
312
Please goto http://www.ogre3d.org to get the full OGRE libraries, or check config.log to
313
see why the tests failed, and fix it.])
315
AC_SUBST([OGRE_TERRAIN_CFLAGS])
316
AC_SUBST([OGRE_TERRAIN_LIBS])
319
#Check that Ogre is built with FreeImage support. If not, no images can be loaded. Ogre can also be built with DevIL, but that's not thread safe, and will lead to crashes.
320
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
321
#include <OgreBuildSettings.h>
324
#if OGRE_NO_FREEIMAGE == 0
325
// OGRE is built with FreeImage
327
# OGRE is not built with FreeImage
330
[], [AC_MSG_ERROR([[You must build Ogre with FreeImage support. You cannot use DevIL, as that's not thread safe.]])])
332
# We need to check if Ogre is built in double precision mode, mainly in order for the Lua bindings to be correct.
334
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
335
#include <OgreBuildSettings.h>
338
#if OGRE_DOUBLE_PRECISION == 0
339
// OGRE is built with single precision
341
# OGRE is built with double precision
344
[],[REAL_TYPE="double"])
346
AC_SUBST(OGRE_REAL_TYPE, $REAL_TYPE)
350
PKG_CHECK_MODULES(CEGUI, $CEGUI_PKG >= $CEGUI_VERSION,
352
CXXFLAGS="$CXXFLAGS $CEGUI_CFLAGS"
353
LIBS="$LIBS $CEGUI_LIBS"
354
AC_SUBST(CEGUI_MODULEDIR, `pkg-config $CEGUI_PKG --variable=moduledir`)
357
AC_MSG_ERROR([Couldn't find CEGUI or tests failed:
359
Please go to http://www.cegui.org.uk to get the latest, or check
360
config.log to see why the tests failed, and fix it.])
363
case "x$target_os" in
365
PKG_CHECK_MODULES([X11], x11,
367
CXXFLAGS="$CXXFLAGS $X11_CFLAGS"
368
LIBS="$LIBS $X11_LIBS"
371
AC_MSG_ERROR([Couldn't find X11 development files.
379
# Check for CEGUI-OGRE adapter
380
PKG_CHECK_MODULES(CEGUIOGRE, [CEGUI-0-OGRE >= $CEGUI_VERSION],
382
CXXFLAGS="$CXXFLAGS $CEGUIOGRE_CFLAGS"
383
LIBS="$LIBS $CEGUIOGRE_LIBS"
386
AC_MSG_ERROR([Couldn't find CEGUI-OGRE adapter. Make sure that you've compiled Ogre before compiling CEGUI, and that CEGUI found the Ogre libs so that the Ogre renderer is built.
387
$CEGUIOGRE_PKG_ERRORS])
392
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1,
394
CXXFLAGS="$CXXFLAGS $LUA_CFLAGS -DLUA51"
395
LIBS="$LIBS $LUA_LIBS"
396
AC_MSG_NOTICE([Lua version => 5.1, make sure that CEGUI also has been compiled for this version])
399
PKG_CHECK_MODULES(LUA, lua >= 5.1,
401
CXXFLAGS="$CXXFLAGS $LUA_CFLAGS -DLUA51"
402
LIBS="$LIBS $LUA_LIBS"
403
AC_MSG_NOTICE([Lua version => 5.1, make sure that CEGUI also has been compiled for this version])
406
AC_MSG_ERROR([Couldn't find Lua or tests failed. Error: $LUA_PKG_ERRORS. Please go to http://www.lua.org to get the latest, or check config.log to see why the tests failed, and fix it. Also make sure that CEGUI is built with Lua support.])
411
AC_ARG_ENABLE(cegui_toluapp,
412
[ AS_HELP_STRING([--enable-cegui-toluapp], [allow Ember to use the CEGUI provided tolua++ library. This requires that you've also had CEGUI build the tolua++ generator, and that generator by this build (see --with-tolua++) (default is disabled)])],
414
if test "$enableval" = "yes"; then
417
cegui_toluapp="false"
420
cegui_toluapp="false"
425
AC_CHECK_LIB([CEGUItoluapp], [main],
427
if test "$cegui_toluapp" = "true"; then
428
LIBS="-lCEGUItoluapp $LIBS"
429
AC_MSG_NOTICE([Using CEGUI provided tolua++ implementation. Make sure that you're also using the CEGUI provided tolua++ generator (see --with-toluaxx)])
431
AC_MSG_ERROR([A CEGUI provided tolua++ implementation was found. By default this is not allowed. The reason is that CEGUI normally doesn't build the tolua++ generator needed by Ember, and there's a risk then that Ember will use a tolua++ generator installed by the system together with the tolua++ library provided by CEGUI. This will in most cases lead to strange compilation errors.
432
You have two options:
433
1) Make sure that there's a tolua++ (http://www.codenix.com/~tolua/) development package installed on the system, and recompile CEGUI so that it recognizes and uses this (make sure to uninstall CEGUI first).
434
2) If you're certain that you've told CEGUI to also compile the tolua++ code generator and want to have Ember use the CEGUI provided tolua++ implementation, use the --enable-cegui-toluapp to disable this check. Use --with-toluaxx to make sure that the CEGUI provided tolua++ generator is used.])
438
AC_CHECK_LIB([tolua++], [main],
440
LIBS="-ltolua++ $LIBS"
443
#Debian based systems adds a "5.1" suffix to the library name
444
AC_CHECK_LIB([tolua++5.1], [main],
446
LIBS="-ltolua++5.1 $LIBS"
449
AC_MSG_ERROR([Couldn't find tolua++. Make sure that tolua++ (http://www.codenix.com/~tolua/) is installed and CEGUI is compiled with Lua scripting support.])
459
# We have lua and tolua++. Now, check for CEGUI lua module
460
PKG_CHECK_MODULES(CEGUILUA, [CEGUI-0-LUA >= $CEGUI_VERSION],
462
CXXFLAGS="$CXXFLAGS $CEGUILUA_CFLAGS"
463
LIBS="$LIBS $CEGUILUA_LIBS"
466
AC_MSG_ERROR([Couldn't find Lua CEGUI module. Make sure that CEGUI compiled with Lua scripting support.
467
$CEGUILUA_PKG_ERRORS])
472
AC_ARG_ENABLE(cppunit,[ --enable-cppunit enables cppunit tests [default=yes]],
474
if test x$enableval = xno; then
479
], [ac_use_cppunit="yes"])
483
if test "$ac_use_cppunit" = "yes"; then
484
AM_PATH_CPPUNIT(1.8.0, [
487
*** Setting up make check to run tests...])
491
*** Unable to find a recent enough CppUnit
492
*** Will not run unit testing!!
494
*** To get CppUnit see http://cppunit.sourceforge.net
498
AM_CONDITIONAL(USE_CPPUNIT, [test x$found_cppunit = xyes])
502
AC_ARG_ENABLE(debug,[ --enable-debug creates debugging code [default=no]],
504
if test x$enableval = xno; then
505
ac_use_debug_code="no"
507
ac_use_debug_code="yes"
509
], [ac_use_debug_code="no"])
511
if test "$ac_use_debug_code" = "yes"; then
512
CFLAGS="$CFLAGS -DDEBUG"
513
CXXFLAGS="$CXXFLAGS -DDEBUG"
515
CFLAGS="$CFLAGS -DNDEBUG"
516
CXXFLAGS="$CXXFLAGS -DNDEBUG"
519
# gprof debugging option
520
AC_ARG_ENABLE(gprof,[ --enable-gprof Add flags for gprof [default=no]],
522
if test x$enableval = xno; then
523
ac_use_gprof_code="no"
525
ac_use_gprof_code="yes"
527
], [ac_use_gprof_code="no"])
529
if test "$ac_use_gprof_code" = "yes"; then
530
CFLAGS="$CFLAGS -pg -g"
531
CXXFLAGS="$CXXFLAGS -pg -g"
539
#dnl add SDL flags here, now that we're done with the other tests
540
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
541
LIBS="$LIBS $SDL_LIBS"
546
**************************************
547
* Tests Passed, Creating Makefiles.
548
**************************************
552
AC_CONFIG_FILES([Makefile
554
src/platform/Makefile
556
src/components/Makefile
557
src/bindings/Makefile
558
src/bindings/lua/Makefile
559
src/framework/Makefile
560
src/framework/tasks/Makefile
561
src/framework/bindings/Makefile
562
src/framework/bindings/lua/Makefile
563
src/framework/bindings/lua/eris/Makefile
564
src/framework/bindings/lua/atlas/Makefile
565
src/framework/bindings/lua/varconf/Makefile
566
src/services/Makefile
567
src/services/config/Makefile
568
src/services/logging/Makefile
569
src/services/metaserver/Makefile
570
src/services/server/Makefile
571
src/services/scripting/Makefile
572
src/services/sound/Makefile
573
src/services/bindings/Makefile
574
src/services/bindings/lua/Makefile
575
src/services/wfut/Makefile
576
src/services/input/Makefile
577
src/services/serversettings/Makefile
582
support/ember-media.spec
583
src/extensions/Makefile
584
src/components/lua/Makefile
585
src/components/lua/bindings/Makefile
586
src/components/lua/bindings/lua/Makefile
587
src/components/ogre/scripting/Makefile
588
src/components/ogre/scripting/bindings/Makefile
589
src/components/ogre/scripting/bindings/lua/Makefile
590
src/components/ogre/scripting/bindings/lua/ogre/Makefile
591
src/components/ogre/scripting/bindings/lua/helpers/Makefile
592
src/components/ogre/Makefile
593
src/components/ogre/widgets/Makefile
594
src/components/ogre/widgets/adapters/Makefile
595
src/components/ogre/widgets/adapters/atlas/Makefile
596
src/components/ogre/widgets/adapters/atlas/bindings/Makefile
597
src/components/ogre/widgets/adapters/atlas/bindings/lua/Makefile
598
src/components/ogre/widgets/adapters/bindings/Makefile
599
src/components/ogre/widgets/adapters/bindings/lua/Makefile
600
src/components/ogre/widgets/representations/Makefile
601
src/components/ogre/widgets/representations/bindings/Makefile
602
src/components/ogre/widgets/representations/bindings/lua/Makefile
603
src/components/ogre/environment/caelum/Makefile
604
src/components/ogre/environment/pagedgeometry/Makefile
605
src/components/ogre/environment/meshtree/Makefile
606
src/components/ogre/environment/Makefile
607
src/components/ogre/data/Makefile
608
src/components/ogre/sounddefinitions/Makefile
609
src/components/ogre/authoring/Makefile
610
src/components/ogre/authoring/entityrecipes/Makefile
611
src/components/entitymapping/Makefile
612
src/components/cegui/Makefile
613
src/components/cegui/bindings/Makefile
614
src/components/cegui/bindings/lua/Makefile
616
src/extensions/webember/Makefile
618
src/domain/bindings/Makefile
619
src/domain/bindings/lua/Makefile
626
**************************************
627
* Finished. Run make to compile Ember.
628
* Note that you also need to install the media. This can be gotten in a couple of different ways.
629
* The easiest way is to use the rsync make target (which uses the rsync program to update the media.).
630
* If you're compiling from git and want to use the development version, do:
634
* If you're using a release version, you should however instead do:
636
* make releasemediarsync
638
* Note that both of these make targets will just fetch and install the files directly, bypassing normal "make install" producures. They should therefore not be used if you don't want to pollute your installation directory, and shouldn't be used if you install to a system directory.
640
* A third way is to get the media tarball directly. This only works for release versions however.
641
* You can find these media tarballs at http://amber.worldforge.org/WFUT .
642
* The media should be installed to PREFIX/share/ember/media
643
* so that you get PREFIX/share/ember/media/user and PREFIX/share/ember/media/shared.
644
* More information can be found at the Ember page at http://www.worldforge.org
645
**************************************