Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

configure.ac 15 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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. dnl Versioning of the separate software we ship
  9. LOLUNIT_VERSION=0.1
  10. AC_SUBST(LOLUNIT_VERSION)
  11. LOLREMEZ_VERSION=0.2
  12. AC_SUBST(LOLREMEZ_VERSION)
  13. AM_CONFIG_HEADER(config.h)
  14. AM_PROG_CC_C_O
  15. AC_PROG_CPP
  16. AC_PROG_CXX
  17. AC_PROG_CXXCPP
  18. AC_PROG_RANLIB
  19. AC_LIBTOOL_WIN32_DLL
  20. AM_PROG_LIBTOOL
  21. AC_LIBTOOL_CXX
  22. AC_C_CONST
  23. AC_C_INLINE
  24. dnl Ensure an error is thrown if pkg-config M4 files are not found.
  25. m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
  26. m4_pattern_forbid([^PKG_CHECK_MODULES$])
  27. m4_pattern_forbid([^PKG_PROG_PKG_CONFIG$])
  28. dnl Do not use PKG_CONFIG_LIBDIR when cross-compiling.
  29. if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
  30. export PKG_CONFIG_LIBDIR=/dev/null
  31. fi
  32. dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
  33. dnl now otherwise it might be set in an obscure if statement. Same thing for
  34. dnl PKG_PROG_PKG_CONFIG which needs to be called first.
  35. AC_EGREP_CPP(yes, foo)
  36. PKG_PROG_PKG_CONFIG()
  37. AM_CONDITIONAL(USE_GLEW, test "${ac_cv_my_have_glew}" != "no")
  38. dnl conditional builds
  39. AC_ARG_ENABLE(debug,
  40. [ --enable-debug build debug versions of the game (default no)])
  41. AC_ARG_ENABLE(release,
  42. [ --enable-release build final release of the game (default no)])
  43. AC_ARG_ENABLE(experimental,
  44. [ --enable-experimental experimental build (default no)])
  45. AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
  46. AC_CHECK_HEADERS(fastmath.h pthread.h libutil.h util.h pty.h glob.h)
  47. AC_CHECK_HEADERS(sys/ioctl.h sys/ptrace.h sys/stat.h sys/syscall.h sys/user.h)
  48. AC_CHECK_HEADERS(sys/wait.h)
  49. AC_CHECK_HEADERS(linux/kdev_t.h linux/major.h)
  50. AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h)
  51. AC_CHECK_HEADERS(pam/pam_appl.h pam/pam_misc.h)
  52. if test "${enable_debug}" = "yes"; then
  53. AC_DEFINE(LOL_DEBUG, 1, Define to 1 to activate debug)
  54. OPT="-O"
  55. else
  56. OPT="-O3 -ffast-math -fno-strength-reduce -fomit-frame-pointer"
  57. fi
  58. if test "${enable_release}" = "yes"; then
  59. AC_DEFINE(LOL_RELEASE, 1, Define to 1 to activate final release)
  60. REL=""
  61. else
  62. REL="-g"
  63. fi
  64. if test "${enable_experimental}" = "yes"; then
  65. AC_DEFINE(LOL_EXPERIMENTAL, 1, Define to 1 to activate experimental build)
  66. fi
  67. dnl No exceptions
  68. CXXFLAGS="${CXXFLAGS} -fno-exceptions -fno-rtti"
  69. dnl Optimizations
  70. CXXFLAGS="${CXXFLAGS} ${REL} ${OPT}"
  71. dnl Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  72. CXXFLAGS="${CXXFLAGS} -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare"
  73. AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
  74. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
  75. AC_CHECK_LIB(util, forkpty, UTIL_LIBS="${UTIL_LIBS} -lutil")
  76. dnl Are we on the PS3?
  77. ac_cv_my_have_ps3="no"
  78. AC_CHECK_LIB(sysmodule_stub, cellSysmoduleLoadModule,
  79. [ac_cv_my_have_ps3="yes"
  80. LOL_LIBS="${LOL_LIBS} -lsysmodule_stub -lsysutil_stub -lresc_stub"
  81. dnl For PSGL
  82. AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available) # FIXME: hack
  83. GL_LIBS="${GL_LIBS} -lPSGL -lgcm_cmd -lgcm_sys_stub"
  84. dnl This is the old way
  85. if test "x${CELLSDK}" != x -a "x${CELLSDK}" = x; then
  86. CELL_SDK="${CELLSDK}"
  87. fi
  88. if test "x${enable_debug}" = xyes; then
  89. GL_LIBS="${GL_LIBS} -L${CELL_SDK}/target/ppu/lib/PSGL/RSX/debug"
  90. elif test "x${enable_release}" = xyes; then
  91. GL_LIBS="${GL_LIBS} -L${CELL_SDK}/target/ppu/lib/PSGL/RSX/ultra-opt"
  92. else
  93. GL_LIBS="${GL_LIBS} -L${CELL_SDK}/target/ppu/lib/PSGL/RSX/opt"
  94. fi
  95. dnl For the runtime Cg compiler
  96. GL_LIBS="${GL_LIBS} -lcgc -lPSGLcgc"
  97. dnl For the PNG decoder
  98. LOL_LIBS="${LOL_LIBS} -lpngdec_stub"
  99. dnl For the pad library
  100. LOL_LIBS="${LOL_LIBS} -lio_stub -lusbd_stub -lpadfilter"
  101. dnl Disable this warning, it's too verbose with vector.h
  102. CXXFLAGS="${CXXFLAGS} -Wno-sign-compare"
  103. AC_PATH_PROG(MAKE_FSELF, make_fself, no)],
  104. [MAKE_FSELF=no])
  105. AM_CONDITIONAL(USE_MAKE_FSELF, test "${MAKE_FSELF}" != "no")
  106. AM_CONDITIONAL(USE_PS3, test "${ac_cv_my_have_ps3}" != "no")
  107. dnl Are we building using MinGW?
  108. LIBS_save="$LIBS"
  109. LIBS="$LIBS -mwindows -mwin32"
  110. AC_MSG_CHECKING(for -mwindows -mwin32)
  111. AC_TRY_LINK([], [],
  112. [AC_MSG_RESULT(yes)
  113. CXXFLAGS="${CXXFLAGS} -mwindows -mwin32"
  114. LOL_LIBS="${LOL_LIBS} -uWinMain -u_WinMain@16"],
  115. [AC_MSG_RESULT(no)])
  116. LIBS="$LIBS_save"
  117. dnl Are we on the Xbox 360?
  118. dnl Answer: NO! we don't know how to build for it anyway
  119. AM_CONDITIONAL(USE_X360, false)
  120. dnl Are we on a Direct3D 9 platform?
  121. #ac_cv_my_have_d3d9="no"
  122. #AC_CHECK_HEADERS(d3d9.h, [ac_cv_my_have_d3d9="yes"])
  123. #if test "${ac_cv_my_have_d3d9}" != "no"; then
  124. # D3D_LIBS="${D3D_LIBS} -ld3d9 -ld3dx9 -lxinput"
  125. # AC_DEFINE(USE_D3D9, 1, Define to 1 to use DirectX 9)
  126. #fi
  127. #AM_CONDITIONAL(USE_D3D9, test "${ac_cv_my_have_d3d9}" != "no")
  128. dnl Find which version of OpenGL to use
  129. ac_cv_my_have_gl="no"
  130. ac_cv_my_stop_looking_for_gl="no"
  131. if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
  132. LIBS_save="$LIBS"
  133. LIBS="$LIBS -Wl,-framework -Wl,OpenGL"
  134. AC_MSG_CHECKING(for -framework OpenGL)
  135. AC_TRY_LINK([], [],
  136. [AC_MSG_RESULT(yes)
  137. ac_cv_my_stop_looking_for_gl="yes"
  138. GL_LIBS="${GL_LIBS} -framework OpenGL"
  139. CXXFLAGS="${CXXFLAGS} -ObjC++"],
  140. [AC_MSG_RESULT(no)])
  141. LIBS="$LIBS_save"
  142. fi
  143. dnl Use the Raspberry Pi libraries?
  144. if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
  145. AC_CHECK_HEADERS(bcm_host.h,
  146. [AC_CHECK_LIB(vcos, main,
  147. [ac_cv_my_have_gl="yes"
  148. ac_cv_my_stop_looking_for_gl="yes"
  149. AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
  150. dnl FIXME: -lEGL does not belong here but the configure test fails
  151. dnl when cross-compiling, so we add it manually here.
  152. GL_LIBS="-lGLESv2 -lEGL -lvcos -lvchiq_arm -lbcm_host"])])
  153. fi
  154. dnl Use the PS3 PSGL?
  155. if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
  156. AC_CHECK_HEADERS(PSGL/psgl.h,
  157. [ac_cv_my_have_gl="yes"
  158. ac_cv_my_stop_looking_for_gl="yes"])
  159. fi
  160. if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
  161. PKG_CHECK_MODULES(GLES2, glesv2,
  162. [ac_cv_my_have_gl="yes"
  163. AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
  164. GL_CFLAGS="${GL_CFLAGS} ${GLES2_CFLAGS}"
  165. GL_LIBS="${GL_LIBS} ${GLES2_LIBS}"],
  166. [:])
  167. fi
  168. if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
  169. AC_CHECK_HEADER(GLES2/gl2.h,
  170. [AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
  171. ac_cv_my_have_gl="yes"])
  172. fi
  173. if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
  174. PKG_CHECK_MODULES(GL, gl,
  175. [ac_cv_my_have_gl="yes"
  176. AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available)],
  177. [:])
  178. fi
  179. if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
  180. AC_CHECK_LIB(GL, glLoadIdentity,
  181. [ac_cv_my_have_gl="yes"
  182. AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available) # FIXME: hackish
  183. GL_LIBS="-lGL"])
  184. fi
  185. if test "x${ac_cv_my_stop_looking_for_gl}" = "xno"; then
  186. AC_CHECK_HEADER(GL/gl.h,
  187. [LIBS_save="$LIBS"
  188. LIBS="$LIBS -lopengl32"
  189. AC_MSG_CHECKING(for glLoadIdentity in -lopengl32)
  190. AC_TRY_LINK([#include <GL/gl.h>],
  191. [glLoadIdentity();],
  192. [ac_cv_my_have_gl="yes"
  193. AC_DEFINE(HAVE_GL_2X, 1, Define to 1 if GL 2.x is available) # FIXME: hack
  194. AC_MSG_RESULT(yes)
  195. GL_LIBS="-lopengl32"],
  196. [AC_MSG_RESULT(no)])
  197. LIBS="$LIBS_save"])
  198. fi
  199. if test "${ac_cv_my_have_gl}" = "no"; then
  200. AC_MSG_ERROR([[No OpenGL or OpenGL ES implementation found]])
  201. fi
  202. dnl Use Glew?
  203. ac_cv_my_have_glew="no"
  204. PKG_CHECK_MODULES(GLEW, glew,
  205. [ac_cv_my_have_glew="yes"
  206. GL_CFLAGS="${GLEW_CFLAGS} ${GL_CFLAGS}"
  207. GL_LIBS="${GLEW_LIBS} ${GL_LIBS}"],
  208. [:])
  209. AC_CHECK_HEADER(glew.h,
  210. [LIBS_save="${LIBS}"
  211. LIBS="${LIBS} -lglew32 ${GL_LIBS}"
  212. AC_MSG_CHECKING(for glewInit in -lglew32)
  213. AC_TRY_LINK(
  214. [#include <glew.h>],
  215. [glewInit();],
  216. [ac_cv_my_have_glew="yes"
  217. GL_LIBS="-lglew32 ${GL_LIBS}"
  218. AC_MSG_RESULT(yes)],
  219. [AC_MSG_RESULT(no)])
  220. LIBS="${LIBS_save}"])
  221. if test "${ac_cv_my_have_glew}" != "no"; then
  222. AC_DEFINE(HAVE_GLES_2X, 1, Define to 1 if GLES 2.x is available)
  223. AC_DEFINE(USE_GLEW, 1, Define to 1 to use libglew)
  224. fi
  225. AM_CONDITIONAL(USE_GLEW, test "${ac_cv_my_have_glew}" != "no")
  226. dnl Poor man's GL feature detection if all else failed.
  227. save_LIBS="${LIBS}"
  228. LIBS="${LIBS} ${GL_LIBS} ${GLES2_LIBS}"
  229. AC_CHECK_FUNCS(glBegin)
  230. LIBS="${save_LIBS}"
  231. dnl Use SDL? (always required on Linux or Win32)
  232. ac_cv_my_have_sdl="no"
  233. ac_cv_my_have_sdl_image="no"
  234. ac_cv_my_have_sdl_mixer="no"
  235. dnl
  236. dnl First, try the proper pkg-config check
  237. PKG_CHECK_MODULES(SDL, sdl, [ac_cv_my_have_sdl="yes"], [:])
  238. PKG_CHECK_MODULES(SDLMIXER, SDL_mixer, [ac_cv_my_have_sdl_mixer="yes"], [:])
  239. PKG_CHECK_MODULES(SDLIMAGE, SDL_image, [ac_cv_my_have_sdl_image="yes"], [:])
  240. dnl
  241. dnl Then the old sdl-config method
  242. if test "x${cross_compiling}" != xyes -a "${ac_cv_my_have_sdl}" != yes; then
  243. AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
  244. if test "${SDL_CONFIG}" != "no"; then
  245. SDL_CFLAGS="${SDL_CFLAGS} `${SDL_CONFIG} --cflags`"
  246. SDL_LIBS="${SDL_LIBS} `${SDL_CONFIG} --libs`"
  247. ac_cv_my_have_sdl="yes"
  248. fi
  249. fi
  250. dnl
  251. dnl Maybe all this has failed, try direct inclusion
  252. save_CPPFLAGS="${CPPFLAGS}"
  253. save_LIBS="${LIBS}"
  254. CPPFLAGS="${CPPFLAGS} ${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}"
  255. LIBS="${LIBS} ${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}"
  256. AC_CHECK_HEADERS(SDL.h SDL/SDL.h, [ac_cv_my_have_sdl="yes"])
  257. AC_CHECK_HEADERS(SDL_mixer.h, [ac_cv_my_have_sdl_mixer="yes"])
  258. AC_CHECK_HEADERS(SDL_image.h, [ac_cv_my_have_sdl_image="yes"])
  259. AC_CHECK_LIB(SDL, main,
  260. [SDL_LIBS="${SDL_LIBS} -lSDL"],
  261. [ac_cv_my_have_sdl="no"])
  262. AC_CHECK_LIB(SDLmain, main,
  263. [SDL_LIBS="${SDL_LIBS} -lSDLmain -lSDL"])
  264. AC_CHECK_LIB(SDL_mixer, main,
  265. [SDLMIXER_LIBS="${SDLMIXER_LIBS} -lSDL_mixer"],
  266. [ac_cv_my_have_sdl_mixer="no"])
  267. AC_CHECK_LIB(SDL_image, main,
  268. [SDLIMAGE_LIBS="${SDLIMAGE_LIBS} -lSDL_image"],
  269. [ac_cv_my_have_sdl_image="no"])
  270. SDL_CFLAGS="${SDL_CFLAGS} ${SDLMIXER_CFLAGS} ${SDLIMAGE_CFLAGS}"
  271. SDL_LIBS="${SDL_LIBS} ${SDLMIXER_LIBS} ${SDLIMAGE_LIBS}"
  272. CPPFLAGS="${save_CPPFLAGS}"
  273. LIBS="${save_LIBS}"
  274. if test "${ac_cv_my_have_sdl}" = "no"; then
  275. AC_MSG_WARN([SDL not found])
  276. else
  277. AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL)
  278. fi
  279. if test "${ac_cv_my_have_sdl_mixer}" = "no"; then
  280. AC_MSG_WARN([SDL_mixer not found])
  281. else
  282. AC_DEFINE(USE_SDL_MIXER, 1, Define to 1 to use SDL_mixer)
  283. fi
  284. if test "${ac_cv_my_have_sdl_image}" = "no"; then
  285. AC_MSG_WARN([SDL_image not found])
  286. else
  287. AC_DEFINE(USE_SDL_IMAGE, 1, Define to 1 to use SDL_image)
  288. fi
  289. AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
  290. AM_CONDITIONAL(USE_SDL_MIXER, test "${ac_cv_my_have_sdl_mixer}" = "yes")
  291. AM_CONDITIONAL(USE_SDL_IMAGE, test "${ac_cv_my_have_sdl_image}" = "yes")
  292. dnl Use Flex's FlexLexer.h or ours?
  293. ac_cv_my_have_flexlexer_h="no"
  294. AC_LANG_PUSH(C++)
  295. AC_CHECK_HEADERS(FlexLexer.h, [ac_cv_my_have_flexlexer_h="yes"])
  296. AC_LANG_POP(C++)
  297. if test "x${ac_cv_my_have_flexlexer_h}" = "xno"; then
  298. LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/contrib/flex-2.5.35/include"
  299. fi
  300. dnl Use NativeClient?
  301. ac_cv_my_have_nacl="no"
  302. AC_LANG_PUSH(C++)
  303. AC_CHECK_HEADERS(ppapi/cpp/instance.h,
  304. [ac_cv_my_have_nacl="yes"
  305. dnl Disable this warning, it's too verbose with vector.h
  306. CXXFLAGS="${CXXFLAGS} -Wno-sign-compare"])
  307. AC_LANG_POP(C++)
  308. AM_CONDITIONAL(USE_NACL, test "${ac_cv_my_have_nacl}" != "no")
  309. dnl Use EGL?
  310. ac_cv_my_have_egl="no"
  311. PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:])
  312. if test "${ac_cv_my_have_egl}" != "no"; then
  313. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  314. EGL_LIBS="${EGL_LIBS} -lX11"
  315. fi
  316. AC_CHECK_LIB(EGL, main,
  317. [ac_cv_my_have_egl="yes"
  318. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  319. EGL_LIBS="-lEGL"])
  320. dnl Raspberry Pi is different, check for it with extra libs; also we
  321. dnl look for a different function to bypass autoconf caching
  322. AC_CHECK_LIB(EGL, eglGetDisplay,
  323. [ac_cv_my_have_egl="yes"
  324. AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
  325. EGL_LIBS="-lEGL -lvcos -lvchiq_arm -lbcm_host -lGLESv2"],
  326. [:],
  327. [-lvcos -lvchiq_arm -lbcm_host -lGLESv2])
  328. AM_CONDITIONAL(USE_EGL, test "${ac_cv_my_have_egl}" != "no")
  329. dnl Use libpng? (replacement for SDL_image)
  330. ac_cv_my_have_libpng="no"
  331. PKG_CHECK_MODULES(LIBPNG, libpng, [ac_cv_my_have_libpng="yes"], [:])
  332. if test "${ac_cv_my_have_libpng}" != "no"; then
  333. AC_DEFINE(USE_LIBPNG, 1, Define to 1 to use libpng)
  334. fi
  335. AM_CONDITIONAL(USE_LIBPNG, test "${ac_cv_my_have_libpng}" != "no")
  336. dnl Use Windows GDI+?
  337. ac_cv_my_have_gdiplus="no"
  338. AC_LANG_PUSH(C++)
  339. AC_CHECK_HEADERS(gdiplus.h,
  340. [ac_cv_my_have_gdiplus="yes"
  341. LOL_LIBS="${LOL_LIBS} -lgdiplus"],
  342. [ac_cv_my_have_gdiplus="no"],
  343. [#include <algorithm>
  344. using std::min;
  345. using std::max;
  346. #include <windows.h>])
  347. AC_LANG_POP(C++)
  348. if test "${ac_cv_my_have_gdiplus}" != "no"; then
  349. AC_DEFINE(USE_GDIPLUS, 1, Define to 1 to use GDI+)
  350. fi
  351. AM_CONDITIONAL(USE_GDIPLUS, test "${ac_cv_my_have_gdiplus}" = "yes")
  352. dnl Use libcaca? (required for font generation)
  353. ac_cv_my_have_caca="no"
  354. PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17, [ac_cv_my_have_caca="yes"], [:])
  355. if test "${ac_cv_my_have_caca}" != "no"; then
  356. AC_DEFINE(USE_CACA, 1, Define to 1 to use libcaca)
  357. fi
  358. AM_CONDITIONAL(USE_CACA, test "${ac_cv_my_have_caca}" != "no")
  359. dnl Use libpipi? (required for video recording)
  360. ac_cv_my_have_pipi="no"
  361. PKG_CHECK_MODULES(PIPI, pipi, [ac_cv_my_have_pipi="yes"], [:])
  362. if test "${ac_cv_my_have_pipi}" != "no"; then
  363. AC_DEFINE(USE_PIPI, 1, Define to 1 to use libpipi)
  364. fi
  365. AM_CONDITIONAL(USE_PIPI, test "${ac_cv_my_have_pipi}" != "no")
  366. dnl Use GTK+? (required for the deushax editor)
  367. ac_cv_my_have_gtkgl="no"
  368. PKG_CHECK_MODULES(GTK, gtk+-2.0, [ac_cv_my_have_gtkgl="yes"], [:])
  369. PKG_CHECK_MODULES(GTKGL, gtkgl-2.0, [:], [ac_cv_my_have_gtkgl="no"])
  370. if test "${ac_cv_my_have_gtkgl}" != "no"; then
  371. AC_DEFINE(USE_GTKGL, 1, Define to 1 to use GtkGl)
  372. fi
  373. AM_CONDITIONAL(USE_GTKGL, test "${ac_cv_my_have_gtkgl}" != "no")
  374. dnl Can we build neercs?
  375. AM_CONDITIONAL(BUILD_NEERCS, test "${ac_cv_my_have_caca}" != "no" -a "${ac_cv_header_glob_h}" = "yes")
  376. dnl LolFx compilation rule
  377. LOLFX_BUILD='(echo "char const *"; echo "lolfx_$(notdir $(basename $(filter %.lolfx, $^))) ="; $(SED) '"'"'s/"/\\"/g'"'"' $(filter %.lolfx, $^) | $(SED) '"'"'s/\([[^\r]]*\).*/"\1\\n"/'"'"'; echo ";") | $(CXXCOMPILE) -xc++ -c - -o $@'
  378. AC_SUBST(LOLFX_BUILD)
  379. dnl Extra libraries we may need
  380. AC_SUBST(MATH_LIBS)
  381. AC_SUBST(PAM_LIBS)
  382. AC_SUBST(UTIL_LIBS)
  383. dnl How to use the Lol Engine inside this tree
  384. LOL_CFLAGS="$LOL_CFLAGS -I \$(top_srcdir)/src"
  385. LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS"
  386. LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS"
  387. AC_SUBST(LOL_CFLAGS)
  388. AC_SUBST(LOL_LIBS)
  389. AC_CONFIG_FILES(
  390. [Makefile
  391. src/Makefile
  392. src/data/Makefile
  393. src/data/font/Makefile
  394. tutorial/Makefile
  395. test/Makefile
  396. test/math/Makefile
  397. test/sandbox/Makefile
  398. test/xolotl/Makefile
  399. build/Makefile
  400. binaries/Makefile
  401. games/Makefile
  402. tools/Makefile
  403. ])
  404. AC_CONFIG_FILES(
  405. [games/monsterz/Makefile
  406. ])
  407. AC_CONFIG_FILES(
  408. [games/deushax/Makefile
  409. games/deushax/art/Makefile
  410. games/deushax/art/test/Makefile
  411. games/deushax/gfx/Makefile
  412. games/deushax/maps/Makefile
  413. ])
  414. AC_CONFIG_FILES(
  415. [games/mrpigeon/Makefile
  416. ])
  417. AC_CONFIG_FILES(
  418. [games/orbital/Makefile
  419. ])
  420. AC_CONFIG_FILES(
  421. [games/ToukyDemo/Makefile
  422. ])
  423. AC_CONFIG_FILES(
  424. [tools/neercs/Makefile
  425. ])
  426. AC_OUTPUT