Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

configure.ac 15 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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 and later mode. Checked early so that we don't run into surprises.
  29. version_flag=''
  30. LOL_TRY_CXXFLAGS(-std=c++0x, [version_flag='-std=c++0x'])
  31. LOL_TRY_CXXFLAGS(-std=c++11, [version_flag='-std=c++11'])
  32. LOL_TRY_CXXFLAGS(-std=c++14, [version_flag='-std=c++14'])
  33. LOL_TRY_CXXFLAGS(-std=c++17, [version_flag='-std=c++17'])
  34. AM_CXXFLAGS="${AM_CXXFLAGS} ${version_flag}"
  35. CXXFLAGS="${CXXFLAGS} ${version_flag}"
  36. AC_LANG_PUSH(C++)
  37. AC_MSG_CHECKING(for C++11 enum class support)
  38. AC_TRY_LINK([], [enum class Foo : int { Bar, Baz };],
  39. [AC_MSG_RESULT(yes)],
  40. [AC_MSG_RESULT(no)
  41. AC_MSG_ERROR([[C++ compiler does not support C++11 enum classes]])])
  42. AC_LANG_POP(C++)
  43. AC_LIBTOOL_WIN32_DLL
  44. AM_PROG_LIBTOOL
  45. AC_LIBTOOL_CXX
  46. AC_C_CONST
  47. AC_C_INLINE
  48. dnl Ensure an error is thrown if pkg-config M4 files are not found.
  49. m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
  50. m4_pattern_forbid([^PKG_CHECK_MODULES$])
  51. m4_pattern_forbid([^PKG_PROG_PKG_CONFIG$])
  52. dnl Same for Lol Engine M4 files.
  53. m4_pattern_forbid([^LOL_])
  54. dnl Do not use PKG_CONFIG_LIBDIR when cross-compiling.
  55. if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
  56. export PKG_CONFIG_LIBDIR=/dev/null
  57. fi
  58. dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
  59. dnl now otherwise it might be set in an obscure if statement. Same thing for
  60. dnl PKG_PROG_PKG_CONFIG which needs to be called first.
  61. AC_EGREP_CPP(yes, foo)
  62. PKG_PROG_PKG_CONFIG()
  63. dnl Check for a working implementation of sed
  64. AC_PROG_SED
  65. AC_MSG_CHECKING(for a sed that understands \t)
  66. if test "$(echo 'x\x' | "${SED}" 's/.*@<:@^x\t@:>@//')" != x; then
  67. AC_MSG_RESULT(no)
  68. AC_MSG_ERROR([[consider installing GNU sed]])
  69. else
  70. AC_MSG_RESULT(yes)
  71. fi
  72. dnl conditional builds
  73. AC_ARG_ENABLE(debug,
  74. [ --enable-debug build debug versions of the game (default no)])
  75. AC_ARG_ENABLE(release,
  76. [ --enable-release build final release of the game (default no)])
  77. AC_ARG_ENABLE(experimental,
  78. [ --enable-experimental experimental build (default no)])
  79. AC_ARG_ENABLE(doc,
  80. [ --enable-doc build documentation (needs doxygen and LaTeX)])
  81. dnl Common C headers
  82. AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h math.h)
  83. AC_CHECK_HEADERS(fastmath.h libutil.h util.h pty.h glob.h unistd.h io.h)
  84. AC_CHECK_HEADERS(execinfo.h)
  85. AC_CHECK_HEADERS(sys/ioctl.h sys/ptrace.h sys/stat.h sys/syscall.h sys/user.h)
  86. AC_CHECK_HEADERS(sys/wait.h sys/time.h sys/types.h)
  87. AC_CHECK_HEADERS(linux/kdev_t.h linux/major.h)
  88. AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h)
  89. AC_CHECK_HEADERS(pam/pam_appl.h pam/pam_misc.h)
  90. dnl Common C++ headers
  91. AC_LANG_PUSH(C++)
  92. AC_CHECK_HEADERS(cxxabi.h)
  93. AC_LANG_POP(C++)
  94. dnl Common C functions
  95. AC_CHECK_FUNCS(getenv system tmpfile tmpnam getcwd _getcwd getlogin)
  96. AC_CHECK_FUNCS(backtrace_symbols)
  97. AC_CHECK_FUNCS(gettimeofday usleep)
  98. dnl Build mode
  99. ac_cv_my_build_mode="devel"
  100. if test "x${enable_release}" = "xyes"; then
  101. ac_cv_my_build_mode="release"
  102. fi
  103. if test "x${enable_devel}" = "xyes"; then
  104. ac_cv_my_build_mode="devel"
  105. fi
  106. if test "x${enable_debug}" = "xyes"; then
  107. ac_cv_my_build_mode="debug"
  108. fi
  109. if test "x${ac_cv_my_build_mode}" = "xdebug"; then
  110. AC_DEFINE(LOL_BUILD_DEBUG, 1, Define to 1 to activate debug build)
  111. LOL_TRY_CXXFLAGS(-O, [AM_CXXFLAGS="${AM_CXXFLAGS} -O"])
  112. LOL_TRY_CXXFLAGS(-g, [AM_CXXFLAGS="${AM_CXXFLAGS} -g"])
  113. elif test "x${ac_cv_my_build_mode}" = "xdevel"; then
  114. AC_DEFINE(LOL_BUILD_DEVEL, 1, Define to 1 to activate development build)
  115. LOL_TRY_CXXFLAGS(-Os, [AM_CXXFLAGS="${AM_CXXFLAGS} -Os"])
  116. LOL_TRY_CXXFLAGS(-g, [AM_CXXFLAGS="${AM_CXXFLAGS} -g"])
  117. LOL_TRY_CXXFLAGS(-ffast-math, [AM_CXXFLAGS="${AM_CXXFLAGS} -ffast-math"])
  118. else
  119. AC_DEFINE(LOL_BUILD_RELEASE, 1, Define to 1 to activate final release)
  120. LOL_TRY_CXXFLAGS(-Os, [AM_CXXFLAGS="${AM_CXXFLAGS} -Os"])
  121. LOL_TRY_CXXFLAGS(-ffast-math, [AM_CXXFLAGS="${AM_CXXFLAGS} -ffast-math"])
  122. LOL_TRY_CXXFLAGS(-fomit-frame-pointer, [AM_CXXFLAGS="${AM_CXXFLAGS} -fomit-frame-pointer"])
  123. LOL_TRY_CXXFLAGS(-fno-strength-reduce, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-strength-reduce"])
  124. fi
  125. dnl Build documentation?
  126. DOXYGEN="no"
  127. LATEX="no"
  128. if test "${enable_doc}" != "no"; then
  129. AC_PATH_PROG(DOXYGEN, doxygen, no)
  130. if test "${DOXYGEN}" != "no"; then
  131. # Build LaTeX documentation?
  132. AC_PATH_PROG(LATEX, pdflatex, no)
  133. AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
  134. AC_PATH_PROG(DVIPS, dvips, no)
  135. if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then
  136. LATEX="no"
  137. fi
  138. if test "${LATEX}" != "no"; then
  139. AC_MSG_CHECKING(for a4.sty and a4wide.sty)
  140. if "${KPSEWHICH}" a4.sty >/dev/null 2>&1; then
  141. if "${KPSEWHICH}" a4wide.sty >/dev/null 2>&1; then
  142. AC_MSG_RESULT(yes)
  143. else
  144. LATEX="no"
  145. AC_MSG_RESULT(no)
  146. fi
  147. else
  148. LATEX="no"
  149. AC_MSG_RESULT(no)
  150. fi
  151. fi
  152. AC_PATH_PROG(DOT, dot, no)
  153. if test "${DOT}" != "no"; then
  154. USE_DOT="YES"
  155. else
  156. USE_DOT="NO"
  157. fi
  158. fi
  159. fi
  160. dnl XXX: disable LaTeX because we use too much memory
  161. LATEX=no
  162. AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
  163. AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
  164. AM_CONDITIONAL(USE_DOT, test "${DOT}" != "no")
  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. LOL_TRY_CXXFLAGS(-Wstrict-overflow=1, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wstrict-overflow=1"])
  176. dnl Add these even though they're implicitly set, so that we can safely
  177. dnl remove them from within a Makefile.
  178. LOL_TRY_CXXFLAGS(-Wmaybe-uninitialized, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wmaybe-uninitialized"])
  179. LOL_TRY_CXXFLAGS(-Wnarrowing, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wnarrowing"])
  180. LOL_TRY_CXXFLAGS(-Wunused, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wunused"])
  181. LOL_TRY_CXXFLAGS(-Wstrict-aliasing, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wstrict-aliasing"])
  182. LOL_TRY_CXXFLAGS(-Wparentheses, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wparentheses"])
  183. LOL_TRY_CXXFLAGS(-Wreorder, [AM_CXXFLAGS="${AM_CXXFLAGS} -Wreorder"])
  184. dnl Disable these warnings because they're annoyingly verbose
  185. LOL_TRY_CXXFLAGS(-Wno-psabi, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wno-psabi"])
  186. AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
  187. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
  188. dnl Unix-specific libutil
  189. AC_CHECK_LIB(util, forkpty,
  190. [UTIL_LIBS="${UTIL_LIBS} -lutil"
  191. dnl Override future forkpty detection
  192. ac_cv_func_forkpty="yes"])
  193. AC_CHECK_FUNCS(forkpty)
  194. dnl GCC-specific symbol demangling
  195. AC_LANG_PUSH(C++)
  196. AC_TRY_LINK(
  197. [#include <cxxabi.h>],
  198. [abi::__cxa_demangle(NULL, 0, 0, NULL);],
  199. [AC_DEFINE(HAVE_CXA_DEMANGLE, 1, Define to 1 if abi::__cxa_demangle is available)])
  200. AC_LANG_POP(C++)
  201. dnl Are we building using MinGW?
  202. LOL_TRY_CXXFLAGS(-mwindows -mwin32,
  203. [AM_CXXFLAGS="${AM_CXXFLAGS} -mwindows -mwin32"
  204. LOL_LIBS="${LOL_LIBS} -uWinMain -u_WinMain@16"])
  205. dnl Are we building using Emscripten?
  206. ac_cv_my_have_emscripten="no"
  207. AC_CHECK_HEADERS(emscripten.h,
  208. [ac_cv_my_have_emscripten="yes"
  209. dnl XXX: activate this if memory heap is too small
  210. #AM_CXXFLAGS="${AM_CXXFLAGS} -s ALLOW_MEMORY_GROWTH=1"
  211. dnl HACK: until emcc properly adds these to EMSDK_OPTS
  212. CPPFLAGS="${CPPFLAGS} -U__i386__ -U__x86_64__ -U__i386 -U__x86_64 -Ui386 -Ux86_64"
  213. CPPFLAGS="${CPPFLAGS} -U__SSE__ -U__SSE2__ -U__MMX__ -UX87_DOUBLE_ROUNDING"
  214. CPPFLAGS="${CPPFLAGS} -UHAVE_GCC_ASM_FOR_X87 -DEMSCRIPTEN -U__STRICT_ANSI__"
  215. CPPFLAGS="${CPPFLAGS} -U__CYGWIN__"])
  216. AM_CONDITIONAL(USE_EMSCRIPTEN, test "${ac_cv_my_have_emscripten}" != "no")
  217. dnl Are we on the Xbox 360?
  218. dnl Answer: NO! we don't know how to build for it anyway
  219. AM_CONDITIONAL(USE_X360, false)
  220. dnl Are we on an OS X or iOS platform?
  221. LOL_TRY_LDFLAGS(-framework Foundation,
  222. [LOL_LIBS="${LOL_LIBS} -framework Foundation"])
  223. LOL_TRY_LDFLAGS(-framework CoreGraphics,
  224. [LOL_LIBS="${LOL_LIBS} -framework CoreGraphics"])
  225. LOL_TRY_LDFLAGS(-framework CoreData,
  226. [LOL_LIBS="${LOL_LIBS} -framework CoreData"])
  227. LOL_TRY_LDFLAGS(-framework UIKit,
  228. [LOL_LIBS="${LOL_LIBS} -framework UIKit"])
  229. LOL_CHECK_OPENGL
  230. LOL_CHECK_SDL
  231. dnl Use mingw threads if necessary
  232. if true; then
  233. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/mingw-std-threads-0.0.ac5c9e3b/include/"
  234. fi
  235. dnl Use pegtl? Yes, always
  236. if true; then
  237. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/pegtl-1.3.1-e7752e81/include"
  238. fi
  239. dnl Use Imgui? Yes, always
  240. if true; then
  241. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/imgui"
  242. fi
  243. dnl Use NativeClient?
  244. ac_cv_my_have_nacl="no"
  245. AC_LANG_PUSH(C++)
  246. AC_CHECK_HEADERS(ppapi/cpp/instance.h,
  247. [ac_cv_my_have_nacl="yes"
  248. LOL_LIBS="${LOL_LIBS} -lnosys"
  249. if test "${ac_cv_my_build_mode}" = "xrelease"; then
  250. LOL_TRY_CXXFLAGS(-s, [AM_CXXFLAGS="${AM_CXXFLAGS} -s"])
  251. fi])
  252. AC_LANG_POP(C++)
  253. AM_CONDITIONAL(USE_NACL, test "${ac_cv_my_have_nacl}" != "no")
  254. dnl Use Android? FIXME: super hacks!
  255. ac_cv_my_have_android="no"
  256. AC_CHECK_LIB(log, __android_log_vprint,
  257. [ac_cv_my_have_android="yes"
  258. LOL_LIBS="${LOL_LIBS} -llog -landroid -module -lEGL -lGLESv2"])
  259. AM_CONDITIONAL(USE_ANDROID, test "${ac_cv_my_have_android}" != "no")
  260. dnl Use EGL?
  261. ac_cv_my_have_egl="no"
  262. PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:])
  263. if test "${ac_cv_my_have_egl}" != "no"; then
  264. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  265. EGL_LIBS="${EGL_LIBS} -lX11"
  266. fi
  267. AC_CHECK_LIB(EGL, main,
  268. [ac_cv_my_have_egl="yes"
  269. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  270. EGL_LIBS="-lEGL"])
  271. dnl Raspberry Pi is different, check for it with extra libs; also we
  272. dnl look for a different function to bypass autoconf caching
  273. AC_CHECK_LIB(EGL, eglGetDisplay,
  274. [ac_cv_my_have_egl="yes"
  275. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  276. EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
  277. [:],
  278. [-lvcos -lvchiq_arm -lbcm_host -lGLESv2])
  279. AM_CONDITIONAL(USE_EGL, test "${ac_cv_my_have_egl}" != "no")
  280. dnl Use libpng? (replacement for SDL_image)
  281. ac_cv_my_have_libpng="no"
  282. PKG_CHECK_MODULES(LIBPNG, libpng, [ac_cv_my_have_libpng="yes"], [:])
  283. if test "${ac_cv_my_have_libpng}" != "no"; then
  284. AC_DEFINE(USE_LIBPNG, 1, Define to 1 to use libpng)
  285. fi
  286. AM_CONDITIONAL(USE_LIBPNG, test "${ac_cv_my_have_libpng}" != "no")
  287. dnl Use Windows GDI+?
  288. ac_cv_my_have_gdiplus="no"
  289. AC_LANG_PUSH(C++)
  290. AC_CHECK_HEADERS(gdiplus.h,
  291. [ac_cv_my_have_gdiplus="yes"
  292. LOL_LIBS="${LOL_LIBS} -lgdiplus"],
  293. [ac_cv_my_have_gdiplus="no"],
  294. [#include <algorithm>
  295. using std::min;
  296. using std::max;
  297. #include <windows.h>])
  298. AC_LANG_POP(C++)
  299. if test "${ac_cv_my_have_gdiplus}" != "no"; then
  300. AC_DEFINE(USE_GDIPLUS, 1, Define to 1 to use GDI+)
  301. fi
  302. AM_CONDITIONAL(USE_GDIPLUS, test "${ac_cv_my_have_gdiplus}" = "yes")
  303. dnl Use libcaca? (required for font generation)
  304. ac_cv_my_have_caca="no"
  305. PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17, [ac_cv_my_have_caca="yes"], [:])
  306. if test "${ac_cv_my_have_caca}" != "no"; then
  307. AC_DEFINE(USE_CACA, 1, Define to 1 to use libcaca)
  308. fi
  309. AM_CONDITIONAL(USE_CACA, test "${ac_cv_my_have_caca}" != "no")
  310. # Use Imlib2?
  311. ac_cv_my_have_imlib2="no"
  312. PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
  313. if test "${ac_cv_my_have_imlib2}" != "no"; then
  314. AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
  315. LOL_CFLAGS="${LOL_CFLAGS} ${IMLIB2_CFLAGS}"
  316. LOL_LIBS="${LOL_LIBS} ${IMLIB2_LIBS}"
  317. fi
  318. AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
  319. # Use libavcodec? (required for movie encoding)
  320. ac_cv_my_have_ffmpeg="yes"
  321. PKG_CHECK_MODULES([LIBAVCODEC], [libavcodec], [:], [ac_cv_my_have_ffmpeg=no])
  322. PKG_CHECK_MODULES([LIBAVFORMAT], [libavformat], [:], [ac_cv_my_have_ffmpeg=no])
  323. PKG_CHECK_MODULES([LIBSWSCALE], [libswscale], [:], [ac_cv_my_have_ffmpeg=no])
  324. if test "${ac_cv_my_have_ffmpeg}" = "no"; then
  325. ac_cv_my_have_ffmpeg="yes"
  326. AC_CHECK_HEADERS(libavcodec/avcodec.h, [:], [ac_cv_my_have_ffmpeg=no])
  327. AC_CHECK_HEADERS(libavformat/avformat.h, [:], [ac_cv_my_have_ffmpeg=no])
  328. AC_CHECK_HEADERS(libswscale/swscale.h, [:], [ac_cv_my_have_ffmpeg=no])
  329. if test "${ac_cv_my_have_ffmpeg}" = "yes"; then
  330. LIBAVFORMAT_LIBS="-lavformat"
  331. LIBAVCODEC_LIBS="-lavcodec -lavutil"
  332. LIBSWSCALE_LIBS="-lswscale -lswresample"
  333. AC_CHECK_LIB(ws2_32, main, LOL_LIBS="${LOL_LIBS} -lws2_32")
  334. fi
  335. fi
  336. if test "${ac_cv_my_have_ffmpeg}" != "no"; then
  337. AC_DEFINE(USE_FFMPEG, 1, Define to 1 to use FFmpeg)
  338. LOL_CFLAGS="${LOL_CFLAGS} ${LIBAVFORMAT_CFLAGS} ${LIBAVCODEC_CFLAGS} ${SWSCALE_CFLAGS}"
  339. LOL_LIBS="${LOL_LIBS} ${LIBAVFORMAT_LIBS} ${LIBAVCODEC_LIBS} ${LIBSWSCALE_LIBS}"
  340. fi
  341. AM_CONDITIONAL(USE_FFMPEG, test "${ac_cv_my_have_ffmpeg}" != "no")
  342. dnl Use GTK+? (required for the deushax editor)
  343. ac_cv_my_have_gtkgl="no"
  344. PKG_CHECK_MODULES(GTK, gtk+-2.0, [ac_cv_my_have_gtkgl="yes"], [:])
  345. PKG_CHECK_MODULES(GTKGL, gtkgl-2.0, [:], [ac_cv_my_have_gtkgl="no"])
  346. if test "${ac_cv_my_have_gtkgl}" != "no"; then
  347. AC_DEFINE(USE_GTKGL, 1, Define to 1 to use GtkGl)
  348. fi
  349. AM_CONDITIONAL(USE_GTKGL, test "${ac_cv_my_have_gtkgl}" != "no")
  350. dnl Can we build neercs?
  351. AM_CONDITIONAL(BUILD_NEERCS, test "${ac_cv_my_have_caca}" != "no")
  352. dnl Should we ship non-free data?
  353. AM_CONDITIONAL(HAVE_NONFREE, true)
  354. dnl Extra libraries we may need
  355. AC_SUBST(MATH_LIBS)
  356. AC_SUBST(PAM_LIBS)
  357. AC_SUBST(UTIL_LIBS)
  358. dnl How to use the Lol Engine outside this tree
  359. LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS"
  360. LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS"
  361. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/liblol-core.a"
  362. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/bullet/liblol-bullet.a"
  363. LOL_DEPS="${LOL_DEPS} \$(top_builddir)/src/lua/liblol-lua.a"
  364. dnl How to use the Lol Engine inside this tree
  365. AM_CPPFLAGS="${AM_CPPFLAGS} -I\$(top_srcdir)/src"
  366. AM_CPPFLAGS="${AM_CPPFLAGS} -DLOL_CONFIG_SOURCESUBDIR=\\\"\$(subdir)\\\""
  367. AM_CPPFLAGS="${AM_CPPFLAGS} ${LOL_CFLAGS}"
  368. AM_LDFLAGS="${AM_LDFLAGS} ${LOL_DEPS}"
  369. AM_LDFLAGS="${AM_LDFLAGS} ${LOL_LIBS}"
  370. dnl Extra flags
  371. AC_SUBST(LOL_CFLAGS)
  372. AC_SUBST(LOL_LIBS)
  373. AC_SUBST(LOL_DEPS)
  374. AC_SUBST(AM_CFLAGS)
  375. AC_SUBST(AM_CPPFLAGS)
  376. AC_SUBST(AM_CXXFLAGS)
  377. AC_SUBST(AM_LDFLAGS)
  378. AC_SUBST(USE_DOT)
  379. AC_CONFIG_FILES(
  380. [Makefile
  381. src/Makefile
  382. src/bullet/Makefile
  383. src/lua/Makefile
  384. src/data/Makefile
  385. src/data/font/Makefile
  386. src/t/Makefile
  387. build/Makefile
  388. binaries/Makefile
  389. doc/Makefile
  390. doc/doxygen.cfg
  391. doc/samples/Makefile
  392. doc/samples/math/Makefile
  393. doc/samples/meshviewer/Makefile
  394. doc/samples/sandbox/Makefile
  395. doc/tutorial/Makefile
  396. tools/Makefile
  397. tools/lolremez/Makefile
  398. tools/lolunit/Makefile
  399. tools/vimlol/Makefile
  400. tools/vslol/Makefile
  401. ])
  402. AC_OUTPUT