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