2009-07-13 19:24:30 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
2011-08-09 23:13:23 +00:00
|
|
|
# Copyright (c) 2005-2011 Günther Brammer
|
|
|
|
# Copyright (c) 2005, 2008 Peter Wortmann
|
|
|
|
# Copyright (c) 2006 Julian Raschke
|
|
|
|
# Copyright (c) 2010 Armin Burgmeier
|
2011-09-01 10:47:54 +00:00
|
|
|
# Copyright (c) 2010 Martin Plicht
|
2011-08-09 23:13:23 +00:00
|
|
|
# Copyright (c) 2005-2009, RedWolf Design GmbH, http://www.clonk.de
|
|
|
|
|
|
|
|
# Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
|
|
AC_PREREQ([2.67])
|
2012-08-07 18:45:37 +00:00
|
|
|
AC_INIT([clonk], [m4_esyscmd([sed -n 's/SET(C4XVER1\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r'
|
|
|
|
]).m4_esyscmd([sed -n 's/SET(C4XVER2\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r'
|
|
|
|
]).m4_esyscmd([sed -n 's/SET(C4XVER3\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r'])])
|
2011-08-09 23:13:23 +00:00
|
|
|
AC_COPYRIGHT([©2005-2011 Günther Brammer])
|
2012-04-27 17:04:43 +00:00
|
|
|
AC_CONFIG_SRCDIR([/src/C4Include.h])
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_CONFIG_AUX_DIR([autotools])
|
2012-05-05 21:48:31 +00:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
dnl foreign to tell automake to shut up,
|
|
|
|
dnl and subdir-objects because it makes the Makefile smaller.
|
|
|
|
dnl no-define because PACKAGE and VERSION are not used
|
2011-06-26 23:56:07 +00:00
|
|
|
AM_INIT_AUTOMAKE([foreign tar-ustar nostdinc no-define 1.10])
|
2010-01-05 13:27:44 +00:00
|
|
|
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
2009-07-13 19:24:30 +00:00
|
|
|
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_LANG([C++])
|
2011-08-09 23:13:23 +00:00
|
|
|
AX_CHECK_COMPILE_FLAG([-std=gnu++0x], [CXX="${CXX} -std=gnu++0x"], [])
|
2009-07-20 20:29:48 +00:00
|
|
|
AC_COMPILE_IFELSE([
|
|
|
|
void f(struct D&&); int main() { return 0; }
|
|
|
|
], [AC_DEFINE([HAVE_RVALUE_REF], [], [C++ Compiler has rvalue references, a C++0x feature.])], [AX_PROG_CXX_REFTOTEMP])
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
AC_PROG_RANLIB
|
2012-06-21 16:07:08 +00:00
|
|
|
# Automake 1.12 breaks if this isn't run unconditionally
|
|
|
|
AC_PROG_OBJCXX
|
2009-07-13 19:24:30 +00:00
|
|
|
|
|
|
|
case $host in
|
|
|
|
*-*-mingw32* | *-*-cygwin* | *-*-windows*)
|
|
|
|
win32=true; osx=false;;
|
|
|
|
*-*-darwin*)
|
2012-06-21 16:07:08 +00:00
|
|
|
win32=false; osx=true;;
|
2009-07-13 19:24:30 +00:00
|
|
|
*)
|
|
|
|
win32=false; osx=false;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Detect Wine. Unfortunately, at the moment winegcc does not meet the demands
|
|
|
|
AC_CHECK_HEADER([windows.h], [win32=true], [], [[ ]])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(WIN32, [test $win32 = true])
|
2009-12-31 02:16:39 +00:00
|
|
|
AM_CONDITIONAL(MACOSX, [test $osx = true])
|
2009-07-13 19:24:30 +00:00
|
|
|
|
|
|
|
# various used headers
|
|
|
|
dnl the whitespace is there to prevent AC_INCLUDES_DEFAULT
|
2011-03-17 01:33:56 +00:00
|
|
|
AC_CHECK_HEADERS([stdint.h unistd.h poll.h sys/file.h sys/stat.h sys/types.h locale.h sys/socket.h signal.h langinfo.h sys/eventfd.h sys/timerfd.h sys/inotify.h], , , [[ ]])
|
2012-07-18 01:40:19 +00:00
|
|
|
AC_CHECK_HEADERS([io.h direct.h share.h natupnp.h], [], [], [[#include <windows.h>]])
|
2009-07-13 19:24:30 +00:00
|
|
|
# iconv
|
|
|
|
AX_ICONV
|
|
|
|
# vasprintf is a GNU extension
|
|
|
|
AC_CHECK_FUNCS(vasprintf)
|
2010-03-19 01:23:20 +00:00
|
|
|
# so is execinfo.h - and some systems have the header despite the functions not being in the c library
|
|
|
|
AC_CHECK_HEADER(execinfo.h)
|
|
|
|
if test "x$ac_cv_header_execinfo_h" = xyes; then
|
|
|
|
AC_CHECK_FUNC(backtrace, [], [
|
|
|
|
AC_CHECK_LIB(execinfo, backtrace, [
|
|
|
|
CLONK_LIBS="-lexecinfo $CLONK_LIBS"
|
|
|
|
], [
|
|
|
|
ac_cv_header_execinfo_h=no
|
|
|
|
])
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
if test "x$ac_cv_header_execinfo_h" = xyes; then
|
|
|
|
AC_DEFINE(HAVE_EXECINFO_H, 1, [The backtrace function is declared in execinfo.h and works])
|
|
|
|
fi
|
2009-07-13 19:24:30 +00:00
|
|
|
|
|
|
|
AC_ARG_ENABLE([debug],
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--enable-debug],[debugging options [default=no]])],
|
2009-07-13 19:24:30 +00:00
|
|
|
, [enable_debug=no])
|
|
|
|
if test $enable_debug = yes; then
|
|
|
|
AC_DEFINE([_DEBUG], 1, [compile with debug options])
|
|
|
|
else
|
|
|
|
AC_DEFINE([NDEBUG], 1, [compile without debug options])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([debugrec],
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--enable-debugrec],[write additional debug control to records [default=no]])],
|
2009-07-13 19:24:30 +00:00
|
|
|
, [enable_debugrec=no])
|
|
|
|
if test $enable_debugrec = yes; then
|
|
|
|
AC_DEFINE([DEBUGREC], 1, [Activate DebugRecs])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([console],
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--enable-console],[compile as pure console application [default=no]])],
|
2009-07-13 19:24:30 +00:00
|
|
|
, [enable_console=no])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([sound],
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--enable-sound],[compile with sound support [default=yes]])],
|
2009-07-13 19:24:30 +00:00
|
|
|
, [if test $enable_console = yes; then enable_sound=no; else if test $win32 = true; then enable_sound=no; else enable_sound=yes; fi; fi])
|
|
|
|
|
2009-08-22 13:31:30 +00:00
|
|
|
# GTK+
|
2011-01-24 00:06:34 +00:00
|
|
|
GTK2_REQUIRED="glib-2.0 >= 2.8 gtk+-2.0 >= 2.8"
|
|
|
|
GTK3_REQUIRED="glib-2.0 >= 2.27.5 gtk+-3.0 >= 2.99.0"
|
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
AC_MSG_CHECKING([which gtk+ version to compile against])
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_ARG_WITH([gtk],
|
2011-01-24 00:06:34 +00:00
|
|
|
[AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against [default: auto]])],
|
|
|
|
[case "$with_gtk" in
|
|
|
|
2.0|3.0) ;;
|
|
|
|
no) ;;
|
|
|
|
*) AC_MSG_ERROR([invalid gtk version specified]) ;;
|
|
|
|
esac],
|
|
|
|
[AS_IF([test $enable_console = no],
|
|
|
|
[PKG_CHECK_EXISTS([$GTK3_REQUIRED],
|
|
|
|
[with_gtk=3.0],
|
|
|
|
[PKG_CHECK_EXISTS([$GTK2_REQUIRED],
|
|
|
|
[with_gtk=2.0],
|
|
|
|
[with_gtk=no])])],
|
|
|
|
[with_gtk=no])])
|
|
|
|
AC_MSG_RESULT([$with_gtk])
|
|
|
|
AS_IF([test $with_gtk != no],[
|
|
|
|
case "$with_gtk" in
|
|
|
|
2.0) GTK_REQUIRED="$GTK2_REQUIRED"
|
|
|
|
;;
|
|
|
|
3.0) GTK_REQUIRED="$GTK3_REQUIRED"
|
|
|
|
;;
|
|
|
|
esac
|
2009-08-22 13:31:30 +00:00
|
|
|
PKG_CHECK_MODULES(GTK, [$GTK_REQUIRED])
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_DEFINE([WITH_GLIB], 1, [Glib])
|
|
|
|
AC_DEFINE([WITH_DEVELOPER_MODE], 1, [Developer mode])
|
|
|
|
])
|
2012-03-23 21:53:56 +00:00
|
|
|
AM_CONDITIONAL(GTK, [test $with_gtk != no])
|
2010-09-26 00:36:35 +00:00
|
|
|
|
|
|
|
# OpenAL
|
|
|
|
AC_ARG_WITH([openal],
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--with-openal],[compile with openal support [default=no]])],
|
2010-09-26 00:36:35 +00:00
|
|
|
, [with_openal=no])
|
|
|
|
if test $with_openal = yes; then
|
|
|
|
PKG_CHECK_MODULES(OPENAL, [vorbis vorbisfile openal])
|
|
|
|
AC_DEFINE([USE_OPEN_AL], 1, [OpenAL sound])
|
|
|
|
if test $enable_sound = no; then
|
|
|
|
AC_MSG_ERROR([--with-openal cannot be used with --disable-sound.])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# SDL
|
|
|
|
with_sdl_mixer=no
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_ARG_WITH([sdl],
|
|
|
|
AS_HELP_STRING([--with-sdl], [Use SDL @<:@default=yes (no for win32)@:>@]),
|
|
|
|
, [if test $win32 = true; then with_sdl=no; else if test $enable_console = yes; then with_sdl=no; else with_sdl=yes; fi fi])
|
|
|
|
if test $with_sdl = yes; then
|
|
|
|
# Check for SDL
|
|
|
|
SDL_VERSION=1.2.0
|
|
|
|
AM_PATH_SDL($SDL_VERSION,
|
|
|
|
[AC_DEFINE(HAVE_SDL, 1, [Define to 1 if you have SDL.])],
|
|
|
|
[AC_MSG_ERROR([libSDL not found.])])
|
|
|
|
AC_SUBST(SDL_CFLAGS)
|
|
|
|
AC_SUBST(SDL_LIBS)
|
2010-09-26 00:36:35 +00:00
|
|
|
if test $enable_sound = yes && test $with_openal = no; then
|
2009-07-13 19:24:30 +00:00
|
|
|
# Check for SDL_mixer library
|
|
|
|
AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,
|
|
|
|
[AC_DEFINE(HAVE_LIBSDL_MIXER,1,[Define to 1 if you have SDL_mixer.])
|
2010-09-26 00:36:35 +00:00
|
|
|
SDL_LIBS="-lSDL_mixer $SDL_LIBS"
|
|
|
|
with_sdl_mixer=yes],
|
2009-07-13 19:24:30 +00:00
|
|
|
[AC_MSG_ERROR([SDL_mixer not found.])],
|
|
|
|
[$SDL_LIBS])
|
|
|
|
fi
|
|
|
|
AC_ARG_ENABLE(sdlmainloop,
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--enable-sdlmainloop],[use SDL instead of X11 or Win32 [default=no]])],
|
2009-07-13 19:24:30 +00:00
|
|
|
, [if test $osx = true; then enable_sdlmainloop=yes; else enable_sdlmainloop=no; fi ])
|
|
|
|
else
|
|
|
|
enable_sdlmainloop=no
|
|
|
|
fi
|
|
|
|
if test $enable_sdlmainloop = yes; then
|
|
|
|
with_x=no
|
|
|
|
AC_DEFINE(USE_SDL_MAINLOOP, 1, [Define to 1 if SDL is used for the main loop])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(SDL_MAIN_LOOP, [test $enable_sdlmainloop = yes])
|
|
|
|
|
|
|
|
if test $enable_sound = yes; then
|
|
|
|
AC_ARG_ENABLE([mp3],
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--enable-mp3],[enable mp3 support [default=no]])],
|
2009-07-13 19:24:30 +00:00
|
|
|
, [enable_mp3=no])
|
|
|
|
if test $enable_mp3 = yes; then
|
|
|
|
AC_DEFINE([USE_MP3], 1, [MP3 music])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $enable_console = no; then
|
|
|
|
if test $win32 = true; then
|
|
|
|
AC_SUBST(WINDOWS_CFLAGS, "-mwindows")
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# console mode
|
|
|
|
AC_DEFINE([USE_CONSOLE], 1, [dedicated server mode])
|
|
|
|
with_x=no
|
|
|
|
enable_sdlmainloop=no
|
|
|
|
VL_LIB_READLINE
|
|
|
|
fi
|
|
|
|
|
2010-09-22 14:43:26 +00:00
|
|
|
# Check for boost
|
|
|
|
AX_BOOST_BASE([1.40.0], [], [
|
|
|
|
AC_MSG_ERROR([Boost not found.])
|
|
|
|
])
|
|
|
|
|
2009-07-13 19:24:30 +00:00
|
|
|
# Check for libjpeg
|
|
|
|
AC_CHECK_LIB(jpeg, jpeg_read_header, [
|
|
|
|
CLONK_LIBS="-ljpeg $CLONK_LIBS"
|
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([libjpeg not found.])
|
|
|
|
])
|
|
|
|
|
|
|
|
# Check for libpng
|
|
|
|
AC_CHECK_LIB(png, png_read_image, [
|
|
|
|
CLONK_LIBS="-lpng $CLONK_LIBS"
|
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([libpng not found.])
|
|
|
|
], [-lz])
|
|
|
|
|
|
|
|
# Check for libz
|
|
|
|
AC_CHECK_LIB(z, deflate, [
|
2009-08-15 19:55:26 +00:00
|
|
|
Z_LIBS="-lz $Z_LIBS"
|
2009-07-13 19:24:30 +00:00
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([libz not found.])
|
|
|
|
])
|
|
|
|
|
2011-06-26 23:52:39 +00:00
|
|
|
# Check for librt
|
|
|
|
AC_CHECK_LIB(rt, clock_gettime, [
|
|
|
|
LDADD="-lrt $LDADD"
|
|
|
|
], [])
|
|
|
|
|
2009-07-13 19:24:30 +00:00
|
|
|
# Check for libfreetype
|
|
|
|
if test $enable_console = no; then
|
2012-03-23 21:53:56 +00:00
|
|
|
PKG_CHECK_MODULES(FREETYPE, freetype2, ,[
|
|
|
|
if test "$cross_compiling" = no; then
|
|
|
|
AC_CHECK_PROG(FREETYPE_CONFIG, freetype-config, freetype-config)
|
|
|
|
fi
|
|
|
|
if test $FREETYPE_CONFIG; then
|
|
|
|
AC_SUBST(FREETYPE_CFLAGS, [`$FREETYPE_CONFIG --cflags`])
|
|
|
|
AC_SUBST(FREETYPE_LIBS, [`$FREETYPE_CONFIG --libs`])
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([Freetype not found.])
|
|
|
|
fi
|
|
|
|
])
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have FreeType2.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# X11, Xpm, Xrandr
|
|
|
|
AC_PATH_XTRA
|
|
|
|
if test $have_x = yes; then
|
|
|
|
AC_DEFINE(USE_X11, 1, [Define to 1 if the X Window System is used])
|
|
|
|
CLONK_LIBS="$X_LIBS $CLONK_LIBS"
|
|
|
|
AC_CHECK_HEADERS([X11/keysym.h X11/extensions/xf86vmode.h X11/xpm.h X11/extensions/Xrandr.h], ,
|
|
|
|
[AC_MSG_ERROR([A required X11 header was not found.])], [[#include <X11/Xlib.h>]])
|
|
|
|
AC_CHECK_LIB(X11, XOpenDisplay, [CLONK_LIBS="-lX11 $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([libX11 not found.])], [$X_LIBS])
|
|
|
|
AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [CLONK_LIBS="-lXpm $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([libXpm not found.])], [$X_LIBS])
|
|
|
|
AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, [CLONK_LIBS="-lXxf86vm $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([XF86VidMode not found.])], [$X_LIBS])
|
|
|
|
AC_CHECK_LIB(Xrandr, XRRQueryExtension, [CLONK_LIBS="-lXrandr $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([libXrandr not found.])], [$X_LIBS])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# OpenGL
|
|
|
|
AC_ARG_WITH([gl],
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--with-gl],[compile with opengl support [default=yes]])],
|
2009-07-13 19:24:30 +00:00
|
|
|
, [if test $enable_console = yes; then with_gl=no; else with_gl=yes; fi])
|
|
|
|
if test $with_gl = yes; then
|
|
|
|
if test $osx = true; then
|
|
|
|
CLONK_LIBS="-framework OpenGL $CLONK_LIBS"
|
2009-12-31 02:16:39 +00:00
|
|
|
AC_CHECK_LIB(GLEW, glewInit, [CLONK_LIBS="-lGLEW $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([glew not found.])])
|
2009-07-13 19:24:30 +00:00
|
|
|
elif test $win32 = true; then
|
|
|
|
AC_CHECK_LIB(opengl32, main, [CLONK_LIBS="-lopengl32 $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([opengl32 not found.])])
|
|
|
|
AC_CHECK_LIB(glu32, main, [CLONK_LIBS="-lglu32 $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([glu32 not found.])])
|
|
|
|
AC_CHECK_LIB(glew32, main, [CLONK_LIBS="-lglew32 $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([glew not found.])])
|
|
|
|
AC_SUBST([GLEW_CFLAGS],["-DGLEW_STATIC"])
|
|
|
|
else
|
|
|
|
AC_CHECK_LIB(GL, glBegin, [CLONK_LIBS="-lGL $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([libGL not found.])])
|
|
|
|
AC_CHECK_LIB(GLU, gluOrtho2D, [CLONK_LIBS="-lGLU $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([libGLU not found.])])
|
|
|
|
AC_CHECK_LIB(GLEW, glewInit, [CLONK_LIBS="-lGLEW $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([glew not found.])])
|
|
|
|
fi
|
|
|
|
AC_DEFINE([USE_GL], 1, [OpenGL graphics])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# DirectX
|
|
|
|
AC_ARG_WITH([directx],
|
2011-08-09 23:13:23 +00:00
|
|
|
[AS_HELP_STRING([--with-directx],[compile with directx support [default=no]])],
|
2009-07-13 19:24:30 +00:00
|
|
|
, [with_directx="no"])
|
|
|
|
if test "$with_directx" = yes; then
|
|
|
|
AC_CHECK_LIB(d3d9, main, [CLONK_LIBS="-ld3d9 $CLONK_LIBS"],
|
|
|
|
[AC_MSG_ERROR([d3d9 not found.])])
|
|
|
|
AC_DEFINE([USE_DIRECTX], 1, [DirectX graphics])
|
|
|
|
fi
|
|
|
|
|
2012-01-27 00:42:37 +00:00
|
|
|
# UPnP
|
|
|
|
AC_ARG_WITH([upnp],
|
|
|
|
[AS_HELP_STRING([--with-upnp],[compile with upnp support [default=no]])],
|
|
|
|
, [with_upnp=no])
|
|
|
|
AS_IF([test $with_upnp = yes], [
|
|
|
|
AM_CONDITIONAL(NATUPNP, [test "$ac_cv_header_natupnp_h" = yes])
|
|
|
|
PKG_CHECK_MODULES(LIBUPNP, [libupnp], [have_libupnp=yes], [have_libupnp=no])
|
|
|
|
], [
|
|
|
|
AM_CONDITIONAL(NATUPNP, [false])
|
|
|
|
have_libupnp=no
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL(LIBUPNP, [test "$have_libupnp" = yes])
|
|
|
|
|
|
|
|
# Automatic Update
|
2012-04-27 17:04:43 +00:00
|
|
|
AC_ARG_ENABLE([autoupdate],
|
|
|
|
[AS_HELP_STRING([--disable-autoupdate],[support for automatic engine updates [default=yes]])],
|
|
|
|
, [enable_autoupdate="yes"])
|
|
|
|
AS_IF([test "$enable_autoupdate" = yes], [
|
2010-12-26 20:39:52 +00:00
|
|
|
AC_DEFINE([WITH_AUTOMATIC_UPDATE], 1, [Enable automatic update system])
|
2012-04-27 17:04:43 +00:00
|
|
|
])
|
|
|
|
AM_CONDITIONAL(AUTOUPDATE, [test "$enable_autoupdate" = yes])
|
2010-12-26 20:39:52 +00:00
|
|
|
|
2009-07-13 19:24:30 +00:00
|
|
|
if test $win32 = false; then
|
|
|
|
# pthread
|
2009-12-31 02:20:15 +00:00
|
|
|
AX_PTHREAD( , [AC_MSG_ERROR([No pthread support.])])
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_SUBST(PTHREAD_LIBS)
|
|
|
|
AC_SUBST(PTHREAD_CFLAGS)
|
|
|
|
|
|
|
|
# FMod is used for windows only
|
|
|
|
AM_CONDITIONAL(USE_FMOD, false)
|
|
|
|
else
|
|
|
|
# Windows
|
2011-06-26 23:52:39 +00:00
|
|
|
for WIN32LIB in gdi32 comdlg32 ws2_32
|
2009-07-13 19:24:30 +00:00
|
|
|
do
|
|
|
|
AC_CHECK_LIB([$WIN32LIB], main, [CLONK_LIBS="-l$WIN32LIB $CLONK_LIBS"], [AC_MSG_ERROR([$WIN32LIB not found.])])
|
|
|
|
done
|
|
|
|
|
2011-06-26 23:52:39 +00:00
|
|
|
AC_CHECK_LIB([winmm], main, [LDADD="-lwinmm $LDADD"], [AC_MSG_ERROR([winmm not found.])])
|
|
|
|
|
2011-05-12 15:13:38 +00:00
|
|
|
AC_CHECK_LIB([vfw32], main, [
|
|
|
|
CLONK_LIBS="-lvfw32 $CLONK_LIBS"
|
|
|
|
AC_DEFINE([HAVE_VFW32], 1, [ ])
|
|
|
|
], [])
|
|
|
|
|
2009-07-13 19:24:30 +00:00
|
|
|
# FMod (Library comes with standard)
|
|
|
|
if test "$enable_sound" = yes; then
|
2011-05-12 15:13:38 +00:00
|
|
|
AC_DEFINE([USE_FMOD], 1, [Whether FMOD shall be used])
|
2009-07-13 19:24:30 +00:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(USE_FMOD, test "$enable_sound" = yes)
|
|
|
|
|
|
|
|
# windres
|
|
|
|
AC_CHECK_TOOL(WINDRES, windres, no)
|
|
|
|
if test $WINDRES = no; then
|
|
|
|
AC_MSG_ERROR([windres not found.])
|
|
|
|
fi
|
2012-06-08 11:31:21 +00:00
|
|
|
|
|
|
|
# ASLR/DEP
|
|
|
|
LDADD="-Wl,--nxcompat -Wl,--dynamicbase $LDADD"
|
2009-07-13 19:24:30 +00:00
|
|
|
fi
|
|
|
|
|
2011-06-26 23:52:39 +00:00
|
|
|
AC_SUBST(LDADD)
|
2009-07-13 19:24:30 +00:00
|
|
|
AC_SUBST(CLONK_LIBS)
|
2009-08-15 19:55:26 +00:00
|
|
|
AC_SUBST(Z_LIBS)
|
2009-07-13 19:24:30 +00:00
|
|
|
|
|
|
|
# precompiled headers and -Wextra
|
|
|
|
AC_MSG_CHECKING([whether we are using a GNU C++ compiler version 4.1 or newer])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if defined(__GNUC__) && (((__GNUC__ >= 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4))
|
|
|
|
// all ok
|
|
|
|
#else
|
|
|
|
choke me
|
|
|
|
#endif
|
|
|
|
]])], RECENT_GCC="yes", RECENT_GCC="no")
|
|
|
|
AC_MSG_RESULT([$RECENT_GCC])
|
|
|
|
AM_CONDITIONAL(RECENT_GCC, [test $RECENT_GCC = yes])
|
|
|
|
|
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
echo "Configuration:
|
2012-04-27 17:04:43 +00:00
|
|
|
CFLAGS: $CFLAGS
|
|
|
|
CXXFLAGS: $CXXFLAGS
|
2009-07-13 19:24:30 +00:00
|
|
|
Debug: $enable_debug
|
|
|
|
Debugrec: $enable_debugrec
|
|
|
|
Pure console: $enable_console
|
2012-04-27 17:04:43 +00:00
|
|
|
Autoupdate: $enable_autoupdate
|
2009-07-13 19:24:30 +00:00
|
|
|
DirectX: $with_directx
|
|
|
|
OpenGL: $with_gl
|
2012-04-27 17:04:43 +00:00
|
|
|
Nat/LibUPnP: $ac_cv_header_natupnp_h/$have_libupnp
|
2009-07-13 19:24:30 +00:00
|
|
|
Sound: $enable_sound
|
2010-09-26 00:36:35 +00:00
|
|
|
SDL_Mixer: $with_sdl_mixer
|
|
|
|
OpenAL: $with_openal
|
2009-07-13 19:24:30 +00:00
|
|
|
GTK+: $with_gtk
|
2012-04-27 17:04:43 +00:00
|
|
|
X11: $have_x"
|
2009-07-13 19:24:30 +00:00
|
|
|
|
|
|
|
if test "$enable_sdlmainloop" = yes; then echo " SDL: mainloop";
|
|
|
|
else echo " SDL: $with_sdl"; fi
|
|
|
|
|