2008-08-04 12:33:08 +03:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.60)
|
2012-03-05 16:31:59 +03:00
|
|
|
AC_INIT(vcmi, 0.88b) # Follow VCMI_VERSION in GameConstants.h
|
2008-08-04 12:33:08 +03:00
|
|
|
AM_INIT_AUTOMAKE
|
2009-05-07 07:45:59 +03:00
|
|
|
AC_CONFIG_MACRO_DIR([aclocal/m4])
|
2008-08-04 12:33:08 +03:00
|
|
|
|
2009-05-07 07:45:59 +03:00
|
|
|
# Checks for build toolchain
|
|
|
|
AC_LANG(C++)
|
2008-08-04 12:33:08 +03:00
|
|
|
AC_PROG_CXX
|
2009-01-31 04:36:44 +02:00
|
|
|
AC_ENABLE_SHARED
|
|
|
|
AC_DISABLE_STATIC
|
|
|
|
AC_PROG_LIBTOOL
|
2011-04-09 20:28:51 +03:00
|
|
|
AX_COMPILER_VENDOR
|
2008-08-04 12:33:08 +03:00
|
|
|
|
2012-02-16 20:10:58 +03:00
|
|
|
|
2010-08-21 03:41:40 +03:00
|
|
|
# Use silent rules if supported.
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2009-05-07 07:45:59 +03:00
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --disable-debug turn off debugging (default=enable)],
|
|
|
|
[ if test x$enableval = xyes ; then
|
|
|
|
enable_debug="yes"
|
|
|
|
else
|
|
|
|
enable_debug="no"
|
|
|
|
fi],
|
|
|
|
[ enable_debug="yes" ])
|
|
|
|
if test "x$GXX" = "xyes" -a "x$enable_debug" = "xyes" ; then
|
2011-03-29 20:16:10 +03:00
|
|
|
CXXFLAGS="$CXXFLAGS -O0 -ggdb"
|
2008-08-04 12:33:08 +03:00
|
|
|
fi
|
|
|
|
|
2012-02-16 20:10:58 +03:00
|
|
|
# For c++11 compatibility. Required at least in VCAI
|
|
|
|
CXXFLAGS="$CXXFLAGS -std=c++0x"
|
|
|
|
|
2011-04-09 20:28:51 +03:00
|
|
|
# For gcc and compatible compilers, enable compilation warnings, but
|
|
|
|
# selectively disable some because too many are generated.
|
2010-06-29 04:58:31 +03:00
|
|
|
if test "x$GXX" = "xyes" ; then
|
2012-02-16 20:10:58 +03:00
|
|
|
CXXFLAGS="$CXXFLAGS -Wall -Wno-switch -Wno-sign-compare -Wcast-align -Wpointer-arith"
|
2010-06-29 04:58:31 +03:00
|
|
|
fi
|
|
|
|
|
2011-04-09 20:28:51 +03:00
|
|
|
# extra clang parameters
|
|
|
|
if test "x${ax_cv_cxx_compiler_vendor}" = "xclang" ; then
|
|
|
|
CXXFLAGS="$CXXFLAGS -Wno-address-of-temporary -Wno-unused-value -Wno-cast-align"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# extra Intel icc parameters
|
|
|
|
if test "x${ax_cv_cxx_compiler_vendor}" = "xintel" ; then
|
|
|
|
CXXFLAGS="$CXXFLAGS -diag-disable 383,981,1418,869,1563,2259,1782,444,271,1,10156,1419"
|
|
|
|
fi
|
2010-08-21 03:41:40 +03:00
|
|
|
|
2009-05-07 07:45:59 +03:00
|
|
|
# Check for Boost libraries
|
2009-05-16 20:15:21 +03:00
|
|
|
AX_BOOST_BASE([1.36])
|
2009-05-07 07:45:59 +03:00
|
|
|
AX_BOOST_SYSTEM
|
|
|
|
AX_BOOST_FILESYSTEM
|
|
|
|
AX_BOOST_THREAD
|
|
|
|
AX_BOOST_IOSTREAMS
|
2011-02-06 19:26:27 +02:00
|
|
|
AX_BOOST_PROGRAM_OPTIONS
|
2008-08-04 12:33:08 +03:00
|
|
|
|
2012-02-13 05:15:05 +03:00
|
|
|
# Check whether librt is necessary
|
|
|
|
AC_CHECK_LIB(rt, shm_open)
|
|
|
|
|
2011-11-17 03:24:27 +03:00
|
|
|
# Check for SDL - Will accept 1.2 and 1.3
|
|
|
|
AM_PATH_SDL("1.2.0", :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]))
|
2011-06-07 06:10:37 +03:00
|
|
|
|
2011-11-17 03:24:27 +03:00
|
|
|
# Check for SDL headers and libraries
|
2011-06-07 06:10:37 +03:00
|
|
|
AC_CHECK_HEADERS([SDL/SDL.h SDL/SDL_mixer.h SDL/SDL_image.h SDL/SDL_ttf.h], [], [AC_MSG_ERROR([Header not found. Install missing devel package.])])
|
|
|
|
|
|
|
|
AC_CHECK_LIB(SDL,SDL_Init,,AC_MSG_ERROR([SDL library not found. Please install it.]))
|
2008-08-04 12:33:08 +03:00
|
|
|
AC_CHECK_LIB(SDL_mixer,main,,AC_MSG_ERROR([SDL_mixer library not found. Please install it.]))
|
|
|
|
AC_CHECK_LIB(SDL_image,IMG_Load,,AC_MSG_ERROR([SDL_image library not found. Please install it.]))
|
|
|
|
AC_CHECK_LIB(SDL_ttf,main,,AC_MSG_ERROR([SDL_ttf library not found. Please install it.]))
|
|
|
|
|
2009-06-20 04:40:52 +03:00
|
|
|
# Check for ffmpeg libraries
|
2009-08-29 18:52:29 +03:00
|
|
|
saved_LIBS=$LIBS
|
2011-06-07 06:10:37 +03:00
|
|
|
saved_CFLAGS=$CFLAGS
|
|
|
|
|
2011-06-10 02:41:52 +03:00
|
|
|
FFMPEG_CXXFLAGS=""
|
|
|
|
FFMPEG_LIBS=
|
2011-06-07 06:10:37 +03:00
|
|
|
|
2011-10-06 04:11:23 +03:00
|
|
|
LIBS="$LIBS `pkg-config --libs libavcodec libavformat libavutil libswscale`"
|
2011-06-15 04:35:25 +03:00
|
|
|
CFLAGS="$CFLAGS `pkg-config --cflags libavformat libswscale`"
|
2011-06-07 06:10:37 +03:00
|
|
|
|
2011-02-28 17:14:26 +02:00
|
|
|
AC_CHECK_LIB(avformat,av_open_input_file,,AC_MSG_ERROR([FFMpeg avformat library not found. Please install it.]))
|
|
|
|
AC_CHECK_LIB(swscale,sws_getContext,,AC_MSG_ERROR([FFMpeg swscale library not found. Please install it.]))
|
2011-04-08 07:21:41 +03:00
|
|
|
AC_CHECK_LIB(avcodec,avcodec_decode_video2,AVCODEC_DECODE_VIDEO2="-DWITH_AVCODEC_DECODE_VIDEO2",)
|
2011-07-03 18:22:14 +03:00
|
|
|
AC_CHECK_LIB(avcodec,av_register_protocol2,AV_REGISTER_PROTOCOL2="-DWITH_AV_REGISTER_PROTOCOL2",)
|
2009-08-29 18:52:29 +03:00
|
|
|
|
2011-06-10 02:41:52 +03:00
|
|
|
FFMPEG_LIBS="$LIBS"
|
2011-07-03 18:22:14 +03:00
|
|
|
FFMPEG_CXXFLAGS="$CFLAGS $AVCODEC_DECODE_VIDEO2 $AV_REGISTER_PROTOCOL2"
|
2011-06-10 02:41:52 +03:00
|
|
|
|
2009-08-29 18:52:29 +03:00
|
|
|
LIBS=$saved_LIBS
|
2011-06-07 06:10:37 +03:00
|
|
|
CFLAGS=$saved_CFLAGS
|
2009-06-20 04:40:52 +03:00
|
|
|
|
2008-08-04 12:33:08 +03:00
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
|
|
|
|
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
|
|
|
AC_CHECK_HEADERS([boost/filesystem.hpp boost/algorithm/string.hpp boost/algorithm/string/replace.hpp boost/filesystem/operations.hpp boost/assign/std/vector.hpp boost/algorithm/string/find.hpp boost/function.hpp boost/bind.hpp],,AC_MSG_ERROR([Required boost headers not found. Please install it.]))
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_CHECK_FUNCS([atexit memset pow select sqrt])
|
|
|
|
|
2011-12-14 00:23:17 +03:00
|
|
|
CXXFLAGS="$CXXFLAGS -DM_DATA_DIR=\\\"\$(pkgdatadir)\\\" -DM_BIN_DIR=\\\"\$(bindir)\\\" -DM_LIB_DIR=\\\"\$(pkglibdir)\\\""
|
2010-10-31 00:51:28 +03:00
|
|
|
|
2009-05-07 07:45:59 +03:00
|
|
|
AC_SUBST(SDL_LIBS)
|
|
|
|
AC_SUBST(SDL_CXXFLAGS)
|
2009-06-20 04:40:52 +03:00
|
|
|
AC_SUBST(FFMPEG_LIBS)
|
2009-08-29 18:52:29 +03:00
|
|
|
AC_SUBST(FFMPEG_CXXFLAGS)
|
2009-05-07 07:45:59 +03:00
|
|
|
|
2011-06-28 17:19:16 +03:00
|
|
|
VCMI_AI_LIBS_DIR="$libdir/vcmi/AI"
|
|
|
|
AC_SUBST(VCMI_AI_LIBS_DIR)
|
|
|
|
|
|
|
|
VCMI_SCRIPTING_LIBS_DIR="$libdir/vcmi/Scripting"
|
|
|
|
AC_SUBST(VCMI_SCRIPTING_LIBS_DIR)
|
|
|
|
|
2012-03-12 23:11:46 +03:00
|
|
|
AC_OUTPUT(Makefile lib/Makefile client/Makefile server/Makefile AI/FuzzyLite/Makefile AI/Makefile AI/StupidAI/Makefile AI/EmptyAI/Makefile AI/VCAI/Makefile Scripting/ERM/Makefile)
|