2008-08-04 12:33:08 +03:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.60)
|
2009-09-19 18:07:56 +03:00
|
|
|
AC_INIT(vcmi, 0.73b) # Follow NAME_VER in global.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
|
2008-08-04 12:33:08 +03:00
|
|
|
|
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
|
2009-09-25 06:48:51 +03:00
|
|
|
CXXFLAGS="-O0 -ggdb -Wall -Wcast-align -Wpointer-arith"
|
2008-08-04 12:33:08 +03:00
|
|
|
fi
|
|
|
|
|
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
|
2008-08-04 12:33:08 +03:00
|
|
|
|
2009-05-07 07:45:59 +03:00
|
|
|
# Check for SDL libraries
|
|
|
|
saved_LIBS=$LIBS
|
|
|
|
AC_CHECK_PROG(HAVE_SDL_CONFIG, sdl-config, yes, no)
|
2008-08-04 12:33:08 +03:00
|
|
|
if test "$HAVE_SDL_CONFIG" = no; then
|
|
|
|
AC_MSG_ERROR(sdl-config doesn't exist. Try to check the PATH enviroment.)
|
|
|
|
fi
|
|
|
|
|
2009-05-07 07:45:59 +03:00
|
|
|
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-05-07 07:45:59 +03:00
|
|
|
SDL_CXXFLAGS=`sdl-config --cflags`
|
|
|
|
SDL_LIBS="`sdl-config --libs` $LIBS"
|
|
|
|
LIBS=$saved_LIBS
|
|
|
|
|
2009-06-20 04:40:52 +03:00
|
|
|
# Check for ffmpeg libraries
|
2009-08-29 18:52:29 +03:00
|
|
|
saved_LIBS=$LIBS
|
2009-06-20 04:40:52 +03:00
|
|
|
AC_CHECK_LIB(avformat,main,,AC_MSG_ERROR([FFMpeg avformat library not found. Please install it.]))
|
|
|
|
AC_CHECK_LIB(swscale,main,,AC_MSG_ERROR([FFMpeg swscale library not found. Please install it.]))
|
2009-08-29 18:52:29 +03:00
|
|
|
|
|
|
|
FFMPEG_CXXFLAGS=`pkg-config --cflags libavformat libswscale`
|
|
|
|
FFMPEG_LIBS=`pkg-config --libs libavformat libswscale`
|
|
|
|
LIBS=$saved_LIBS
|
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])
|
|
|
|
|
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
|
|
|
|
2009-04-14 13:46:42 +03:00
|
|
|
AC_OUTPUT(Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/GeniusAI/Makefile AI/EmptyAI/Makefile)
|