Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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