You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

121 lines
3.2 KiB

  1. # $Id$
  2. AC_INIT(lolengine, 0.0)
  3. AC_PREREQ(2.50)
  4. AC_CONFIG_AUX_DIR(.auto)
  5. AC_CANONICAL_SYSTEM
  6. AM_INIT_AUTOMAKE([no-define tar-ustar])
  7. dnl AM_MAINTAINER_MODE
  8. AM_CONFIG_HEADER(config.h)
  9. AM_PROG_CC_C_O
  10. AC_PROG_CPP
  11. AC_PROG_CXX
  12. AC_PROG_CXXCPP
  13. AC_PROG_RANLIB
  14. AC_LIBTOOL_WIN32_DLL
  15. AM_PROG_LIBTOOL
  16. AC_LIBTOOL_CXX
  17. AC_C_CONST
  18. AC_C_INLINE
  19. dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
  20. dnl now otherwise it might be set in an obscure if statement. Same thing for
  21. dnl PKG_PROG_PKG_CONFIG which needs to be called first.
  22. AC_EGREP_CPP(yes, foo)
  23. PKG_PROG_PKG_CONFIG()
  24. m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
  25. if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
  26. export PKG_CONFIG_LIBDIR=/dev/null
  27. fi
  28. dnl conditional builds
  29. AC_ARG_ENABLE(debug,
  30. [ --enable-debug build debug versions of the game (default no)])
  31. AC_ARG_ENABLE(release,
  32. [ --enable-release build final release of the game (default no)])
  33. AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
  34. if test "${enable_debug}" = "yes"; then
  35. AC_DEFINE(_DEBUG, 1, Define to 1 to activate debug)
  36. fi
  37. # Optimizations
  38. CXXFLAGS="${CXXFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  39. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  40. CXXFLAGS="${CXXFLAGS} -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare"
  41. AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
  42. # Use SDL?
  43. ac_cv_my_have_sdl="yes"
  44. save_CPPFLAGS="${CPPFLAGS}"
  45. AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
  46. if test "${SDL_CONFIG}" != "no"; then
  47. CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
  48. fi
  49. AC_CHECK_HEADERS(SDL_image.h,
  50. [:],[ac_cv_my_have_sdl="no"])
  51. AC_CHECK_HEADERS(SDL_mixer.h,
  52. [:],[ac_cv_my_have_sdl="no"])
  53. CPPFLAGS="${save_CPPFLAGS}"
  54. if test "${ac_cv_my_have_sdl}" != "no"; then
  55. AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
  56. fi
  57. AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
  58. if test "${ac_cv_my_have_sdl}" = "no"; then
  59. AC_MSG_ERROR([[One of SDL, SDL_Image or SDL_Mixer not found]])
  60. fi
  61. # Use libcaca? (required for font generation)
  62. ac_cv_my_have_caca="no"
  63. PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17, [ac_cv_my_have_caca="yes"], [:])
  64. if test "${ac_cv_my_have_caca}" != "no"; then
  65. AC_DEFINE(USE_CACA, 1, Define to 1 to use libcaca)
  66. fi
  67. AM_CONDITIONAL(USE_CACA, test "${ac_cv_my_have_caca}" != "no")
  68. # Use libpipi? (required for video recording)
  69. ac_cv_my_have_pipi="no"
  70. PKG_CHECK_MODULES(PIPI, pipi, [ac_cv_my_have_pipi="yes"], [:])
  71. if test "${ac_cv_my_have_pipi}" != "no"; then
  72. AC_DEFINE(USE_PIPI, 1, Define to 1 to use libpipi)
  73. fi
  74. AM_CONDITIONAL(USE_PIPI, test "${ac_cv_my_have_pipi}" != "no")
  75. # How to use the Lol Engine inside this tree
  76. LOL_CFLAGS="-I \$(top_srcdir)/src `pkg-config --cflags sdl gl SDL_image`"
  77. LOL_LIBS="`pkg-config --libs sdl gl SDL_image` -lSDL_mixer"
  78. if test "${enable_release}" = "yes"; then
  79. AC_DEFINE(FINAL_RELEASE, 1, Define to 1 to activate final release)
  80. fi
  81. AC_SUBST(MATH_LIBS)
  82. AC_SUBST(LOL_CFLAGS)
  83. AC_SUBST(LOL_LIBS)
  84. AC_CONFIG_FILES([
  85. Makefile
  86. src/Makefile
  87. monsterz/Makefile
  88. deushax/Makefile
  89. tools/Makefile
  90. art/Makefile
  91. art/test/Makefile
  92. gfx/Makefile
  93. gfx/font/Makefile
  94. maps/Makefile
  95. ])
  96. AC_OUTPUT