1 | |
---|
2 | ########################################################################## |
---|
3 | # orxonox - the future of 3D-vertical-scrollers # |
---|
4 | # # |
---|
5 | # Copyright (C) 2004 orx # |
---|
6 | # # |
---|
7 | # This program is free software; you can redistribute it and/or modify # |
---|
8 | # it under the terms of the GNU General Public License as published by # |
---|
9 | # the Free Software Foundation; either version 2, or (at your option) # |
---|
10 | # any later version. # |
---|
11 | # # |
---|
12 | # ### File Specific: # |
---|
13 | # main-programmer: Benjamin Grauer # |
---|
14 | # co-programmer: ... # |
---|
15 | # # |
---|
16 | # This is the main configuration File of autoconf. # |
---|
17 | # Please edit this file only, if you exactly know what you are doing. # |
---|
18 | # It is quite fragile, and compiling orxonox on different Platforms # |
---|
19 | # is only guarantied, if build with the right config. # |
---|
20 | # # |
---|
21 | # be sure to visit us at http://www.orxonox.net # |
---|
22 | ########################################################################## |
---|
23 | |
---|
24 | ######################### |
---|
25 | ## AUTOCONF INIT PHASE ## |
---|
26 | ######################### |
---|
27 | AC_PREREQ(2.59) |
---|
28 | AC_INIT([orxonox], [0.3.2_alpha], [orxonox-dev at mail.datacore.ch]) |
---|
29 | |
---|
30 | ## Detect the canonical host and target build environment. |
---|
31 | AC_CANONICAL_BUILD |
---|
32 | AC_CANONICAL_HOST |
---|
33 | AC_CANONICAL_TARGET |
---|
34 | |
---|
35 | AM_INIT_AUTOMAKE |
---|
36 | |
---|
37 | AC_CONFIG_SRCDIR([./src]) |
---|
38 | AC_CONFIG_HEADER([config.h]) |
---|
39 | |
---|
40 | ######################### |
---|
41 | ## Checks for programs ## |
---|
42 | ######################### |
---|
43 | AC_PROG_CXX |
---|
44 | AC_PROG_RANLIB |
---|
45 | AC_HEADER_STDC |
---|
46 | |
---|
47 | ## THIS IS OUR DEFAULT-DATA-DIRECTORY |
---|
48 | |
---|
49 | ################################## |
---|
50 | ## CHECKING OPTIONAL ARGUMENTS ## |
---|
51 | ################################## |
---|
52 | #----------------# |
---|
53 | # Data-Directory # |
---|
54 | #----------------# |
---|
55 | DATA_DIR=$datadir |
---|
56 | echo \$\{prefix\} |
---|
57 | if test $DATA_DIR = \$\{prefix\}/share ; then |
---|
58 | echo "not given" |
---|
59 | DATA_DIR=/usr/share |
---|
60 | else |
---|
61 | echo "given: $DATA_DIR" |
---|
62 | fi |
---|
63 | AC_DEFINE_UNQUOTED([DATADIR], ["$DATA_DIR"], |
---|
64 | [Define to the read-only architecture-independent |
---|
65 | data directory.]) |
---|
66 | |
---|
67 | #-----------------# |
---|
68 | # shared-lib-path # |
---|
69 | #-----------------# |
---|
70 | SHARED_LIB_PATH=no |
---|
71 | AC_MSG_CHECKING([shared lib path]) |
---|
72 | AC_ARG_WITH([shared-lib-path], |
---|
73 | AS_HELP_STRING(--with-shared-lib-path,Tells the executable, where to look for the shared libraries.), |
---|
74 | SHARED_LIB_PATH=$withval) |
---|
75 | if test x$SHARED_LIB_PATH != xno; then |
---|
76 | echo "set to $SHARED_LIB_PATH" |
---|
77 | else |
---|
78 | echo "no" |
---|
79 | fi |
---|
80 | |
---|
81 | |
---|
82 | #-----------------# |
---|
83 | # DEBUG-statement # |
---|
84 | #-----------------# |
---|
85 | DEBUG=no |
---|
86 | AC_MSG_CHECKING([if DEBUG-mode should be enabled]) |
---|
87 | AC_ARG_ENABLE([debug], |
---|
88 | AS_HELP_STRING(--enable-debug,compiles in debug mode. Lots of debug info about the game.), |
---|
89 | DEBUG=$enableval) |
---|
90 | |
---|
91 | if test x$DEBUG = xno; then |
---|
92 | echo "no" |
---|
93 | echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed." |
---|
94 | DEBUG=4 |
---|
95 | elif test x$DEBUG = xyes; then |
---|
96 | echo "yes" |
---|
97 | echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!." |
---|
98 | DEBUG=4 |
---|
99 | else |
---|
100 | echo "yes: setting debuglevel to to $DEBUG" |
---|
101 | fi |
---|
102 | AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are]) |
---|
103 | AC_SUBST(DEBUG) |
---|
104 | |
---|
105 | #---------------# |
---|
106 | # Modular Debug # |
---|
107 | #---------------# |
---|
108 | MODULAR_DEBUG=yes |
---|
109 | AC_MSG_CHECKING([if Modular-DEBUG-mode should be ebabled]) |
---|
110 | AC_ARG_ENABLE([modular-debug], |
---|
111 | AS_HELP_STRING(--disable-modular-debug,compiles in modular-debug mode, that logs differently on the many modules of orxonox.), |
---|
112 | MODULAR_DEBUG=$enableval) |
---|
113 | |
---|
114 | if test x$MODULAR_DEBUG = xno; then |
---|
115 | echo "no" |
---|
116 | elif test x$MODULAR_DEBUG = xyes; then |
---|
117 | echo "yes" |
---|
118 | AC_DEFINE_UNQUOTED(MODULAR_DEBUG, 1, [if Modular-DUBUG mode is enabled]) |
---|
119 | fi |
---|
120 | |
---|
121 | #--------------# |
---|
122 | # GTK-disabled # |
---|
123 | #--------------# |
---|
124 | AC_MSG_CHECKING([if gtk should be enabled]) |
---|
125 | AC_ARG_ENABLE([gtk], |
---|
126 | AS_HELP_STRING(--disable-gtk,Prevents GTK from being loaded), [def_gtk=no], [def_gtk=yes]) |
---|
127 | if test x$def_gtk = xyes; then |
---|
128 | echo "yes" |
---|
129 | fi |
---|
130 | if test x$def_gtk = xno; then |
---|
131 | echo "no" |
---|
132 | fi |
---|
133 | |
---|
134 | #------------------# |
---|
135 | # libCurl-disabled # |
---|
136 | #------------------# |
---|
137 | AC_MSG_CHECKING([if libcURL should be enabled]) |
---|
138 | AC_ARG_ENABLE([curl], |
---|
139 | AS_HELP_STRING(--disable-curl,Prevents libcURL from being loaded), [def_curl=no], [def_curl=yes]) |
---|
140 | if test x$def_curl = xyes; then |
---|
141 | echo "yes" |
---|
142 | fi |
---|
143 | if test x$def_curl = xno; then |
---|
144 | echo "no" |
---|
145 | fi |
---|
146 | |
---|
147 | #-------------------# |
---|
148 | # SubProject-enable # |
---|
149 | #-------------------# |
---|
150 | def_sub_projects=no |
---|
151 | AC_MSG_CHECKING([if the SubProjects should be built]) |
---|
152 | AC_ARG_WITH([sub-projects], |
---|
153 | AS_HELP_STRING(--with-sub-projects,also builds the subProjects while make from srcdir), [def_sub_projects=yes]) |
---|
154 | if test x$def_sub_projects = xyes; then |
---|
155 | echo "yes" |
---|
156 | fi |
---|
157 | if test x$def_sub_projects = xno; then |
---|
158 | echo "no" |
---|
159 | fi |
---|
160 | AM_CONDITIONAL(SUB_PROJECTS, test x$def_sub_projects = xyes) |
---|
161 | |
---|
162 | #-------------------# |
---|
163 | # Profiling Enabled # |
---|
164 | #-------------------# |
---|
165 | def_profiling=no |
---|
166 | AC_MSG_CHECKING([if Profiling should be enabled]) |
---|
167 | AC_ARG_ENABLE([profile], |
---|
168 | AS_HELP_STRING(--enable-profile,builds orxonox with profiling support), [def_profiling=yes]) |
---|
169 | if test x$def_profiling = xyes; then |
---|
170 | echo "yes" |
---|
171 | CXXFLAGS="$CXXFLAGS -pg" |
---|
172 | fi |
---|
173 | if test x$def_profiling = xno; then |
---|
174 | echo "no" |
---|
175 | fi |
---|
176 | |
---|
177 | #----------------# |
---|
178 | # efence Enabled # |
---|
179 | #----------------# |
---|
180 | def_efence=no |
---|
181 | AC_MSG_CHECKING([if efence should be enabled]) |
---|
182 | AC_ARG_ENABLE([efence], |
---|
183 | AS_HELP_STRING(--enable-efence,builds orxonox with efence support), [def_efence=yes]) |
---|
184 | if test x$def_efence = xyes; then |
---|
185 | echo "yes" |
---|
186 | fi |
---|
187 | if test x$def_efence = xno; then |
---|
188 | echo "no" |
---|
189 | fi |
---|
190 | |
---|
191 | #----------------------# |
---|
192 | # Documentation-enable # |
---|
193 | #----------------------# |
---|
194 | def_documentation=no |
---|
195 | AC_MSG_CHECKING([if the Documentation should be build by default]) |
---|
196 | AC_ARG_ENABLE([documentation], |
---|
197 | AS_HELP_STRING(--enable-documentation,also builds the sDocumentation while make from srcdir), [def_documentation=yes]) |
---|
198 | if test x$def_documentation = xyes; then |
---|
199 | echo "yes" |
---|
200 | fi |
---|
201 | if test x$def_documentation = xno; then |
---|
202 | echo "no" |
---|
203 | fi |
---|
204 | AM_CONDITIONAL(DOCUMENTATION, test x$def_documentation = xyes) |
---|
205 | |
---|
206 | |
---|
207 | |
---|
208 | #---------------------------# |
---|
209 | # WITH TARDIS (convenience) # |
---|
210 | #---------------------------# |
---|
211 | def_tardis=no |
---|
212 | GTKPATH="" |
---|
213 | AC_MSG_CHECKING([convenience flag for working at the taris in the ETH zurich]) |
---|
214 | AC_ARG_WITH([tardis], |
---|
215 | AS_HELP_STRING(--with-tardis,sets all the necesary environment flags for linux-TARDIS boxes at the ETH Zurich), [def_tardis=yes]) |
---|
216 | if test x$def_tardis = xyes; then |
---|
217 | ARCH=i686-debian-linux3.1 |
---|
218 | ## GAMELIBS |
---|
219 | PREFIX=/usr/pack/gamelibs-1.0-to |
---|
220 | CPPFLAGS="${CPPFLAGS} -I${PREFIX}/include" |
---|
221 | LDFLAGS="${LDFLAGS} -L$PREFIX/${ARCH}/lib -Wl,-rpath -Wl,${PREFIX}/${ARCH}/lib" |
---|
222 | ## GTK |
---|
223 | GTKPREFIX=/usr/pack/gtk-2.8.3-mo |
---|
224 | GTKPATH=${GTKPREFIX}/${ARCH}/bin |
---|
225 | CPPFLAGS="${CPPFLAGS} -I${GTKPREFIX}/include" |
---|
226 | LDFLAGS="${LDFLAGS} -L${GTKPREFIX}/${ARCH}/lib -Wl,-rpath -Wl,${GTKPREFIX}/${ARCH}/lib" |
---|
227 | echo "yes" |
---|
228 | fi |
---|
229 | if test x$def_tardis = xno; then |
---|
230 | echo "no" |
---|
231 | fi |
---|
232 | |
---|
233 | ####################### |
---|
234 | ## PROGRAMM CHECKING ## |
---|
235 | ## 3. party Programs ## |
---|
236 | ####################### |
---|
237 | |
---|
238 | #----------------------# |
---|
239 | # checking for Doxygen # |
---|
240 | #----------------------# |
---|
241 | AC_PATH_PROG(DOXYGEN, doxygen) |
---|
242 | AM_CONDITIONAL(DOXYGEN, test $DOXYGEN) |
---|
243 | |
---|
244 | #--------------------# |
---|
245 | # checking for gprof # |
---|
246 | #--------------------# |
---|
247 | AC_PATH_PROG(GPROF, gprof) |
---|
248 | |
---|
249 | #-------------------------# |
---|
250 | # checking for pkg-config # |
---|
251 | #-------------------------# |
---|
252 | if test x$def_gtk = xyes; then |
---|
253 | if test x${GTKPATH} != x; then |
---|
254 | AC_PATH_PROG([PKG_CONFIG], [pkg-config],[], $GTKPATH ) |
---|
255 | else |
---|
256 | AC_PATH_PROG(PKG_CONFIG, pkg-config ) |
---|
257 | fi |
---|
258 | fi |
---|
259 | |
---|
260 | |
---|
261 | ######################### |
---|
262 | ## CHECKING FOR SYSTEM ## |
---|
263 | ######################### |
---|
264 | ## here the system is checked, and openGL is included |
---|
265 | ## also checking for SDL on differen Systems |
---|
266 | |
---|
267 | AC_MSG_CHECKING([for System]) |
---|
268 | ## checking for openGL-environment and other sys-specific parameters |
---|
269 | case "$target" in |
---|
270 | |
---|
271 | ########### |
---|
272 | #---------# |
---|
273 | # WINDOWS # |
---|
274 | #---------# |
---|
275 | ########### |
---|
276 | *-*-mingw32*) |
---|
277 | echo "mingw-WINDOWS detected" |
---|
278 | |
---|
279 | CPPFLAGS="-I/usr/include -I/mingw/include $CPPFLAGS" |
---|
280 | |
---|
281 | mingw="yes" |
---|
282 | MSBITFIELDS="-mms-bitfields" |
---|
283 | MWINDOWS="-mwindows" |
---|
284 | |
---|
285 | #--------# |
---|
286 | # MIN-GW # |
---|
287 | #--------# |
---|
288 | # checking for mingw32 |
---|
289 | AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) |
---|
290 | if test x$FOUND_mingw32 = xyes; then |
---|
291 | LIBS="$LIBS -lmingw32" |
---|
292 | fi |
---|
293 | |
---|
294 | #---------------# |
---|
295 | # open-GL (win) # |
---|
296 | #---------------# |
---|
297 | # checking gl header |
---|
298 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
299 | [AC_MSG_ERROR([cannot find opengl headers])]) |
---|
300 | # checking for Windows openGl library |
---|
301 | AC_CHECK_LIB([opengl32], [main], [FOUND_GL=yes; LIBS="$LIBS -lopengl32"]) |
---|
302 | if test x$FOUND_GL != xyes ; then |
---|
303 | echo "------------------" |
---|
304 | echo "opengl not found." |
---|
305 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
306 | echo "------------------" |
---|
307 | exit -1 |
---|
308 | fi |
---|
309 | |
---|
310 | # cheking for GLU-header |
---|
311 | AC_CHECK_HEADERS([GL/glu.h] ,, |
---|
312 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
313 | |
---|
314 | # checking for libGLU |
---|
315 | AC_CHECK_LIB([glu32], [main], [FOUND_GLU=yes; LIBS="$LIBS -lGLU32"]) |
---|
316 | if test x$FOUND_GLU != xyes ; then |
---|
317 | echo "------------------" |
---|
318 | echo "GLU library not found." |
---|
319 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
320 | echo "------------------" |
---|
321 | exit -1 |
---|
322 | fi |
---|
323 | |
---|
324 | # checking glew header |
---|
325 | AC_CHECK_HEADERS(GL/glew.h ,, |
---|
326 | [AC_MSG_ERROR([cannot find opengl extension wrangler headers]) ]) |
---|
327 | # checking for Windows glew library |
---|
328 | AC_CHECK_LIB([glew32], [main], [FOUND_GLEW=yes; LIBS="$LIBS -lglew32"]) |
---|
329 | if test x$FOUND_GLEW != xyes ; then |
---|
330 | echo "------------------" |
---|
331 | echo "opengl extension wrangler not found." |
---|
332 | echo "please install the glew package which can be found at http://glew.sourceforge.net" |
---|
333 | echo "------------------" |
---|
334 | exit -1 |
---|
335 | fi |
---|
336 | |
---|
337 | #--------# |
---|
338 | # openAL # |
---|
339 | #--------# |
---|
340 | # checking for openAL-headers |
---|
341 | AC_CHECK_HEADERS([AL/al.h] ,, |
---|
342 | [AC_MSG_ERROR([cannot find openAL header.])]) |
---|
343 | # checking for openAL-lib |
---|
344 | AC_CHECK_LIB([OpenAL32], [main], [FOUND_OPENAL=yes; LIBS="$LIBS -lOpenAL32"]) |
---|
345 | AC_CHECK_LIB([ALut], [main], [FOUND_ALUT=yes; LIBS="-lALut $LIBS"]) |
---|
346 | if test x$FOUND_OPENAL != xyes ; then |
---|
347 | echo "------------------" |
---|
348 | echo "openal library not found." |
---|
349 | echo "please install the openal library, which can be found at http://www.openal.org" |
---|
350 | echo "------------------" |
---|
351 | exit -1 |
---|
352 | fi |
---|
353 | |
---|
354 | |
---|
355 | #-----------# |
---|
356 | # SDL(win) # |
---|
357 | #-----------# |
---|
358 | # checking for SDL-headers |
---|
359 | AC_CHECK_HEADERS([SDL/SDL.h] ,, |
---|
360 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
361 | |
---|
362 | #checking for libSDL |
---|
363 | AC_CHECK_LIB([sdlmain], [main], [FOUND_sdlmain=yes; LIBS="$LIBS -lsdlmain"]) |
---|
364 | if test x$FOUND_sdlmain != xyes ; then |
---|
365 | echo "------------------" |
---|
366 | echo "SDL library not found." |
---|
367 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
368 | echo "------------------" |
---|
369 | exit 1 |
---|
370 | fi |
---|
371 | AC_CHECK_LIB([sdl], [main], [FOUND_SDL=yes; LIBS="$LIBS -lsdl"]) |
---|
372 | if test x$FOUND_SDL != xyes ; then |
---|
373 | echo "------------------" |
---|
374 | echo "SDL library not found." |
---|
375 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
376 | echo "------------------" |
---|
377 | exit -1 |
---|
378 | fi |
---|
379 | |
---|
380 | ;; |
---|
381 | |
---|
382 | ######### |
---|
383 | #-------# |
---|
384 | # LINUX # |
---|
385 | #-------# |
---|
386 | ######### |
---|
387 | *-*-linux*) |
---|
388 | echo "Linux detected" |
---|
389 | |
---|
390 | Linux="yes" |
---|
391 | |
---|
392 | ##CPPFLAGS="-I/usr/include $CPPFLAGS" |
---|
393 | ##LDFLAGS="-L/usr/lib $LDFLAGS" |
---|
394 | if test x$SHARED_LIB_PATH != xno; then |
---|
395 | echo "setting new LDFLAGS with $SHARED_LIB_PATH" |
---|
396 | LDFLAGS="-Wl,-rpath,$SHARED_LIB_PATH -L$SHARED_LIB_PATH $LDFLAGS" |
---|
397 | fi |
---|
398 | |
---|
399 | #--------# |
---|
400 | # openGL # |
---|
401 | #--------# |
---|
402 | # checking gl header |
---|
403 | AC_CHECK_HEADERS([GL/gl.h] ,, |
---|
404 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
405 | |
---|
406 | # checking for Unix GL |
---|
407 | AC_CHECK_LIB([GL], [main], [FOUND_GL=yes; LIBS="$LIBS -lGL"]) |
---|
408 | if test x$FOUND_GL != xyes ; then |
---|
409 | echo "------------------" |
---|
410 | echo "opengl not found." |
---|
411 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
412 | echo "------------------" |
---|
413 | exit -1 |
---|
414 | fi |
---|
415 | |
---|
416 | # cheking for GLU-header |
---|
417 | AC_CHECK_HEADERS([GL/glu.h] ,, |
---|
418 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
419 | AC_CHECK_LIB([GLU], [main], [FOUND_GLU=yes; LIBS="$LIBS -lGLU"]) |
---|
420 | if test x$FOUND_GLU != xyes ; then |
---|
421 | echo "------------------" |
---|
422 | echo "GLU library not found." |
---|
423 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
424 | echo "------------------" |
---|
425 | exit -1 |
---|
426 | fi |
---|
427 | |
---|
428 | # checking for GLEW-headers |
---|
429 | AC_CHECK_HEADERS([GL/glew.h] ,, |
---|
430 | [AC_MSG_ERROR([cannot find glew headers]) ]) |
---|
431 | # checking for GLEW-lib |
---|
432 | AC_CHECK_LIB([GLEW], [main], [FOUND_GLEW=yes; LIBS="$LIBS -lGLEW"]) |
---|
433 | if test x$FOUND_GLEW != xyes ; then |
---|
434 | echo "------------------" |
---|
435 | echo "glew not found." |
---|
436 | echo "please install the glew package which can be found at http://glew.sourceforge.net" |
---|
437 | echo "------------------" |
---|
438 | exit -1 |
---|
439 | fi |
---|
440 | |
---|
441 | #--------# |
---|
442 | # openAL # |
---|
443 | #--------# |
---|
444 | # checking for openAL-headers |
---|
445 | AC_CHECK_HEADERS([AL/al.h] ,, |
---|
446 | [AC_MSG_ERROR([cannot find openAL header.])]) |
---|
447 | # checking for openAL-lib |
---|
448 | AC_CHECK_LIB([openal], [main], [FOUND_OPENAL=yes; LIBS="$LIBS -lopenal"]) |
---|
449 | if test x$FOUND_OPENAL != xyes ; then |
---|
450 | echo "------------------" |
---|
451 | echo "openal library not found." |
---|
452 | echo "please install the openal library, which can be found at http://www.openal.org" |
---|
453 | echo "------------------" |
---|
454 | exit -1 |
---|
455 | fi |
---|
456 | # checking for alut |
---|
457 | AC_CHECK_HEADERS([AL/alut.h] ,, |
---|
458 | [AC_MSG_ERROR([cannot find openAL Utility Toolkit (alut) header.])]) |
---|
459 | AC_CHECK_LIB([alut], [main], [FOUND_ALUT=yes; LIBS="-lalut $LIBS"]) |
---|
460 | |
---|
461 | #-----# |
---|
462 | # SDL # |
---|
463 | #-----# |
---|
464 | # checking for SDL |
---|
465 | AC_MSG_CHECKING([for SDL-version]) |
---|
466 | SDL_VERSION=`sdl-config --version` |
---|
467 | echo $SDL_VERSION |
---|
468 | |
---|
469 | CPPFLAGS="$CPPFLAGS `sdl-config --cflags`" |
---|
470 | AC_CHECK_HEADERS([SDL.h] ,, |
---|
471 | [AC_CHECK_HEADERS([SDL/SDL.h] ,,AC_MSG_ERROR([cannot find SDL header. please download from libsdl.org])])) |
---|
472 | LIBS="`sdl-config --libs` $LIBS" |
---|
473 | AC_CHECK_LIB([SDL], [main], [FOUND_SDL=yes]) |
---|
474 | if test x$FOUND_SDL != xyes ; then |
---|
475 | echo "------------------" |
---|
476 | echo "SDL library not found." |
---|
477 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
478 | echo "------------------" |
---|
479 | exit -1 |
---|
480 | fi |
---|
481 | |
---|
482 | ;; |
---|
483 | |
---|
484 | ############# |
---|
485 | #-----------# |
---|
486 | # MAC -OS X # |
---|
487 | #-----------# |
---|
488 | ############# |
---|
489 | *darwin*) |
---|
490 | echo "OS X detected" |
---|
491 | |
---|
492 | osX="yes" |
---|
493 | |
---|
494 | CPPFLAGS="-I/sw/include -I/sw/include $CPPFLAGS" |
---|
495 | LDFLAGS="$LDFLAGS -L/sw/lib" |
---|
496 | # checking gl header |
---|
497 | AC_CHECK_HEADERS([OpenGL/gl.h] ,, |
---|
498 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
499 | # cheking for GLU-header |
---|
500 | AC_CHECK_HEADERS([OpenGL/glu.h] ,, |
---|
501 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
502 | |
---|
503 | LIBS="$LIBS -framework OpenGL" |
---|
504 | |
---|
505 | |
---|
506 | |
---|
507 | # checking for GLEW-headers |
---|
508 | AC_CHECK_HEADERS([GL/glew.h] ,, |
---|
509 | [AC_MSG_ERROR([cannot find glew headers]) ]) |
---|
510 | # checking for GLEW-lib |
---|
511 | AC_CHECK_LIB([GLEW], [main], [FOUND_GLEW=yes; LIBS="$LIBS -lGLEW"]) |
---|
512 | if test x$FOUND_GLEW != xyes ; then |
---|
513 | echo "------------------" |
---|
514 | echo "glew not found." |
---|
515 | echo "please install the glew package which can be found at http://glew.sourceforge.net" |
---|
516 | echo "------------------" |
---|
517 | exit -1 |
---|
518 | fi |
---|
519 | |
---|
520 | |
---|
521 | AC_CHECK_HEADERS([OpenAL/al.h] ,, |
---|
522 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
523 | HAVE_OPENAL=yes |
---|
524 | LIBS="$LIBS -framework OpenAL" |
---|
525 | |
---|
526 | |
---|
527 | ## SDL-check |
---|
528 | SDL_CFLAGS=`sdl-config --cflags` |
---|
529 | SDL_LIBS=`sdl-config --libs` |
---|
530 | CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" |
---|
531 | LIBS="$LIBS $SDL_LIBS" |
---|
532 | AC_CHECK_HEADERS([SDL/SDL.h] ,, |
---|
533 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
534 | HAVE_SDL=yes |
---|
535 | # LIBS="$LIBS -framework SDL" |
---|
536 | |
---|
537 | # checking for SDL-headers |
---|
538 | # AC_CHECK_HEADERS(SDL/SDL.h ,, |
---|
539 | # [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
540 | |
---|
541 | ## checking for SDL |
---|
542 | # SDL_VERSION=1.2.7 |
---|
543 | # AM_PATH_SDL($SDL_VERSION, |
---|
544 | # :, |
---|
545 | # AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) |
---|
546 | # ) |
---|
547 | |
---|
548 | |
---|
549 | ;; |
---|
550 | |
---|
551 | *) |
---|
552 | ;; |
---|
553 | esac |
---|
554 | |
---|
555 | AC_SUBST(MSBITFIELDS) |
---|
556 | |
---|
557 | ################################### |
---|
558 | ## CHECKING FOR HEADERS AND LIBS ## |
---|
559 | ################################### |
---|
560 | |
---|
561 | #---------# |
---|
562 | # SDL_ttf # |
---|
563 | #---------# |
---|
564 | # checking for SDL_ttf-headers |
---|
565 | AC_CHECK_HEADERS([SDL_ttf.h] ,, |
---|
566 | [AC_CHECK_HEADERS([SDL/SDL_ttf.h] ,,AC_MSG_ERROR([cannot find SDL_ttf header.])])) |
---|
567 | # checking for SDL_ttf-lib |
---|
568 | AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], [FOUND_SDL_ttf=yes; LIBS="$LIBS -lSDL_ttf"]) |
---|
569 | if test x$FOUND_SDL_ttf != xyes ; then |
---|
570 | echo "------------------" |
---|
571 | echo "SDL_ttf library not found." |
---|
572 | echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/" |
---|
573 | echo "------------------" |
---|
574 | exit -1 |
---|
575 | fi |
---|
576 | |
---|
577 | #-----------# |
---|
578 | # SDL_Image # |
---|
579 | #-----------# |
---|
580 | # checking for SDL_image-headers |
---|
581 | AC_CHECK_HEADERS([SDL_image.h] ,, |
---|
582 | [AC_CHECK_HEADERS([SDL/SDL_image.h],, AC_MSG_ERROR([SDL_image header not found.]))]) |
---|
583 | # checking for SDL_image-lib |
---|
584 | AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes; LIBS="$LIBS -lSDL_image"]) |
---|
585 | if test x$FOUND_SDL_image != xyes ; then |
---|
586 | echo "------------------" |
---|
587 | echo "SDL_image library not found." |
---|
588 | echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/" |
---|
589 | echo "------------------" |
---|
590 | exit -1 |
---|
591 | fi |
---|
592 | |
---|
593 | #---------# |
---|
594 | # SDL_Net # |
---|
595 | #---------# |
---|
596 | # checking for SDL_net-headers |
---|
597 | AC_CHECK_HEADERS([SDL_net.h] ,, |
---|
598 | [AC_CHECK_HEADERS([SDL/SDL_net.h],, AC_MSG_ERROR([SDL_net header not found.]))]) |
---|
599 | # checking for SDL_net-lib |
---|
600 | AC_CHECK_LIB([SDL_net], [main], [FOUND_SDL_net=yes; LIBS="$LIBS -lSDL_net"]) |
---|
601 | if test x$FOUND_SDL_net != xyes ; then |
---|
602 | echo "------------------" |
---|
603 | echo "SDL_net library not found." |
---|
604 | echo "please install the SDL_net library, which can be found at http://www.libsdl.org/projects/SDL_net/" |
---|
605 | echo "------------------" |
---|
606 | exit -1 |
---|
607 | fi |
---|
608 | |
---|
609 | |
---|
610 | #-----# |
---|
611 | # ogg # |
---|
612 | #-----# |
---|
613 | # checking for ogg-headers |
---|
614 | AC_CHECK_HEADERS([ogg/ogg.h] ,, |
---|
615 | [AC_MSG_ERROR([cannot find ogg header.])]) |
---|
616 | # checking for ogg-lib |
---|
617 | AC_CHECK_LIB([ogg], [main], [FOUND_ogg=yes; LIBS="$LIBS -logg"]) |
---|
618 | if test x$FOUND_ogg != xyes ; then |
---|
619 | echo "------------------" |
---|
620 | echo "ogg library not found." |
---|
621 | echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
622 | echo "------------------" |
---|
623 | exit -1 |
---|
624 | fi |
---|
625 | |
---|
626 | #--------# |
---|
627 | # vorbis # |
---|
628 | #--------# |
---|
629 | # checking for vorbis-lib |
---|
630 | AC_CHECK_LIB([vorbis], [main], [FOUND_vorbis=yes; LIBS="$LIBS -lvorbis"]) |
---|
631 | if test x$FOUND_vorbis != xyes ; then |
---|
632 | echo "------------------" |
---|
633 | echo "vorbis library not found." |
---|
634 | echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
635 | echo "------------------" |
---|
636 | exit -1 |
---|
637 | fi |
---|
638 | |
---|
639 | #------------# |
---|
640 | # vorbisfile # |
---|
641 | #------------# |
---|
642 | # checking for vorbis-headers |
---|
643 | AC_CHECK_HEADERS([vorbis/vorbisfile.h] ,, |
---|
644 | [AC_MSG_ERROR([cannot find vorbisfile header.])]) |
---|
645 | # checking for vorbisfile-lib |
---|
646 | AC_CHECK_LIB([vorbisfile], [main], [FOUND_vorbisfile=yes; LIBS="$LIBS -lvorbisfile"]) |
---|
647 | if test x$FOUND_vorbisfile != xyes ; then |
---|
648 | echo "------------------" |
---|
649 | echo "vorbisfile library not found." |
---|
650 | echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
651 | echo "------------------" |
---|
652 | exit -1 |
---|
653 | fi |
---|
654 | |
---|
655 | |
---|
656 | #--------# |
---|
657 | # FFmpeg # |
---|
658 | #--------# |
---|
659 | # checking for FFmpeg-headers |
---|
660 | AC_CHECK_HEADERS([avformat.h] ,, |
---|
661 | [AC_CHECK_HEADERS([ffmpeg/avformat.h] ,,AC_MSG_ERROR([cannot find FFmpeg header.])])) |
---|
662 | # checking for ffmpeg-lib |
---|
663 | AC_CHECK_LIB([avformat], [main], [FOUND_avformat=yes; LIBS="$LIBS -lavformat"]) |
---|
664 | if test x$FOUND_avformat != xyes ; then |
---|
665 | echo "------------------" |
---|
666 | echo "avformat library not found." |
---|
667 | echo "please install the FFmpeg library, which can be found at http://ffmpeg.sourceforge.net" |
---|
668 | echo "------------------" |
---|
669 | exit -1 |
---|
670 | fi |
---|
671 | AC_CHECK_HEADERS([avcodec.h] ,, |
---|
672 | [AC_CHECK_HEADERS([ffmpeg/avcodec.h] ,,AC_MSG_ERROR([cannot find FFmpeg header.])])) |
---|
673 | AC_CHECK_LIB([avcodec], [main], [FOUND_avcodec=yes; LIBS="$LIBS -lavcodec"]) |
---|
674 | if test x$FOUND_avcodec != xyes ; then |
---|
675 | echo "------------------" |
---|
676 | echo "avcodec library not found." |
---|
677 | echo "please install the FFmpeg library, which can be found at http://ffmpeg.sourceforge.net" |
---|
678 | echo "------------------" |
---|
679 | exit -1 |
---|
680 | fi |
---|
681 | AC_CHECK_LIB([avutil], [main], [FOUND_avutil=yes; LIBS="$LIBS -lavutil"]) |
---|
682 | |
---|
683 | AC_CHECK_LIB([theora], [main], [FOUND_theora=yes; LIBS="$LIBS -ltheora"]) |
---|
684 | |
---|
685 | AC_CHECK_LIB([dts], [main], [FOUND_dts=yes; LIBS="$LIBS -ldts"]) |
---|
686 | |
---|
687 | AC_CHECK_LIB([gsm], [main], [FOUND_gsm=yes; LIBS="$LIBS -lgsm"]) |
---|
688 | |
---|
689 | AC_CHECK_LIB([dc1394_control], [main], [FOUND_dc1394_control=yes; LIBS="$LIBS -ldc1394_control"]) |
---|
690 | |
---|
691 | AC_CHECK_LIB([vorbisenc], [main], [FOUND_vorbisenc=yes; LIBS="$LIBS -lvorbisenc"]) |
---|
692 | |
---|
693 | #---------# |
---|
694 | # libcURL # |
---|
695 | #---------# |
---|
696 | if test x$def_curl = xyes; then |
---|
697 | AC_CHECK_HEADERS([curl/curl.h], [curlHeader=yes], [curlHeader=no]) |
---|
698 | AC_CHECK_LIB([curl], [main], [FOUND_curl=yes]) |
---|
699 | if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then |
---|
700 | have_curl=yes |
---|
701 | CURL_LIBS=`curl-config --libs` |
---|
702 | CURLCFLAGS=`curl-config --cflags` |
---|
703 | AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL]) |
---|
704 | else |
---|
705 | have_curl=no |
---|
706 | fi |
---|
707 | |
---|
708 | fi |
---|
709 | AC_SUBST(CURL_LIBS) |
---|
710 | AC_SUBST(CURL_CFLAGS) |
---|
711 | AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes) |
---|
712 | |
---|
713 | #--------# |
---|
714 | # efence # |
---|
715 | #--------# |
---|
716 | if test x$def_efence = xyes ; then |
---|
717 | AC_CHECK_LIB([efence], [main], [FOUND_efence=yes; LIBS="$LIBS -lefence"]) |
---|
718 | if test x$FOUND_efence != xyes ; then |
---|
719 | echo "efence was requested, but is not installed!! going on" |
---|
720 | fi |
---|
721 | |
---|
722 | fi |
---|
723 | |
---|
724 | #-----# |
---|
725 | # GTK # |
---|
726 | #-----# |
---|
727 | if test x$def_gtk = xyes; then |
---|
728 | #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no) |
---|
729 | AC_MSG_CHECKING([for gtk2.0]) |
---|
730 | if `$PKG_CONFIG --exists gtk+-2.0`; then |
---|
731 | echo "yes" |
---|
732 | have_gtk2=yes |
---|
733 | GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0` |
---|
734 | GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` |
---|
735 | AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2]) |
---|
736 | if test $DEBUG -ge 3; then |
---|
737 | echo "cflags: $GTK2_CFLAGS" |
---|
738 | echo "libs: $GTK2_LIBS" |
---|
739 | fi |
---|
740 | else |
---|
741 | echo "no" |
---|
742 | fi |
---|
743 | |
---|
744 | fi |
---|
745 | AC_SUBST(GTK2_LIBS) |
---|
746 | AC_SUBST(GTK2_CFLAGS) |
---|
747 | AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes) |
---|
748 | |
---|
749 | |
---|
750 | # FIXME: Replace `main' with a function in `-lm': |
---|
751 | AC_CHECK_LIB([m], [main]) |
---|
752 | |
---|
753 | |
---|
754 | # Checks for header files. |
---|
755 | AC_HEADER_STDC |
---|
756 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
757 | |
---|
758 | # Checks for typedefs, structures, and compiler characteristics. |
---|
759 | AC_HEADER_STDBOOL |
---|
760 | |
---|
761 | # Checks for library functions. |
---|
762 | AC_FUNC_MALLOC |
---|
763 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
764 | |
---|
765 | ###################### |
---|
766 | ## OUTPUT CONFIGURE ## |
---|
767 | ###################### |
---|
768 | AC_CONFIG_FILES([Makefile |
---|
769 | src/Makefile |
---|
770 | src/lib/Makefile |
---|
771 | src/lib/graphics/Makefile |
---|
772 | src/lib/graphics/importer/Makefile |
---|
773 | src/lib/graphics/spatial_separation/Makefile |
---|
774 | src/lib/sound/Makefile |
---|
775 | src/lib/event/Makefile |
---|
776 | src/lib/physics/Makefile |
---|
777 | src/lib/particles/Makefile |
---|
778 | src/lib/collision_detection/Makefile |
---|
779 | src/lib/network/Makefile |
---|
780 | src/lib/shell/Makefile |
---|
781 | src/lib/gui/Makefile |
---|
782 | src/lib/gui/gtk_gui/Makefile |
---|
783 | src/lib/gui/gl_gui/Makefile |
---|
784 | src/lib/parser/Makefile |
---|
785 | src/lib/parser/tinyxml/Makefile |
---|
786 | src/lib/parser/ini_parser/Makefile |
---|
787 | src/util/Makefile |
---|
788 | src/subprojects/Makefile |
---|
789 | src/subprojects/testmain/Makefile |
---|
790 | src/subprojects/importer/Makefile |
---|
791 | src/subprojects/particles/Makefile |
---|
792 | src/subprojects/collision_detection/Makefile |
---|
793 | src/subprojects/network/Makefile |
---|
794 | ]) |
---|
795 | |
---|
796 | AC_OUTPUT |
---|