選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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