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

581 строка
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. 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. CFLAGS=""
  92. LDFLAGS=""
  93. CXXFLAGS=""
  94. fi
  95. if test "x${enable_devel}" = "xyes"; then
  96. ac_cv_my_build_mode="devel"
  97. CFLAGS=""
  98. LDFLAGS=""
  99. CXXFLAGS=""
  100. fi
  101. if test "x${enable_debug}" = "xyes"; then
  102. ac_cv_my_build_mode="debug"
  103. CFLAGS=""
  104. LDFLAGS=""
  105. CXXFLAGS=""
  106. fi
  107. if test "x${ac_cv_my_build_mode}" = "xdebug"; then
  108. AC_DEFINE(LOL_BUILD_DEBUG, 1, Define to 1 to activate debug build)
  109. LOL_TRY_CXXFLAGS(-O, [AM_CXXFLAGS="${AM_CXXFLAGS} -O"])
  110. LOL_TRY_CXXFLAGS(-g, [AM_CXXFLAGS="${AM_CXXFLAGS} -g"])
  111. elif test "x${ac_cv_my_build_mode}" = "xdevel"; then
  112. AC_DEFINE(LOL_BUILD_DEVEL, 1, Define to 1 to activate development build)
  113. LOL_TRY_CXXFLAGS(-Os, [AM_CXXFLAGS="${AM_CXXFLAGS} -Os"])
  114. LOL_TRY_CXXFLAGS(-g, [AM_CXXFLAGS="${AM_CXXFLAGS} -g"])
  115. LOL_TRY_CXXFLAGS(-ffast-math, [AM_CXXFLAGS="${AM_CXXFLAGS} -ffast-math"])
  116. else
  117. AC_DEFINE(LOL_BUILD_RELEASE, 1, Define to 1 to activate final release)
  118. LOL_TRY_CXXFLAGS(-Os, [AM_CXXFLAGS="${AM_CXXFLAGS} -Os"])
  119. LOL_TRY_CXXFLAGS(-ffast-math, [AM_CXXFLAGS="${AM_CXXFLAGS} -ffast-math"])
  120. dnl Removed this so .nexe build ok.
  121. dnl LOL_TRY_CXXFLAGS(-fomit-frame-pointer, [AM_CXXFLAGS="${AM_CXXFLAGS} -fomit-frame-pointer"])
  122. dnl 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 No exceptions
  165. LOL_TRY_CXXFLAGS(-fno-exceptions, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"])
  166. LOL_TRY_CXXFLAGS(-fno-rtti, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"])
  167. dnl Debug symbols
  168. LOL_TRY_LDFLAGS(-rdynamic, [AM_LDFLAGS="${AM_LDFLAGS} -rdynamic"])
  169. dnl Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  170. LOL_TRY_CXXFLAGS(-Wall, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wall"])
  171. LOL_TRY_CXXFLAGS(-Wextra, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wextra"])
  172. LOL_TRY_CXXFLAGS(-Wpointer-arith, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wpointer-arith"])
  173. LOL_TRY_CXXFLAGS(-Wcast-align, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wcast-align"])
  174. LOL_TRY_CXXFLAGS(-Wcast-qual, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wcast-qual"])
  175. LOL_TRY_CXXFLAGS(-Wshadow, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wshadow"])
  176. LOL_TRY_CXXFLAGS(-Wsign-compare, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wsign-compare"])
  177. dnl Add these even though they're implicitly set, so that we can safely
  178. dnl remove them from within a Makefile.
  179. LOL_TRY_CXXFLAGS(-Wmaybe-uninitialized, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wmaybe-uninitialized"])
  180. LOL_TRY_CXXFLAGS(-Wnarrowing, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wnarrowing"])
  181. LOL_TRY_CXXFLAGS(-Wunused, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wunused"])
  182. LOL_TRY_CXXFLAGS(-Wstrict-aliasing, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wstrict-aliasing"])
  183. LOL_TRY_CXXFLAGS(-Wparentheses, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wparentheses"])
  184. LOL_TRY_CXXFLAGS(-Wreorder, [AM_CXXFLAGS="${AM_CXXFLAGS} -Wreorder"])
  185. dnl Disable these warnings because they're annoyingly verbose
  186. LOL_TRY_CXXFLAGS(-Wno-psabi, [AM_CPPFLAGS="${AM_CXXFLAGS} -Wno-psabi"])
  187. AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
  188. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
  189. dnl Unix-specific libutil
  190. AC_CHECK_LIB(util, forkpty,
  191. [UTIL_LIBS="${UTIL_LIBS} -lutil"
  192. dnl Override future forkpty detection
  193. ac_cv_func_forkpty="yes"])
  194. AC_CHECK_FUNCS(forkpty)
  195. dnl GCC-specific symbol demangling
  196. AC_LANG_PUSH(C++)
  197. AC_TRY_LINK(
  198. [#include <cxxabi.h>],
  199. [abi::__cxa_demangle(NULL, 0, 0, NULL);],
  200. [AC_DEFINE(HAVE_CXA_DEMANGLE, 1, Define to 1 if abi::__cxa_demangle is available)])
  201. AC_LANG_POP(C++)
  202. dnl Are we on the PS3?
  203. ac_cv_my_have_ps3="no"
  204. AC_CHECK_LIB(sysmodule_stub, cellSysmoduleLoadModule,
  205. [ac_cv_my_have_ps3="yes"
  206. LOL_LIBS="${LOL_LIBS} -lsysmodule_stub -lsysutil_stub -lresc_stub"
  207. dnl For PSGL
  208. AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available) # FIXME: hack
  209. GL_LIBS="${GL_LIBS} -lPSGL -lgcm_cmd -lgcm_sys_stub"
  210. dnl This is the old way; we now use CELL_SDK instead of CELLSDK
  211. if test "x${CELLSDK}" != x -a "x${CELL_SDK}" = x; then
  212. CELL_SDK="${CELLSDK}"
  213. fi
  214. if test "x${enable_debug}" = xyes; then
  215. GL_LIBS="${GL_LIBS} -L${CELL_SDK}/target/ppu/lib/PSGL/RSX/debug"
  216. elif test "x${enable_release}" = xyes; then
  217. GL_LIBS="${GL_LIBS} -L${CELL_SDK}/target/ppu/lib/PSGL/RSX/ultra-opt"
  218. else
  219. GL_LIBS="${GL_LIBS} -L${CELL_SDK}/target/ppu/lib/PSGL/RSX/opt"
  220. fi
  221. dnl For the runtime Cg compiler
  222. GL_LIBS="${GL_LIBS} -lcgc -lPSGLcgc"
  223. dnl For the PNG decoder
  224. LOL_LIBS="${LOL_LIBS} -lpngdec_stub"
  225. dnl For the pad library
  226. LOL_LIBS="${LOL_LIBS} -lio_stub -lusbd_stub -lpadfilter"
  227. dnl For the audio library
  228. LOL_LIBS="${LOL_LIBS} -laudio_stub -lspurs_stub -lmstreamSPURSMP3"
  229. dnl For the filesystem support
  230. LOL_LIBS="${LOL_LIBS} -lfs_stub"
  231. dnl Disable this warning, it's too verbose with vector.h
  232. AM_CXXFLAGS="${AM_CXXFLAGS} -Wno-sign-compare"
  233. AC_PATH_PROG(MAKE_FSELF, make_fself, no)
  234. if test "${MAKE_FSELF}" = "no"; then
  235. AC_MSG_ERROR([[Building for PS3 but make_fself not found]])
  236. fi],
  237. [MAKE_FSELF=no])
  238. AM_CONDITIONAL(USE_PS3, test "${ac_cv_my_have_ps3}" != "no")
  239. dnl Are we building using MinGW?
  240. LOL_TRY_CXXFLAGS(-mwindows -mwin32,
  241. [AM_CXXFLAGS="${AM_CXXFLAGS} -mwindows -mwin32"
  242. LOL_LIBS="${LOL_LIBS} -uWinMain -u_WinMain@16"])
  243. dnl Are we building using Emscripten?
  244. ac_cv_my_have_emscripten="no"
  245. AC_CHECK_HEADERS(emscripten.h,
  246. [ac_cv_my_have_emscripten="yes"
  247. dnl XXX: activate this if memory heap is too small
  248. #AM_CXXFLAGS="${AM_CXXFLAGS} -s ALLOW_MEMORY_GROWTH=1"
  249. dnl HACK: until emcc properly adds these to EMSDK_OPTS
  250. CPPFLAGS="${CPPFLAGS} -U__i386__ -U__x86_64__ -U__i386 -U__x86_64 -Ui386 -Ux86_64"
  251. CPPFLAGS="${CPPFLAGS} -U__SSE__ -U__SSE2__ -U__MMX__ -UX87_DOUBLE_ROUNDING"
  252. CPPFLAGS="${CPPFLAGS} -UHAVE_GCC_ASM_FOR_X87 -DEMSCRIPTEN -U__STRICT_ANSI__"
  253. CPPFLAGS="${CPPFLAGS} -U__CYGWIN__"])
  254. AM_CONDITIONAL(USE_EMSCRIPTEN, test "${ac_cv_my_have_emscripten}" != "no")
  255. dnl Are we on the Xbox 360?
  256. dnl Answer: NO! we don't know how to build for it anyway
  257. AM_CONDITIONAL(USE_X360, false)
  258. dnl Are we on an OS X or iOS platform?
  259. LOL_TRY_LDFLAGS(-framework Foundation,
  260. [LOL_LIBS="${LOL_LIBS} -framework Foundation"])
  261. LOL_TRY_LDFLAGS(-framework CoreGraphics,
  262. [LOL_LIBS="${LOL_LIBS} -framework CoreGraphics"])
  263. LOL_TRY_LDFLAGS(-framework CoreData,
  264. [LOL_LIBS="${LOL_LIBS} -framework CoreData"])
  265. LOL_TRY_LDFLAGS(-framework UIKit,
  266. [LOL_LIBS="${LOL_LIBS} -framework UIKit"])
  267. dnl Are we on a Direct3D 9 platform?
  268. #ac_cv_my_have_d3d9="no"
  269. #AC_CHECK_HEADERS(d3d9.h, [ac_cv_my_have_d3d9="yes"])
  270. #if test "${ac_cv_my_have_d3d9}" != "no"; then
  271. # D3D_LIBS="${D3D_LIBS} -ld3d9 -ld3dx9 -lxinput"
  272. # AC_DEFINE(USE_D3D9, 1, Define to 1 to use DirectX 9)
  273. #fi
  274. #AM_CONDITIONAL(USE_D3D9, test "${ac_cv_my_have_d3d9}" != "no")
  275. LOL_CHECK_OPENGL
  276. LOL_CHECK_SDL
  277. dnl Use Flex's FlexLexer.h or ours?
  278. ac_cv_my_have_flexlexer_h="no"
  279. AC_LANG_PUSH(C++)
  280. AC_CHECK_HEADERS(FlexLexer.h,
  281. dnl Ensure that FlexLexer::yleng is of type int, and not size_t like
  282. dnl on recent Apple systems. It would break all our existing code.
  283. [AC_MSG_CHECKING(for FlexLexer.h validity)
  284. AC_COMPILE_IFELSE(
  285. [AC_LANG_PROGRAM([#include <FlexLexer.h>
  286. class Foo : public FlexLexer
  287. {
  288. Foo() { int &test = yyleng; }
  289. };],
  290. [])],
  291. [AC_MSG_RESULT(yes)
  292. ac_cv_my_have_flexlexer_h="yes"],
  293. [AC_MSG_RESULT(no)])])
  294. AC_LANG_POP(C++)
  295. if test "x${ac_cv_my_have_flexlexer_h}" = "xno"; then
  296. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/flex-2.5.35/include"
  297. fi
  298. dnl Use NativeClient?
  299. ac_cv_my_have_nacl="no"
  300. AC_LANG_PUSH(C++)
  301. AC_CHECK_HEADERS(ppapi/cpp/instance.h,
  302. [ac_cv_my_have_nacl="yes"
  303. LOL_LIBS="${LOL_LIBS} -lnosys"
  304. if test "${ac_cv_my_build_mode}" = "xrelease"; then
  305. LOL_TRY_CXXFLAGS(-s, [AM_CXXFLAGS="${AM_CXXFLAGS} -s"])
  306. fi])
  307. AC_LANG_POP(C++)
  308. AM_CONDITIONAL(USE_NACL, test "${ac_cv_my_have_nacl}" != "no")
  309. dnl Use Android? FIXME: super hacks!
  310. ac_cv_my_have_android="no"
  311. AC_CHECK_LIB(log, __android_log_vprint,
  312. [ac_cv_my_have_android="yes"
  313. LOL_LIBS="${LOL_LIBS} -llog -landroid -module -lEGL -lGLESv2"])
  314. AM_CONDITIONAL(USE_ANDROID, test "${ac_cv_my_have_android}" != "no")
  315. dnl Use EGL?
  316. ac_cv_my_have_egl="no"
  317. PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:])
  318. if test "${ac_cv_my_have_egl}" != "no"; then
  319. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  320. EGL_LIBS="${EGL_LIBS} -lX11"
  321. fi
  322. AC_CHECK_LIB(EGL, main,
  323. [ac_cv_my_have_egl="yes"
  324. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  325. EGL_LIBS="-lEGL"])
  326. dnl Raspberry Pi is different, check for it with extra libs; also we
  327. dnl look for a different function to bypass autoconf caching
  328. AC_CHECK_LIB(EGL, eglGetDisplay,
  329. [ac_cv_my_have_egl="yes"
  330. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  331. EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
  332. [:],
  333. [-lvcos -lvchiq_arm -lbcm_host -lGLESv2])
  334. AM_CONDITIONAL(USE_EGL, test "${ac_cv_my_have_egl}" != "no")
  335. dnl Use libpng? (replacement for SDL_image)
  336. ac_cv_my_have_libpng="no"
  337. PKG_CHECK_MODULES(LIBPNG, libpng, [ac_cv_my_have_libpng="yes"], [:])
  338. if test "${ac_cv_my_have_libpng}" != "no"; then
  339. AC_DEFINE(USE_LIBPNG, 1, Define to 1 to use libpng)
  340. fi
  341. AM_CONDITIONAL(USE_LIBPNG, test "${ac_cv_my_have_libpng}" != "no")
  342. dnl Use Windows GDI+?
  343. ac_cv_my_have_gdiplus="no"
  344. AC_LANG_PUSH(C++)
  345. AC_CHECK_HEADERS(gdiplus.h,
  346. [ac_cv_my_have_gdiplus="yes"
  347. LOL_LIBS="${LOL_LIBS} -lgdiplus"],
  348. [ac_cv_my_have_gdiplus="no"],
  349. [#include <algorithm>
  350. using std::min;
  351. using std::max;
  352. #include <windows.h>])
  353. AC_LANG_POP(C++)
  354. if test "${ac_cv_my_have_gdiplus}" != "no"; then
  355. AC_DEFINE(USE_GDIPLUS, 1, Define to 1 to use GDI+)
  356. fi
  357. AM_CONDITIONAL(USE_GDIPLUS, test "${ac_cv_my_have_gdiplus}" = "yes")
  358. dnl Use libcaca? (required for font generation)
  359. ac_cv_my_have_caca="no"
  360. PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17, [ac_cv_my_have_caca="yes"], [:])
  361. if test "${ac_cv_my_have_caca}" != "no"; then
  362. AC_DEFINE(USE_CACA, 1, Define to 1 to use libcaca)
  363. fi
  364. AM_CONDITIONAL(USE_CACA, test "${ac_cv_my_have_caca}" != "no")
  365. dnl Use libpipi? (required for video recording)
  366. ac_cv_my_have_pipi="no"
  367. PKG_CHECK_MODULES(PIPI, pipi, [ac_cv_my_have_pipi="yes"], [:])
  368. if test "${ac_cv_my_have_pipi}" != "no"; then
  369. AC_DEFINE(USE_PIPI, 1, Define to 1 to use libpipi)
  370. LOL_CFLAGS="${LOL_CFLAGS} ${PIPI_CFLAGS}"
  371. LOL_LIBS="${LOL_LIBS} ${PIPI_LIBS}"
  372. fi
  373. AM_CONDITIONAL(USE_PIPI, test "${ac_cv_my_have_pipi}" != "no")
  374. dnl Use GTK+? (required for the deushax editor)
  375. ac_cv_my_have_gtkgl="no"
  376. PKG_CHECK_MODULES(GTK, gtk+-2.0, [ac_cv_my_have_gtkgl="yes"], [:])
  377. PKG_CHECK_MODULES(GTKGL, gtkgl-2.0, [:], [ac_cv_my_have_gtkgl="no"])
  378. if test "${ac_cv_my_have_gtkgl}" != "no"; then
  379. AC_DEFINE(USE_GTKGL, 1, Define to 1 to use GtkGl)
  380. fi
  381. AM_CONDITIONAL(USE_GTKGL, test "${ac_cv_my_have_gtkgl}" != "no")
  382. dnl Can we build neercs?
  383. AM_CONDITIONAL(BUILD_NEERCS, test "${ac_cv_my_have_caca}" != "no")
  384. dnl Should we ship non-free data?
  385. AM_CONDITIONAL(HAVE_NONFREE, true)
  386. dnl Extra libraries we may need
  387. AC_SUBST(MATH_LIBS)
  388. AC_SUBST(PAM_LIBS)
  389. AC_SUBST(UTIL_LIBS)
  390. dnl How to use the Lol Engine outside this tree
  391. LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS"
  392. LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS"
  393. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/liblolcore.a"
  394. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/bullet/liblolbullet.a"
  395. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/lua/liblollua.a"
  396. dnl How to use the Lol Engine inside this tree
  397. AM_CPPFLAGS="${AM_CPPFLAGS} -I\$(top_srcdir)/src"
  398. AM_CPPFLAGS="${AM_CPPFLAGS} -DLOL_CONFIG_SOURCESUBDIR=\\\"\$(subdir)\\\""
  399. AM_CPPFLAGS="${AM_CPPFLAGS} ${LOL_CFLAGS}"
  400. AM_LDFLAGS="${AM_LDFLAGS} ${LOL_DEPS}"
  401. AM_LDFLAGS="${AM_LDFLAGS} ${LOL_LIBS}"
  402. dnl Extra flags
  403. AC_SUBST(LOL_CFLAGS)
  404. AC_SUBST(LOL_LIBS)
  405. AC_SUBST(LOL_DEPS)
  406. AC_SUBST(AM_CFLAGS)
  407. AC_SUBST(AM_CPPFLAGS)
  408. AC_SUBST(AM_CXXFLAGS)
  409. AC_SUBST(AM_LDFLAGS)
  410. AC_SUBST(USE_DOT)
  411. AC_CONFIG_FILES(
  412. [Makefile
  413. src/Makefile
  414. src/bullet/Makefile
  415. src/lua/Makefile
  416. src/data/Makefile
  417. src/data/font/Makefile
  418. test/Makefile
  419. test/math/Makefile
  420. test/sandbox/Makefile
  421. test/xolotl/Makefile
  422. build/Makefile
  423. binaries/Makefile
  424. people/Makefile
  425. games/Makefile
  426. demos/Makefile
  427. tools/Makefile
  428. tools/vimlol/Makefile
  429. tools/vslol/Makefile
  430. doc/Makefile
  431. doc/doxygen.cfg
  432. ])
  433. AC_CONFIG_FILES(
  434. [games/monsterz/Makefile
  435. ])
  436. AC_CONFIG_FILES(
  437. [games/deushax/Makefile
  438. games/deushax/art/Makefile
  439. games/deushax/art/test/Makefile
  440. games/deushax/gfx/Makefile
  441. games/deushax/maps/Makefile
  442. ])
  443. AC_CONFIG_FILES(
  444. [games/mrpigeon/Makefile
  445. ])
  446. AC_CONFIG_FILES(
  447. [games/orbital/Makefile
  448. ])
  449. AC_CONFIG_FILES(
  450. [games/abuse/Makefile
  451. games/abuse/src/Makefile
  452. games/abuse/data/Makefile
  453. games/abuse/doc/Makefile
  454. games/abuse/doc/abuse.6
  455. games/abuse/doc/abuse-tool.6
  456. ])
  457. AC_CONFIG_FILES(
  458. [games/singlshot/Makefile
  459. ])
  460. AC_CONFIG_FILES(
  461. [demos/tutorial/Makefile
  462. demos/lol.js/Makefile
  463. ])
  464. AC_CONFIG_FILES(
  465. [tools/lolremez/Makefile
  466. ])
  467. AC_CONFIG_FILES(
  468. [tools/neercs/Makefile
  469. ])
  470. AC_CONFIG_FILES(
  471. [people/jnat/Makefile
  472. people/jnat/TestProject/Makefile
  473. people/peeweek/Makefile
  474. people/peeweek/private/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/touky_demo/Makefile
  482. people/touky/private/tactics/Makefile
  483. people/touky/private/the_unfortunate_voronoid/Makefile
  484. people/touky/private/workbench/Makefile
  485. people/jylam/Makefile
  486. people/jylam/private/Makefile
  487. people/jylam/private/chat/Makefile
  488. people/jylam/private/lander/Makefile
  489. people/sam/Makefile
  490. people/sam/ld27/Makefile
  491. people/sam/private/Makefile
  492. people/sam/private/kanagawa/Makefile
  493. people/sam/private/sapp/Makefile
  494. ])
  495. AC_OUTPUT