configure.ac 2.0 KB

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