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.
 
 
 

557 rivejä
17 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 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 mingw threads if necessary
  239. if true; then
  240. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/mingw-std-threads-0.0.ac5c9e3b/include/"
  241. fi
  242. dnl Use pegtl? Yes, always
  243. if true; then
  244. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/pegtl-0.32/include"
  245. fi
  246. dnl Use Imgui? Yes, always
  247. if true; then
  248. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/imgui"
  249. fi
  250. dnl Use NativeClient?
  251. ac_cv_my_have_nacl="no"
  252. AC_LANG_PUSH(C++)
  253. AC_CHECK_HEADERS(ppapi/cpp/instance.h,
  254. [ac_cv_my_have_nacl="yes"
  255. LOL_LIBS="${LOL_LIBS} -lnosys"
  256. if test "${ac_cv_my_build_mode}" = "xrelease"; then
  257. LOL_TRY_CXXFLAGS(-s, [AM_CXXFLAGS="${AM_CXXFLAGS} -s"])
  258. fi])
  259. AC_LANG_POP(C++)
  260. AM_CONDITIONAL(USE_NACL, test "${ac_cv_my_have_nacl}" != "no")
  261. dnl Use Android? FIXME: super hacks!
  262. ac_cv_my_have_android="no"
  263. AC_CHECK_LIB(log, __android_log_vprint,
  264. [ac_cv_my_have_android="yes"
  265. LOL_LIBS="${LOL_LIBS} -llog -landroid -module -lEGL -lGLESv2"])
  266. AM_CONDITIONAL(USE_ANDROID, test "${ac_cv_my_have_android}" != "no")
  267. dnl Use EGL?
  268. ac_cv_my_have_egl="no"
  269. PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:])
  270. if test "${ac_cv_my_have_egl}" != "no"; then
  271. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  272. EGL_LIBS="${EGL_LIBS} -lX11"
  273. fi
  274. AC_CHECK_LIB(EGL, main,
  275. [ac_cv_my_have_egl="yes"
  276. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  277. EGL_LIBS="-lEGL"])
  278. dnl Raspberry Pi is different, check for it with extra libs; also we
  279. dnl look for a different function to bypass autoconf caching
  280. AC_CHECK_LIB(EGL, eglGetDisplay,
  281. [ac_cv_my_have_egl="yes"
  282. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  283. EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
  284. [:],
  285. [-lvcos -lvchiq_arm -lbcm_host -lGLESv2])
  286. AM_CONDITIONAL(USE_EGL, test "${ac_cv_my_have_egl}" != "no")
  287. dnl Use libpng? (replacement for SDL_image)
  288. ac_cv_my_have_libpng="no"
  289. PKG_CHECK_MODULES(LIBPNG, libpng, [ac_cv_my_have_libpng="yes"], [:])
  290. if test "${ac_cv_my_have_libpng}" != "no"; then
  291. AC_DEFINE(USE_LIBPNG, 1, Define to 1 to use libpng)
  292. fi
  293. AM_CONDITIONAL(USE_LIBPNG, test "${ac_cv_my_have_libpng}" != "no")
  294. dnl Use Windows GDI+?
  295. ac_cv_my_have_gdiplus="no"
  296. AC_LANG_PUSH(C++)
  297. AC_CHECK_HEADERS(gdiplus.h,
  298. [ac_cv_my_have_gdiplus="yes"
  299. LOL_LIBS="${LOL_LIBS} -lgdiplus"],
  300. [ac_cv_my_have_gdiplus="no"],
  301. [#include <algorithm>
  302. using std::min;
  303. using std::max;
  304. #include <windows.h>])
  305. AC_LANG_POP(C++)
  306. if test "${ac_cv_my_have_gdiplus}" != "no"; then
  307. AC_DEFINE(USE_GDIPLUS, 1, Define to 1 to use GDI+)
  308. fi
  309. AM_CONDITIONAL(USE_GDIPLUS, test "${ac_cv_my_have_gdiplus}" = "yes")
  310. dnl Use libcaca? (required for font generation)
  311. ac_cv_my_have_caca="no"
  312. PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17, [ac_cv_my_have_caca="yes"], [:])
  313. if test "${ac_cv_my_have_caca}" != "no"; then
  314. AC_DEFINE(USE_CACA, 1, Define to 1 to use libcaca)
  315. fi
  316. AM_CONDITIONAL(USE_CACA, test "${ac_cv_my_have_caca}" != "no")
  317. # Use Imlib2?
  318. ac_cv_my_have_imlib2="no"
  319. PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
  320. if test "${ac_cv_my_have_imlib2}" != "no"; then
  321. AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
  322. LOL_CFLAGS="${LOL_CFLAGS} ${IMLIB2_CFLAGS}"
  323. LOL_LIBS="${LOL_LIBS} ${IMLIB2_LIBS}"
  324. fi
  325. AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
  326. # Use libavcodec? (required for movie encoding)
  327. ac_cv_my_have_ffmpeg="yes"
  328. PKG_CHECK_MODULES([LIBAVCODEC], [libavcodec], [:], [ac_cv_my_have_ffmpeg=no])
  329. PKG_CHECK_MODULES([LIBAVFORMAT], [libavformat], [:], [ac_cv_my_have_ffmpeg=no])
  330. PKG_CHECK_MODULES([LIBSWSCALE], [libswscale], [:], [ac_cv_my_have_ffmpeg=no])
  331. if test "${ac_cv_my_have_ffmpeg}" = "no"; then
  332. ac_cv_my_have_ffmpeg="yes"
  333. AC_CHECK_HEADERS(libavcodec/avcodec.h, [:], [ac_cv_my_have_ffmpeg=no])
  334. AC_CHECK_HEADERS(libavformat/avformat.h, [:], [ac_cv_my_have_ffmpeg=no])
  335. AC_CHECK_HEADERS(libswscale/swscale.h, [:], [ac_cv_my_have_ffmpeg=no])
  336. if test "${ac_cv_my_have_ffmpeg}" = "yes"; then
  337. LIBAVFORMAT_LIBS="-lavformat"
  338. LIBAVCODEC_LIBS="-lavcodec -lavutil"
  339. LIBSWSCALE_LIBS="-lswscale -lswresample"
  340. AC_CHECK_LIB(ws2_32, main, LOL_LIBS="${LOL_LIBS} -lws2_32")
  341. fi
  342. fi
  343. if test "${ac_cv_my_have_ffmpeg}" != "no"; then
  344. AC_DEFINE(USE_FFMPEG, 1, Define to 1 to use FFmpeg)
  345. LOL_CFLAGS="${LOL_CFLAGS} ${LIBAVFORMAT_CFLAGS} ${LIBAVCODEC_CFLAGS} ${SWSCALE_CFLAGS}"
  346. LOL_LIBS="${LOL_LIBS} ${LIBAVFORMAT_LIBS} ${LIBAVCODEC_LIBS} ${LIBSWSCALE_LIBS}"
  347. fi
  348. AM_CONDITIONAL(USE_FFMPEG, test "${ac_cv_my_have_ffmpeg}" != "no")
  349. dnl Use GTK+? (required for the deushax editor)
  350. ac_cv_my_have_gtkgl="no"
  351. PKG_CHECK_MODULES(GTK, gtk+-2.0, [ac_cv_my_have_gtkgl="yes"], [:])
  352. PKG_CHECK_MODULES(GTKGL, gtkgl-2.0, [:], [ac_cv_my_have_gtkgl="no"])
  353. if test "${ac_cv_my_have_gtkgl}" != "no"; then
  354. AC_DEFINE(USE_GTKGL, 1, Define to 1 to use GtkGl)
  355. fi
  356. AM_CONDITIONAL(USE_GTKGL, test "${ac_cv_my_have_gtkgl}" != "no")
  357. dnl Can we build neercs?
  358. AM_CONDITIONAL(BUILD_NEERCS, test "${ac_cv_my_have_caca}" != "no")
  359. dnl Should we ship non-free data?
  360. AM_CONDITIONAL(HAVE_NONFREE, true)
  361. dnl Extra libraries we may need
  362. AC_SUBST(MATH_LIBS)
  363. AC_SUBST(PAM_LIBS)
  364. AC_SUBST(UTIL_LIBS)
  365. dnl How to use the Lol Engine outside this tree
  366. LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS"
  367. LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS"
  368. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/liblolcore.a"
  369. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/bullet/liblolbullet.a"
  370. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/lua/liblollua.a"
  371. dnl How to use the Lol Engine inside this tree
  372. AM_CPPFLAGS="${AM_CPPFLAGS} -I\$(top_srcdir)/src"
  373. AM_CPPFLAGS="${AM_CPPFLAGS} -DLOL_CONFIG_SOURCESUBDIR=\\\"\$(subdir)\\\""
  374. AM_CPPFLAGS="${AM_CPPFLAGS} ${LOL_CFLAGS}"
  375. AM_LDFLAGS="${AM_LDFLAGS} ${LOL_DEPS}"
  376. AM_LDFLAGS="${AM_LDFLAGS} ${LOL_LIBS}"
  377. dnl Extra flags
  378. AC_SUBST(LOL_CFLAGS)
  379. AC_SUBST(LOL_LIBS)
  380. AC_SUBST(LOL_DEPS)
  381. AC_SUBST(AM_CFLAGS)
  382. AC_SUBST(AM_CPPFLAGS)
  383. AC_SUBST(AM_CXXFLAGS)
  384. AC_SUBST(AM_LDFLAGS)
  385. AC_SUBST(USE_DOT)
  386. AC_CONFIG_FILES(
  387. [Makefile
  388. src/Makefile
  389. src/bullet/Makefile
  390. src/lua/Makefile
  391. src/data/Makefile
  392. src/data/font/Makefile
  393. src/t/Makefile
  394. build/Makefile
  395. binaries/Makefile
  396. people/Makefile
  397. games/Makefile
  398. demos/Makefile
  399. tools/Makefile
  400. tools/vimlol/Makefile
  401. tools/vslol/Makefile
  402. doc/Makefile
  403. doc/doxygen.cfg
  404. doc/samples/Makefile
  405. doc/samples/math/Makefile
  406. doc/samples/meshviewer/Makefile
  407. doc/samples/sandbox/Makefile
  408. doc/tutorial/Makefile
  409. ])
  410. AC_CONFIG_FILES(
  411. [games/monsterz/Makefile
  412. games/mrpigeon/Makefile
  413. games/orbital/Makefile
  414. games/singlshot/Makefile
  415. games/thonik/Makefile
  416. games/sot3000/Makefile
  417. ])
  418. AC_CONFIG_FILES(
  419. [games/deushax/Makefile
  420. games/deushax/art/Makefile
  421. games/deushax/art/test/Makefile
  422. games/deushax/gfx/Makefile
  423. games/deushax/maps/Makefile
  424. ])
  425. AC_CONFIG_FILES(
  426. [games/abuse/Makefile
  427. games/abuse/src/Makefile
  428. games/abuse/data/Makefile
  429. games/abuse/doc/Makefile
  430. games/abuse/doc/abuse.6
  431. games/abuse/doc/abuse-tool.6
  432. ])
  433. AC_CONFIG_FILES(
  434. [demos/lol.js/Makefile
  435. ])
  436. AC_CONFIG_FILES(
  437. [tools/lolremez/Makefile
  438. tools/lolunit/Makefile
  439. tools/neercs/Makefile
  440. tools/pimp/Makefile
  441. ])
  442. AC_CONFIG_FILES(
  443. [people/jnat/Makefile
  444. people/jnat/TestProject/Makefile
  445. people/peeweek/Makefile
  446. people/benlitz/Makefile
  447. people/benlitz/test1/Makefile
  448. people/benlitz/voxel/Makefile
  449. people/benlitz/lolui/Makefile
  450. people/touky/Makefile
  451. people/touky/shared/Makefile
  452. people/touky/sprite_sorter/Makefile
  453. people/touky/squad_shooter/Makefile
  454. people/touky/top_shooter/Makefile
  455. people/touky/touky_demo/Makefile
  456. people/touky/tactics/Makefile
  457. people/touky/the_unfortunate_voronoid/Makefile
  458. people/touky/workbench/Makefile
  459. people/jylam/Makefile
  460. people/jylam/private/Makefile
  461. people/jylam/private/chat/Makefile
  462. people/jylam/private/lander/Makefile
  463. people/jylam/private/oric_convert/Makefile
  464. people/sam/Makefile
  465. people/sam/kanagawa/Makefile
  466. people/sam/sapp/Makefile
  467. ])
  468. AC_OUTPUT