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.
 
 
 

574 lines
18 KiB

  1. dnl configure script for Lol Engine
  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([subdir-objects no-define tar-ustar silent-rules])
  7. dnl AM_MAINTAINER_MODE
  8. AM_DEFAULT_VERBOSITY=0
  9. dnl Versioning of the separate software we ship
  10. LOLUNIT_VERSION=0.1
  11. AC_SUBST(LOLUNIT_VERSION)
  12. LOLREMEZ_VERSION=0.2
  13. AC_SUBST(LOLREMEZ_VERSION)
  14. AC_CONFIG_HEADER(config.h)
  15. AM_PROG_CC_C_O
  16. AC_PROG_CPP
  17. AC_PROG_CXX
  18. AC_PROG_CXXCPP
  19. AC_PROG_RANLIB
  20. dnl Check that the C++ compiler really works
  21. AC_LANG_PUSH(C++)
  22. AC_MSG_CHECKING(for a fully working C++ compiler)
  23. AC_TRY_LINK([], [],
  24. [AC_MSG_RESULT(yes)],
  25. [AC_MSG_RESULT(no)
  26. AC_MSG_ERROR([[C++ compiler cannot link executables]])])
  27. AC_LANG_POP(C++)
  28. dnl C++11 mode. Checked early so that we don't run into surprises.
  29. LOL_TRY_CXXFLAGS(-std=c++11,
  30. [AM_CXXFLAGS="${AM_CXXFLAGS} -std=c++11"
  31. CXXFLAGS="${CXXFLAGS} -std=c++11"])
  32. LOL_TRY_CXXFLAGS(-std=c++0x,
  33. [AM_CXXFLAGS="${AM_CXXFLAGS} -std=c++0x"
  34. CXXFLAGS="${CXXFLAGS} -std=c++0x"])
  35. AC_LANG_PUSH(C++)
  36. AC_MSG_CHECKING(for C++11 enum class support)
  37. AC_TRY_LINK([], [enum class Foo : int { Bar, Baz };],
  38. [AC_MSG_RESULT(yes)],
  39. [AC_MSG_RESULT(no)
  40. AC_MSG_ERROR([[C++ compiler does not support C++11 enum classes]])])
  41. AC_LANG_POP(C++)
  42. AC_LIBTOOL_WIN32_DLL
  43. AM_PROG_LIBTOOL
  44. AC_LIBTOOL_CXX
  45. AC_C_CONST
  46. AC_C_INLINE
  47. dnl Ensure an error is thrown if pkg-config M4 files are not found.
  48. m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
  49. m4_pattern_forbid([^PKG_CHECK_MODULES$])
  50. m4_pattern_forbid([^PKG_PROG_PKG_CONFIG$])
  51. dnl Same for Lol Engine M4 files.
  52. m4_pattern_forbid([^LOL_])
  53. dnl Do not use PKG_CONFIG_LIBDIR when cross-compiling.
  54. if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
  55. export PKG_CONFIG_LIBDIR=/dev/null
  56. fi
  57. dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
  58. dnl now otherwise it might be set in an obscure if statement. Same thing for
  59. dnl PKG_PROG_PKG_CONFIG which needs to be called first.
  60. AC_EGREP_CPP(yes, foo)
  61. PKG_PROG_PKG_CONFIG()
  62. dnl Check for a working implementation of sed
  63. AC_PROG_SED
  64. AC_MSG_CHECKING(for a sed that understands \t)
  65. if test "$(echo 'x\x' | "${SED}" 's/.*@<:@^x\t@:>@//')" != x; then
  66. AC_MSG_RESULT(no)
  67. AC_MSG_ERROR([[consider installing GNU sed]])
  68. else
  69. AC_MSG_RESULT(yes)
  70. fi
  71. dnl conditional builds
  72. AC_ARG_ENABLE(debug,
  73. [ --enable-debug build debug versions of the game (default no)])
  74. AC_ARG_ENABLE(release,
  75. [ --enable-release build final release of the game (default no)])
  76. AC_ARG_ENABLE(experimental,
  77. [ --enable-experimental experimental build (default no)])
  78. AC_ARG_ENABLE(doc,
  79. [ --enable-doc build documentation (needs doxygen and LaTeX)])
  80. dnl Common C headers
  81. AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h math.h)
  82. AC_CHECK_HEADERS(fastmath.h pthread.h libutil.h util.h pty.h glob.h unistd.h io.h)
  83. AC_CHECK_HEADERS(execinfo.h)
  84. AC_CHECK_HEADERS(sys/ioctl.h sys/ptrace.h sys/stat.h sys/syscall.h sys/user.h)
  85. AC_CHECK_HEADERS(sys/wait.h sys/time.h sys/types.h)
  86. AC_CHECK_HEADERS(linux/kdev_t.h linux/major.h)
  87. AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h)
  88. AC_CHECK_HEADERS(pam/pam_appl.h pam/pam_misc.h)
  89. dnl Common C++ headers
  90. AC_LANG_PUSH(C++)
  91. AC_CHECK_HEADERS(cxxabi.h)
  92. AC_LANG_POP(C++)
  93. dnl Common C functions
  94. AC_CHECK_FUNCS(getenv system tmpfile tmpnam getcwd _getcwd getlogin)
  95. AC_CHECK_FUNCS(backtrace_symbols)
  96. AC_CHECK_FUNCS(gettimeofday usleep)
  97. dnl Build mode
  98. ac_cv_my_build_mode="devel"
  99. if test "x${enable_release}" = "xyes"; then
  100. ac_cv_my_build_mode="release"
  101. fi
  102. if test "x${enable_devel}" = "xyes"; then
  103. ac_cv_my_build_mode="devel"
  104. fi
  105. if test "x${enable_debug}" = "xyes"; then
  106. ac_cv_my_build_mode="debug"
  107. fi
  108. if test "x${ac_cv_my_build_mode}" = "xdebug"; then
  109. AC_DEFINE(LOL_BUILD_DEBUG, 1, Define to 1 to activate debug build)
  110. LOL_TRY_CXXFLAGS(-O, [AM_CXXFLAGS="${AM_CXXFLAGS} -O"])
  111. LOL_TRY_CXXFLAGS(-g, [AM_CXXFLAGS="${AM_CXXFLAGS} -g"])
  112. elif test "x${ac_cv_my_build_mode}" = "xdevel"; then
  113. AC_DEFINE(LOL_BUILD_DEVEL, 1, Define to 1 to activate development build)
  114. LOL_TRY_CXXFLAGS(-Os, [AM_CXXFLAGS="${AM_CXXFLAGS} -Os"])
  115. LOL_TRY_CXXFLAGS(-g, [AM_CXXFLAGS="${AM_CXXFLAGS} -g"])
  116. LOL_TRY_CXXFLAGS(-ffast-math, [AM_CXXFLAGS="${AM_CXXFLAGS} -ffast-math"])
  117. else
  118. AC_DEFINE(LOL_BUILD_RELEASE, 1, Define to 1 to activate final release)
  119. LOL_TRY_CXXFLAGS(-Os, [AM_CXXFLAGS="${AM_CXXFLAGS} -Os"])
  120. LOL_TRY_CXXFLAGS(-ffast-math, [AM_CXXFLAGS="${AM_CXXFLAGS} -ffast-math"])
  121. LOL_TRY_CXXFLAGS(-fomit-frame-pointer, [AM_CXXFLAGS="${AM_CXXFLAGS} -fomit-frame-pointer"])
  122. LOL_TRY_CXXFLAGS(-fno-strength-reduce, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-strength-reduce"])
  123. fi
  124. dnl Build documentation?
  125. DOXYGEN="no"
  126. LATEX="no"
  127. if test "${enable_doc}" != "no"; then
  128. AC_PATH_PROG(DOXYGEN, doxygen, no)
  129. if test "${DOXYGEN}" != "no"; then
  130. # Build LaTeX documentation?
  131. AC_PATH_PROG(LATEX, pdflatex, no)
  132. AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
  133. AC_PATH_PROG(DVIPS, dvips, no)
  134. if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then
  135. LATEX="no"
  136. fi
  137. if test "${LATEX}" != "no"; then
  138. AC_MSG_CHECKING(for a4.sty and a4wide.sty)
  139. if "${KPSEWHICH}" a4.sty >/dev/null 2>&1; then
  140. if "${KPSEWHICH}" a4wide.sty >/dev/null 2>&1; then
  141. AC_MSG_RESULT(yes)
  142. else
  143. LATEX="no"
  144. AC_MSG_RESULT(no)
  145. fi
  146. else
  147. LATEX="no"
  148. AC_MSG_RESULT(no)
  149. fi
  150. fi
  151. AC_PATH_PROG(DOT, dot, no)
  152. if test "${DOT}" != "no"; then
  153. USE_DOT="YES"
  154. else
  155. USE_DOT="NO"
  156. fi
  157. fi
  158. fi
  159. dnl XXX: disable LaTeX because we use too much memory
  160. LATEX=no
  161. AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
  162. AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
  163. AM_CONDITIONAL(USE_DOT, test "${DOT}" != "no")
  164. dnl Debug symbols
  165. LOL_TRY_LDFLAGS(-rdynamic, [AM_LDFLAGS="${AM_LDFLAGS} -rdynamic"])
  166. dnl Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  167. LOL_TRY_CXXFLAGS(-Wall, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wall"])
  168. LOL_TRY_CXXFLAGS(-Wextra, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wextra"])
  169. LOL_TRY_CXXFLAGS(-Wpointer-arith, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wpointer-arith"])
  170. LOL_TRY_CXXFLAGS(-Wcast-align, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wcast-align"])
  171. LOL_TRY_CXXFLAGS(-Wcast-qual, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wcast-qual"])
  172. LOL_TRY_CXXFLAGS(-Wshadow, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wshadow"])
  173. LOL_TRY_CXXFLAGS(-Wsign-compare, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wsign-compare"])
  174. LOL_TRY_CXXFLAGS(-Wstrict-overflow=1, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wstrict-overflow=1"])
  175. dnl Add these even though they're implicitly set, so that we can safely
  176. dnl remove them from within a Makefile.
  177. LOL_TRY_CXXFLAGS(-Wmaybe-uninitialized, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wmaybe-uninitialized"])
  178. LOL_TRY_CXXFLAGS(-Wnarrowing, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wnarrowing"])
  179. LOL_TRY_CXXFLAGS(-Wunused, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wunused"])
  180. LOL_TRY_CXXFLAGS(-Wstrict-aliasing, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wstrict-aliasing"])
  181. LOL_TRY_CXXFLAGS(-Wparentheses, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wparentheses"])
  182. LOL_TRY_CXXFLAGS(-Wreorder, [AM_CXXFLAGS="${AM_CXXFLAGS} -Wreorder"])
  183. dnl Disable these warnings because they're annoyingly verbose
  184. LOL_TRY_CXXFLAGS(-Wno-psabi, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wno-psabi"])
  185. AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
  186. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
  187. dnl Unix-specific libutil
  188. AC_CHECK_LIB(util, forkpty,
  189. [UTIL_LIBS="${UTIL_LIBS} -lutil"
  190. dnl Override future forkpty detection
  191. ac_cv_func_forkpty="yes"])
  192. AC_CHECK_FUNCS(forkpty)
  193. dnl GCC-specific symbol demangling
  194. AC_LANG_PUSH(C++)
  195. AC_TRY_LINK(
  196. [#include <cxxabi.h>],
  197. [abi::__cxa_demangle(NULL, 0, 0, NULL);],
  198. [AC_DEFINE(HAVE_CXA_DEMANGLE, 1, Define to 1 if abi::__cxa_demangle is available)])
  199. AC_LANG_POP(C++)
  200. dnl Are we building using MinGW?
  201. LOL_TRY_CXXFLAGS(-mwindows -mwin32,
  202. [AM_CXXFLAGS="${AM_CXXFLAGS} -mwindows -mwin32"
  203. LOL_LIBS="${LOL_LIBS} -uWinMain -u_WinMain@16"])
  204. dnl Are we building using Emscripten?
  205. ac_cv_my_have_emscripten="no"
  206. AC_CHECK_HEADERS(emscripten.h,
  207. [ac_cv_my_have_emscripten="yes"
  208. dnl XXX: activate this if memory heap is too small
  209. #AM_CXXFLAGS="${AM_CXXFLAGS} -s ALLOW_MEMORY_GROWTH=1"
  210. dnl HACK: until emcc properly adds these to EMSDK_OPTS
  211. CPPFLAGS="${CPPFLAGS} -U__i386__ -U__x86_64__ -U__i386 -U__x86_64 -Ui386 -Ux86_64"
  212. CPPFLAGS="${CPPFLAGS} -U__SSE__ -U__SSE2__ -U__MMX__ -UX87_DOUBLE_ROUNDING"
  213. CPPFLAGS="${CPPFLAGS} -UHAVE_GCC_ASM_FOR_X87 -DEMSCRIPTEN -U__STRICT_ANSI__"
  214. CPPFLAGS="${CPPFLAGS} -U__CYGWIN__"])
  215. AM_CONDITIONAL(USE_EMSCRIPTEN, test "${ac_cv_my_have_emscripten}" != "no")
  216. dnl Are we on the Xbox 360?
  217. dnl Answer: NO! we don't know how to build for it anyway
  218. AM_CONDITIONAL(USE_X360, false)
  219. dnl Are we on an OS X or iOS platform?
  220. LOL_TRY_LDFLAGS(-framework Foundation,
  221. [LOL_LIBS="${LOL_LIBS} -framework Foundation"])
  222. LOL_TRY_LDFLAGS(-framework CoreGraphics,
  223. [LOL_LIBS="${LOL_LIBS} -framework CoreGraphics"])
  224. LOL_TRY_LDFLAGS(-framework CoreData,
  225. [LOL_LIBS="${LOL_LIBS} -framework CoreData"])
  226. LOL_TRY_LDFLAGS(-framework UIKit,
  227. [LOL_LIBS="${LOL_LIBS} -framework UIKit"])
  228. dnl Are we on a Direct3D 9 platform?
  229. #ac_cv_my_have_d3d9="no"
  230. #AC_CHECK_HEADERS(d3d9.h, [ac_cv_my_have_d3d9="yes"])
  231. #if test "${ac_cv_my_have_d3d9}" != "no"; then
  232. # D3D_LIBS="${D3D_LIBS} -ld3d9 -ld3dx9 -lxinput"
  233. # AC_DEFINE(USE_D3D9, 1, Define to 1 to use DirectX 9)
  234. #fi
  235. #AM_CONDITIONAL(USE_D3D9, test "${ac_cv_my_have_d3d9}" != "no")
  236. LOL_CHECK_OPENGL
  237. LOL_CHECK_SDL
  238. dnl Use Flex's FlexLexer.h or ours?
  239. ac_cv_my_have_flexlexer_h="no"
  240. AC_LANG_PUSH(C++)
  241. AC_CHECK_HEADERS(FlexLexer.h,
  242. dnl Ensure that FlexLexer::yleng is of type int, and not size_t like
  243. dnl on recent Apple systems. It would break all our existing code.
  244. [AC_MSG_CHECKING(for FlexLexer.h validity)
  245. AC_COMPILE_IFELSE(
  246. [AC_LANG_PROGRAM([#include <FlexLexer.h>
  247. class Foo : public FlexLexer
  248. {
  249. Foo() { int &test = yyleng; }
  250. };],
  251. [])],
  252. [AC_MSG_RESULT(yes)
  253. ac_cv_my_have_flexlexer_h="yes"],
  254. [AC_MSG_RESULT(no)])])
  255. AC_LANG_POP(C++)
  256. if test "x${ac_cv_my_have_flexlexer_h}" = "xno"; then
  257. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/flex-2.5.35/include"
  258. fi
  259. dnl Use pegtl? Yes, always
  260. if true; then
  261. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/pegtl-0.32/include"
  262. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/axe-1.5.4.164/include"
  263. fi
  264. dnl Use NativeClient?
  265. ac_cv_my_have_nacl="no"
  266. AC_LANG_PUSH(C++)
  267. AC_CHECK_HEADERS(ppapi/cpp/instance.h,
  268. [ac_cv_my_have_nacl="yes"
  269. LOL_LIBS="${LOL_LIBS} -lnosys"
  270. if test "${ac_cv_my_build_mode}" = "xrelease"; then
  271. LOL_TRY_CXXFLAGS(-s, [AM_CXXFLAGS="${AM_CXXFLAGS} -s"])
  272. fi])
  273. AC_LANG_POP(C++)
  274. AM_CONDITIONAL(USE_NACL, test "${ac_cv_my_have_nacl}" != "no")
  275. dnl Use Android? FIXME: super hacks!
  276. ac_cv_my_have_android="no"
  277. AC_CHECK_LIB(log, __android_log_vprint,
  278. [ac_cv_my_have_android="yes"
  279. LOL_LIBS="${LOL_LIBS} -llog -landroid -module -lEGL -lGLESv2"])
  280. AM_CONDITIONAL(USE_ANDROID, test "${ac_cv_my_have_android}" != "no")
  281. dnl Use EGL?
  282. ac_cv_my_have_egl="no"
  283. PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:])
  284. if test "${ac_cv_my_have_egl}" != "no"; then
  285. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  286. EGL_LIBS="${EGL_LIBS} -lX11"
  287. fi
  288. AC_CHECK_LIB(EGL, main,
  289. [ac_cv_my_have_egl="yes"
  290. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  291. EGL_LIBS="-lEGL"])
  292. dnl Raspberry Pi is different, check for it with extra libs; also we
  293. dnl look for a different function to bypass autoconf caching
  294. AC_CHECK_LIB(EGL, eglGetDisplay,
  295. [ac_cv_my_have_egl="yes"
  296. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  297. EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
  298. [:],
  299. [-lvcos -lvchiq_arm -lbcm_host -lGLESv2])
  300. AM_CONDITIONAL(USE_EGL, test "${ac_cv_my_have_egl}" != "no")
  301. dnl Use libpng? (replacement for SDL_image)
  302. ac_cv_my_have_libpng="no"
  303. PKG_CHECK_MODULES(LIBPNG, libpng, [ac_cv_my_have_libpng="yes"], [:])
  304. if test "${ac_cv_my_have_libpng}" != "no"; then
  305. AC_DEFINE(USE_LIBPNG, 1, Define to 1 to use libpng)
  306. fi
  307. AM_CONDITIONAL(USE_LIBPNG, test "${ac_cv_my_have_libpng}" != "no")
  308. dnl Use Windows GDI+?
  309. ac_cv_my_have_gdiplus="no"
  310. AC_LANG_PUSH(C++)
  311. AC_CHECK_HEADERS(gdiplus.h,
  312. [ac_cv_my_have_gdiplus="yes"
  313. LOL_LIBS="${LOL_LIBS} -lgdiplus"],
  314. [ac_cv_my_have_gdiplus="no"],
  315. [#include <algorithm>
  316. using std::min;
  317. using std::max;
  318. #include <windows.h>])
  319. AC_LANG_POP(C++)
  320. if test "${ac_cv_my_have_gdiplus}" != "no"; then
  321. AC_DEFINE(USE_GDIPLUS, 1, Define to 1 to use GDI+)
  322. fi
  323. AM_CONDITIONAL(USE_GDIPLUS, test "${ac_cv_my_have_gdiplus}" = "yes")
  324. dnl Use libcaca? (required for font generation)
  325. ac_cv_my_have_caca="no"
  326. PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17, [ac_cv_my_have_caca="yes"], [:])
  327. if test "${ac_cv_my_have_caca}" != "no"; then
  328. AC_DEFINE(USE_CACA, 1, Define to 1 to use libcaca)
  329. fi
  330. AM_CONDITIONAL(USE_CACA, test "${ac_cv_my_have_caca}" != "no")
  331. # Use Imlib2?
  332. ac_cv_my_have_imlib2="no"
  333. PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
  334. if test "${ac_cv_my_have_imlib2}" != "no"; then
  335. AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
  336. LOL_CFLAGS="${LOL_CFLAGS} ${IMLIB2_CFLAGS}"
  337. LOL_LIBS="${LOL_LIBS} ${IMLIB2_LIBS}"
  338. fi
  339. AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
  340. # Use libavcodec? (required for movie encoding)
  341. ac_cv_my_have_ffmpeg="yes"
  342. PKG_CHECK_MODULES([LIBAVCODEC], [libavcodec], [:], [ac_cv_my_have_ffmpeg=no])
  343. PKG_CHECK_MODULES([LIBAVFORMAT], [libavformat], [:], [ac_cv_my_have_ffmpeg=no])
  344. PKG_CHECK_MODULES([LIBSWSCALE], [libswscale], [:], [ac_cv_my_have_ffmpeg=no])
  345. if test "${ac_cv_my_have_ffmpeg}" = "no"; then
  346. ac_cv_my_have_ffmpeg="yes"
  347. AC_CHECK_HEADERS(libavcodec/avcodec.h, [:], [ac_cv_my_have_ffmpeg=no])
  348. AC_CHECK_HEADERS(libavformat/avformat.h, [:], [ac_cv_my_have_ffmpeg=no])
  349. AC_CHECK_HEADERS(libswscale/swscale.h, [:], [ac_cv_my_have_ffmpeg=no])
  350. if test "${ac_cv_my_have_ffmpeg}" = "yes"; then
  351. LIBAVFORMAT_LIBS="-lavformat"
  352. LIBAVCODEC_LIBS="-lavcodec -lavutil"
  353. LIBSWSCALE_LIBS="-lswscale -lswresample"
  354. AC_CHECK_LIB(ws2_32, main, LOL_LIBS="${LOL_LIBS} -lws2_32")
  355. fi
  356. fi
  357. if test "${ac_cv_my_have_ffmpeg}" != "no"; then
  358. AC_DEFINE(USE_FFMPEG, 1, Define to 1 to use FFmpeg)
  359. LOL_CFLAGS="${LOL_CFLAGS} ${LIBAVFORMAT_CFLAGS} ${LIBAVCODEC_CFLAGS} ${SWSCALE_CFLAGS}"
  360. LOL_LIBS="${LOL_LIBS} ${LIBAVFORMAT_LIBS} ${LIBAVCODEC_LIBS} ${LIBSWSCALE_LIBS}"
  361. fi
  362. AM_CONDITIONAL(USE_FFMPEG, test "${ac_cv_my_have_ffmpeg}" != "no")
  363. dnl Use GTK+? (required for the deushax editor)
  364. ac_cv_my_have_gtkgl="no"
  365. PKG_CHECK_MODULES(GTK, gtk+-2.0, [ac_cv_my_have_gtkgl="yes"], [:])
  366. PKG_CHECK_MODULES(GTKGL, gtkgl-2.0, [:], [ac_cv_my_have_gtkgl="no"])
  367. if test "${ac_cv_my_have_gtkgl}" != "no"; then
  368. AC_DEFINE(USE_GTKGL, 1, Define to 1 to use GtkGl)
  369. fi
  370. AM_CONDITIONAL(USE_GTKGL, test "${ac_cv_my_have_gtkgl}" != "no")
  371. dnl Can we build neercs?
  372. AM_CONDITIONAL(BUILD_NEERCS, test "${ac_cv_my_have_caca}" != "no")
  373. dnl Should we ship non-free data?
  374. AM_CONDITIONAL(HAVE_NONFREE, true)
  375. dnl Extra libraries we may need
  376. AC_SUBST(MATH_LIBS)
  377. AC_SUBST(PAM_LIBS)
  378. AC_SUBST(UTIL_LIBS)
  379. dnl How to use the Lol Engine outside this tree
  380. LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS"
  381. LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS"
  382. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/liblolcore.a"
  383. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/bullet/liblolbullet.a"
  384. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/lua/liblollua.a"
  385. dnl How to use the Lol Engine inside this tree
  386. AM_CPPFLAGS="${AM_CPPFLAGS} -I\$(top_srcdir)/src"
  387. AM_CPPFLAGS="${AM_CPPFLAGS} -DLOL_CONFIG_SOURCESUBDIR=\\\"\$(subdir)\\\""
  388. AM_CPPFLAGS="${AM_CPPFLAGS} ${LOL_CFLAGS}"
  389. AM_LDFLAGS="${AM_LDFLAGS} ${LOL_DEPS}"
  390. AM_LDFLAGS="${AM_LDFLAGS} ${LOL_LIBS}"
  391. dnl Extra flags
  392. AC_SUBST(LOL_CFLAGS)
  393. AC_SUBST(LOL_LIBS)
  394. AC_SUBST(LOL_DEPS)
  395. AC_SUBST(AM_CFLAGS)
  396. AC_SUBST(AM_CPPFLAGS)
  397. AC_SUBST(AM_CXXFLAGS)
  398. AC_SUBST(AM_LDFLAGS)
  399. AC_SUBST(USE_DOT)
  400. AC_CONFIG_FILES(
  401. [Makefile
  402. src/Makefile
  403. src/bullet/Makefile
  404. src/lua/Makefile
  405. src/imgui/Makefile
  406. src/data/Makefile
  407. src/data/font/Makefile
  408. src/t/Makefile
  409. build/Makefile
  410. binaries/Makefile
  411. people/Makefile
  412. games/Makefile
  413. demos/Makefile
  414. tools/Makefile
  415. tools/vimlol/Makefile
  416. tools/vslol/Makefile
  417. doc/Makefile
  418. doc/doxygen.cfg
  419. doc/samples/Makefile
  420. doc/samples/math/Makefile
  421. doc/samples/sandbox/Makefile
  422. doc/tutorial/Makefile
  423. ])
  424. AC_CONFIG_FILES(
  425. [games/monsterz/Makefile
  426. ])
  427. AC_CONFIG_FILES(
  428. [games/deushax/Makefile
  429. games/deushax/art/Makefile
  430. games/deushax/art/test/Makefile
  431. games/deushax/gfx/Makefile
  432. games/deushax/maps/Makefile
  433. ])
  434. AC_CONFIG_FILES(
  435. [games/mrpigeon/Makefile
  436. ])
  437. AC_CONFIG_FILES(
  438. [games/orbital/Makefile
  439. ])
  440. AC_CONFIG_FILES(
  441. [games/abuse/Makefile
  442. games/abuse/src/Makefile
  443. games/abuse/data/Makefile
  444. games/abuse/doc/Makefile
  445. games/abuse/doc/abuse.6
  446. games/abuse/doc/abuse-tool.6
  447. ])
  448. AC_CONFIG_FILES(
  449. [games/singlshot/Makefile
  450. ])
  451. AC_CONFIG_FILES(
  452. [demos/lol.js/Makefile
  453. ])
  454. AC_CONFIG_FILES(
  455. [tools/lolremez/Makefile
  456. tools/lolunit/Makefile
  457. tools/neercs/Makefile
  458. tools/pimp/Makefile
  459. ])
  460. AC_CONFIG_FILES(
  461. [people/jnat/Makefile
  462. people/jnat/TestProject/Makefile
  463. people/peeweek/Makefile
  464. people/benlitz/Makefile
  465. people/benlitz/test1/Makefile
  466. people/benlitz/voxel/Makefile
  467. people/benlitz/lolui/Makefile
  468. people/touky/Makefile
  469. people/touky/shared/Makefile
  470. people/touky/sprite_sorter/Makefile
  471. people/touky/squad_shooter/Makefile
  472. people/touky/top_shooter/Makefile
  473. people/touky/touky_demo/Makefile
  474. people/touky/tactics/Makefile
  475. people/touky/the_unfortunate_voronoid/Makefile
  476. people/touky/workbench/Makefile
  477. people/jylam/Makefile
  478. people/jylam/private/Makefile
  479. people/jylam/private/chat/Makefile
  480. people/jylam/private/lander/Makefile
  481. people/jylam/private/oric_convert/Makefile
  482. people/sam/Makefile
  483. people/sam/ld27/Makefile
  484. people/sam/vip2014/Makefile
  485. people/sam/kanagawa/Makefile
  486. people/sam/sapp/Makefile
  487. ])
  488. AC_OUTPUT