configure.ac 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.60)
  4. AC_INIT(vcmi, VERSION)
  5. AM_INIT_AUTOMAKE
  6. AC_CONFIG_MACRO_DIR([aclocal/m4])
  7. # Checks for build toolchain
  8. AC_LANG(C++)
  9. AC_PROG_CXX
  10. AC_ENABLE_SHARED
  11. AC_DISABLE_STATIC
  12. AC_PROG_LIBTOOL
  13. AC_ARG_ENABLE(debug,
  14. [ --disable-debug turn off debugging (default=enable)],
  15. [ if test x$enableval = xyes ; then
  16. enable_debug="yes"
  17. else
  18. enable_debug="no"
  19. fi],
  20. [ enable_debug="yes" ])
  21. if test "x$GXX" = "xyes" -a "x$enable_debug" = "xyes" ; then
  22. CXXFLAGS="-O0 -ggdb -Wall -Wcast-align -Wmissing-declarations -Wpointer-arith"
  23. fi
  24. # Check for Boost libraries
  25. AX_BOOST_BASE([1.36])
  26. AX_BOOST_SYSTEM
  27. AX_BOOST_FILESYSTEM
  28. AX_BOOST_THREAD
  29. AX_BOOST_IOSTREAMS
  30. # Check for SDL libraries
  31. saved_LIBS=$LIBS
  32. AC_CHECK_PROG(HAVE_SDL_CONFIG, sdl-config, yes, no)
  33. if test "$HAVE_SDL_CONFIG" = no; then
  34. AC_MSG_ERROR(sdl-config doesn't exist. Try to check the PATH enviroment.)
  35. fi
  36. AC_CHECK_LIB(SDL, SDL_Init,,AC_MSG_ERROR([SDL library not found. Please install it.]))
  37. AC_CHECK_LIB(SDL_mixer,main,,AC_MSG_ERROR([SDL_mixer library not found. Please install it.]))
  38. AC_CHECK_LIB(SDL_image,IMG_Load,,AC_MSG_ERROR([SDL_image library not found. Please install it.]))
  39. AC_CHECK_LIB(SDL_ttf,main,,AC_MSG_ERROR([SDL_ttf library not found. Please install it.]))
  40. SDL_CXXFLAGS=`sdl-config --cflags`
  41. SDL_LIBS="`sdl-config --libs` $LIBS"
  42. LIBS=$saved_LIBS
  43. # Checks for header files.
  44. AC_HEADER_STDC
  45. AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
  46. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  47. 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.]))
  48. # Checks for library functions.
  49. AC_CHECK_FUNCS([atexit memset pow select sqrt])
  50. AC_SUBST(SDL_LIBS)
  51. AC_SUBST(SDL_CXXFLAGS)
  52. AC_OUTPUT(Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/GeniusAI/Makefile AI/EmptyAI/Makefile)