configure.ac 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_HEADER([config.h])
  7. # Checks for programs.
  8. AC_PROG_CXX
  9. AC_PROG_CXX
  10. AC_PROG_CC
  11. AX_BOOST_BASE([1.37])
  12. AX_BOOST_SYSTEM
  13. AX_BOOST_FILESYSTEM
  14. AX_BOOST_THREAD
  15. AC_PROG_CPP
  16. AC_ENABLE_SHARED
  17. AC_DISABLE_STATIC
  18. AC_PROG_LIBTOOL
  19. CFLAGS="-g"
  20. CXXFLAGS="-O1 -ggdb -Wall"
  21. AC_CHECK_LIB([stdc++], [main])
  22. if test "x$GCC" = "xyes"; then
  23. stdcxx_name=`$CXX -print-file-name=libstdc++.so`
  24. stdcxx_path=`dirname $stdcxx_name`
  25. LIBS="-L$stdcxx_path $LIBS"
  26. fi
  27. AC_CHECK_PROG(HAVE_SDL_CONFIG, sdl-config, yes, no)
  28. # Checks for libraries.
  29. if test "$HAVE_SDL_CONFIG" = no; then
  30. AC_MSG_ERROR(sdl-config doesn't exist. Try to check the PATH enviroment.)
  31. else
  32. AC_CHECK_LIB(SDL, SDL_Init,SDL_CFLAGS=`sdl-config --cflags`
  33. SDL_LIBS=`sdl-config --libs`)
  34. fi
  35. LIBS="$LIBS $SDL_LIBS"
  36. CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
  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. # Checks for header files.
  41. AC_HEADER_STDC
  42. AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
  43. AC_LANG_PUSH(C++)
  44. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  45. 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.]))
  46. AC_LANG_POP(C++)
  47. # Checks for typedefs, structures, and compiler characteristics.
  48. AC_HEADER_STDBOOL
  49. AC_C_CONST
  50. AC_C_INLINE
  51. # Checks for library functions.
  52. AC_FUNC_ALLOCA
  53. AC_FUNC_MALLOC
  54. AC_FUNC_SELECT_ARGTYPES
  55. AC_CHECK_FUNCS([atexit memset pow select sqrt])
  56. AC_OUTPUT(Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/GeniusAI/Makefile)