[4555] | 1 | ########################################################################## |
---|
| 2 | # orxonox - the future of 3D-vertical-scrollers # |
---|
| 3 | # # |
---|
| 4 | # Copyright (C) 2004 orx # |
---|
| 5 | # # |
---|
[3424] | 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) # |
---|
[4555] | 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. # |
---|
[3424] | 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 | ########################################################################## |
---|
[1945] | 20 | |
---|
[3424] | 21 | ######################### |
---|
| 22 | ## AUTOCONF INIT PHASE ## |
---|
| 23 | ######################### |
---|
[3218] | 24 | AC_PREREQ(2.56) |
---|
[4772] | 25 | AC_INIT(orxonox, 0.3.0_alpha, [orxonox-dev at mail.datacore.ch]) |
---|
[2980] | 26 | |
---|
[3424] | 27 | ## Detect the canonical host and target build environment. |
---|
[2980] | 28 | AC_CANONICAL_BUILD |
---|
| 29 | AC_CANONICAL_HOST |
---|
| 30 | AC_CANONICAL_TARGET |
---|
| 31 | |
---|
[1959] | 32 | AM_INIT_AUTOMAKE |
---|
[2618] | 33 | |
---|
[1951] | 34 | AC_CONFIG_SRCDIR([.]) |
---|
[1945] | 35 | AC_CONFIG_HEADER([config.h]) |
---|
| 36 | |
---|
[3424] | 37 | ######################### |
---|
| 38 | ## Checks for programs ## |
---|
| 39 | ######################### |
---|
[1945] | 40 | AC_PROG_CXX |
---|
[4054] | 41 | AC_PROG_RANLIB |
---|
[2925] | 42 | AC_HEADER_STDC |
---|
[2701] | 43 | |
---|
[4774] | 44 | ## THIS IS OUR DEFAULT-DATA-DIRECTORY |
---|
| 45 | |
---|
[3424] | 46 | ################################## |
---|
| 47 | ## CHECKING OPTIONAL ARGUMENTS ## |
---|
| 48 | ################################## |
---|
[4774] | 49 | #----------------# |
---|
| 50 | # Data-Directory # |
---|
| 51 | #----------------# |
---|
| 52 | DATA_DIR=$datadir |
---|
| 53 | echo \$\{prefix\} |
---|
| 54 | if test $DATA_DIR = \$\{prefix\}/share ; then |
---|
| 55 | echo "not given" |
---|
| 56 | DATA_DIR=/usr/share |
---|
| 57 | else |
---|
| 58 | echo "given: $DATA_DIR" |
---|
| 59 | fi |
---|
| 60 | AC_DEFINE_UNQUOTED([DATADIR], ["$DATA_DIR"], |
---|
| 61 | [Define to the read-only architecture-independent |
---|
| 62 | data directory.]) |
---|
[3424] | 63 | |
---|
| 64 | #-----------------# |
---|
| 65 | # DEBUG-statement # |
---|
| 66 | #-----------------# |
---|
[3173] | 67 | DEBUG=no |
---|
| 68 | AC_MSG_CHECKING([if DEBUG-mode should be enabled]) |
---|
[4555] | 69 | AC_ARG_ENABLE([debug], |
---|
| 70 | AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]), |
---|
| 71 | DEBUG=$enableval) |
---|
[3205] | 72 | |
---|
[4555] | 73 | if test x$DEBUG = xno; then |
---|
| 74 | echo "no" |
---|
| 75 | echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed." |
---|
| 76 | DEBUG=4 |
---|
[3424] | 77 | elif test x$DEBUG = xyes; then |
---|
[4555] | 78 | echo "yes" |
---|
| 79 | echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!." |
---|
| 80 | DEBUG=4 |
---|
| 81 | else |
---|
| 82 | echo "yes: setting debuglevel to to $DEBUG" |
---|
[3173] | 83 | fi |
---|
[4555] | 84 | AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are]) |
---|
[3205] | 85 | |
---|
[3173] | 86 | AC_SUBST(DEBUG) |
---|
| 87 | |
---|
[3592] | 88 | #---------------# |
---|
| 89 | # Modular Debug # |
---|
| 90 | #---------------# |
---|
| 91 | MODULAR_DEBUG=yes |
---|
| 92 | AC_MSG_CHECKING([if Modular-DEBUG-mode should be ebabled]) |
---|
[4555] | 93 | AC_ARG_ENABLE([modular-debug], |
---|
| 94 | AC_HELP_STRING( [--disable-modular-debug], [compiles in modular-debug mode, that logs differently on the many modules of orxonox.]), |
---|
| 95 | MODULAR_DEBUG=$enableval) |
---|
[3592] | 96 | |
---|
[4555] | 97 | if test x$MODULAR_DEBUG = xno; then |
---|
| 98 | echo "no" |
---|
[3592] | 99 | elif test x$MODULAR_DEBUG = xyes; then |
---|
[4555] | 100 | echo "yes" |
---|
| 101 | AC_DEFINE_UNQUOTED(MODULAR_DEBUG, 1, [if Modular-DUBUG mode is enabled]) |
---|
[3592] | 102 | fi |
---|
| 103 | |
---|
[3424] | 104 | #--------------# |
---|
| 105 | # GTK-disabled # |
---|
| 106 | #--------------# |
---|
[3100] | 107 | AC_MSG_CHECKING([if gtk should be enabled]) |
---|
[4774] | 108 | AC_ARG_ENABLE([gtk], |
---|
| 109 | AC_HELP_STRING( [--disable-gtk], |
---|
[4555] | 110 | [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes]) |
---|
| 111 | if test x$def_gtk = xyes; then |
---|
[3100] | 112 | echo "yes" |
---|
[4555] | 113 | fi |
---|
| 114 | if test x$def_gtk = xno; then |
---|
[3100] | 115 | echo "no" |
---|
| 116 | fi |
---|
[3423] | 117 | |
---|
[3424] | 118 | #------------------# |
---|
| 119 | # libCurl-disabled # |
---|
| 120 | #------------------# |
---|
[3423] | 121 | AC_MSG_CHECKING([if libcURL should be enabled]) |
---|
[4774] | 122 | AC_ARG_ENABLE([curl], |
---|
| 123 | AC_HELP_STRING( [--disable-curl], |
---|
[4555] | 124 | [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes]) |
---|
| 125 | if test x$def_curl = xyes; then |
---|
[3423] | 126 | echo "yes" |
---|
[4555] | 127 | fi |
---|
| 128 | if test x$def_curl = xno; then |
---|
[3423] | 129 | echo "no" |
---|
| 130 | fi |
---|
| 131 | |
---|
[3424] | 132 | #-------------------# |
---|
| 133 | # SubProject-enable # |
---|
| 134 | #-------------------# |
---|
| 135 | def_sub_projects=no |
---|
[3377] | 136 | AC_MSG_CHECKING([if the SubProjects should be built]) |
---|
[4774] | 137 | AC_ARG_WITH([sub-projects], |
---|
| 138 | AC_HELP_STRING( [--with-sub-projects], |
---|
[4555] | 139 | [also builds the subProjects while make from srcdir]), [def_sub_projects=yes]) |
---|
[3424] | 140 | if test x$def_sub_projects = xyes; then |
---|
[3377] | 141 | echo "yes" |
---|
[4555] | 142 | fi |
---|
[3424] | 143 | if test x$def_sub_projects = xno; then |
---|
[3377] | 144 | echo "no" |
---|
| 145 | fi |
---|
| 146 | AM_CONDITIONAL(SUB_PROJECTS, test x$def_sub_projects = xyes) |
---|
| 147 | |
---|
[3788] | 148 | #-------------------# |
---|
| 149 | # Profiling Enabled # |
---|
| 150 | #-------------------# |
---|
| 151 | def_profiling=no |
---|
| 152 | AC_MSG_CHECKING([if Profiling should be enabled]) |
---|
[4555] | 153 | AC_ARG_ENABLE([profile], |
---|
| 154 | AC_HELP_STRING( [--enable-profile], |
---|
| 155 | [builds orxonox with profiling support]), [def_profiling=yes]) |
---|
[3788] | 156 | if test x$def_profiling = xyes; then |
---|
| 157 | echo "yes" |
---|
| 158 | CXXFLAGS="$CXXFLAGS -pg" |
---|
[4555] | 159 | fi |
---|
[3788] | 160 | if test x$def_profiling = xno; then |
---|
| 161 | echo "no" |
---|
| 162 | fi |
---|
| 163 | |
---|
[3863] | 164 | #----------------# |
---|
| 165 | # efence Enabled # |
---|
| 166 | #----------------# |
---|
| 167 | def_efence=no |
---|
| 168 | AC_MSG_CHECKING([if efence should be enabled]) |
---|
[4555] | 169 | AC_ARG_ENABLE([efence], |
---|
| 170 | AC_HELP_STRING( [--enable-efence], |
---|
| 171 | [builds orxonox with efence support]), [def_efence=yes]) |
---|
[3863] | 172 | if test x$def_efence = xyes; then |
---|
| 173 | echo "yes" |
---|
[4555] | 174 | fi |
---|
[3863] | 175 | if test x$def_efence = xno; then |
---|
| 176 | echo "no" |
---|
| 177 | fi |
---|
| 178 | |
---|
[3558] | 179 | #----------------------# |
---|
| 180 | # Documentation-enable # |
---|
| 181 | #----------------------# |
---|
| 182 | def_documentation=no |
---|
| 183 | AC_MSG_CHECKING([if the Documentation should be build by default]) |
---|
[4555] | 184 | AC_ARG_ENABLE([documentation], |
---|
| 185 | AC_HELP_STRING( [--enable-documentation], |
---|
| 186 | [also builds the sDocumentation while make from srcdir]), [def_documentation=yes]) |
---|
[3558] | 187 | if test x$def_documentation = xyes; then |
---|
| 188 | echo "yes" |
---|
[4555] | 189 | fi |
---|
[3558] | 190 | if test x$def_documentation = xno; then |
---|
| 191 | echo "no" |
---|
| 192 | fi |
---|
| 193 | AM_CONDITIONAL(DOCUMENTATION, test x$def_documentation = xyes) |
---|
[4774] | 194 | |
---|
[3424] | 195 | ####################### |
---|
| 196 | ## PROGRAMM CHECKING ## |
---|
| 197 | ## 3. party Programs ## |
---|
| 198 | ####################### |
---|
| 199 | |
---|
| 200 | #----------------------# |
---|
| 201 | # checking for Doxygen # |
---|
| 202 | #----------------------# |
---|
[3219] | 203 | AC_PATH_PROG(DOXYGEN, doxygen) |
---|
| 204 | AM_CONDITIONAL(DOXYGEN, test $DOXYGEN) |
---|
| 205 | |
---|
[3789] | 206 | #--------------------# |
---|
| 207 | # checking for gprof # |
---|
| 208 | #--------------------# |
---|
| 209 | AC_PATH_PROG(GPROF, gprof) |
---|
| 210 | |
---|
[4130] | 211 | #-------------------------# |
---|
| 212 | # checking for pkg-config # |
---|
| 213 | #-------------------------# |
---|
| 214 | if test x$def_gtk = xyes; then |
---|
| 215 | AC_PATH_PROG(PKG_CONFIG, pkg-config) |
---|
| 216 | fi |
---|
| 217 | |
---|
| 218 | |
---|
[3424] | 219 | ######################### |
---|
| 220 | ## CHECKING FOR SYSTEM ## |
---|
| 221 | ######################### |
---|
| 222 | ## here the system is checked, and openGL is included |
---|
| 223 | ## also checking for SDL on differen Systems |
---|
[2701] | 224 | |
---|
| 225 | AC_MSG_CHECKING([for System]) |
---|
[2980] | 226 | ## checking for openGL-environment and other sys-specific parameters |
---|
| 227 | case "$target" in |
---|
[4825] | 228 | |
---|
| 229 | ########### |
---|
[3424] | 230 | #---------# |
---|
| 231 | # WINDOWS # |
---|
| 232 | #---------# |
---|
[4825] | 233 | ########### |
---|
[2980] | 234 | *-*-mingw32*) |
---|
[2701] | 235 | echo "mingw-WINDOWS detected" |
---|
| 236 | |
---|
[4662] | 237 | CPPFLAGS="-I/usr/include -I/mingw/include" |
---|
[3790] | 238 | |
---|
[2701] | 239 | mingw="yes" |
---|
| 240 | MSBITFIELDS="-mms-bitfields" |
---|
| 241 | MWINDOWS="-mwindows" |
---|
| 242 | |
---|
| 243 | |
---|
[4697] | 244 | |
---|
| 245 | # checking for mingw32 |
---|
| 246 | AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) |
---|
| 247 | if test x$FOUND_mingw32 = xyes; then |
---|
| 248 | LIBS="$LIBS -lmingw32" |
---|
| 249 | fi |
---|
| 250 | |
---|
| 251 | #-----------# |
---|
| 252 | # SDL (win) # |
---|
| 253 | #-----------# |
---|
| 254 | # checking for SDL-headers |
---|
| 255 | AC_CHECK_HEADERS([SDL/SDL.h] ,, |
---|
| 256 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
| 257 | |
---|
| 258 | #checking for libSDL |
---|
| 259 | AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes) |
---|
| 260 | if test x$FOUND_sdlmain = xyes ; then |
---|
| 261 | LIBS="$LIBS -lsdlmain" |
---|
| 262 | else |
---|
| 263 | echo "------------------" |
---|
| 264 | echo "SDL library not found." |
---|
| 265 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
| 266 | echo "------------------" |
---|
| 267 | exit 1 |
---|
| 268 | fi |
---|
| 269 | AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes) |
---|
| 270 | if test x$FOUND_sdl = xyes ; then |
---|
| 271 | LIBS="$LIBS -lsdl" |
---|
| 272 | else |
---|
| 273 | echo "------------------" |
---|
| 274 | echo "SDL library not found." |
---|
| 275 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
| 276 | echo "------------------" |
---|
| 277 | exit -1 |
---|
| 278 | fi |
---|
| 279 | |
---|
| 280 | #---------------# |
---|
| 281 | # open-GL (win) # |
---|
| 282 | #---------------# |
---|
[2925] | 283 | # checking gl header |
---|
[2879] | 284 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
| 285 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
[2701] | 286 | # checking for Windows openGl library |
---|
[1971] | 287 | AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h") |
---|
[3424] | 288 | if test x$FOUND_opengl32 = xyes ; then |
---|
[4555] | 289 | LIBS="$LIBS -lopengl32" |
---|
[1971] | 290 | else |
---|
[4555] | 291 | echo "------------------" |
---|
| 292 | echo "opengl not found." |
---|
| 293 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
| 294 | echo "------------------" |
---|
| 295 | exit -1 |
---|
[1959] | 296 | fi |
---|
| 297 | |
---|
[2701] | 298 | # cheking for GLU-header |
---|
[3424] | 299 | AC_CHECK_HEADERS([GL/glu.h] ,, |
---|
[1971] | 300 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 301 | |
---|
[2701] | 302 | # checking for libGLU |
---|
[1971] | 303 | AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes) |
---|
[3424] | 304 | if test x$FOUND_glu32 = xyes ; then |
---|
[4555] | 305 | LIBS="$LIBS -lGLU32" |
---|
[2701] | 306 | else |
---|
[4555] | 307 | echo "------------------" |
---|
| 308 | echo "GLU library not found." |
---|
| 309 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
| 310 | echo "------------------" |
---|
| 311 | exit -1 |
---|
[1959] | 312 | fi |
---|
[1971] | 313 | |
---|
[4697] | 314 | #--------# |
---|
| 315 | # openAL # |
---|
| 316 | #--------# |
---|
| 317 | # checking for openAL-headers |
---|
| 318 | AC_CHECK_HEADERS([AL/al.h] ,, |
---|
| 319 | [AC_MSG_ERROR([cannot find openAL header.])]) |
---|
| 320 | # checking for openAL-lib |
---|
| 321 | AC_CHECK_LIB([OpenAL32], [main], [FOUND_openal=yes]) |
---|
| 322 | AC_CHECK_LIB([ALut], [main], [FOUND_ALut=yes]) |
---|
| 323 | if test x$FOUND_openal = xyes ; then |
---|
| 324 | if test x$FOUND_ALut = xyes ; then |
---|
| 325 | LIBS="$LIBS -lALut -lOpenAL32" |
---|
| 326 | else |
---|
[2982] | 327 | echo "------------------" |
---|
[4697] | 328 | echo "openal library not found." |
---|
| 329 | echo "please install the openal library, which can be found at http://www.openal.org" |
---|
[2982] | 330 | echo "------------------" |
---|
| 331 | exit -1 |
---|
[4697] | 332 | fi |
---|
| 333 | fi |
---|
[2701] | 334 | ;; |
---|
[4825] | 335 | |
---|
| 336 | ######### |
---|
[3424] | 337 | #-------# |
---|
| 338 | # LINUX # |
---|
| 339 | #-------# |
---|
[4825] | 340 | ######### |
---|
[2980] | 341 | *-*-linux*) |
---|
[2701] | 342 | echo "Linux detected" |
---|
| 343 | |
---|
| 344 | Linux="yes" |
---|
| 345 | |
---|
[4662] | 346 | CPPFLAGS="-I/usr/X11R6/include -I/usr/include" |
---|
[3385] | 347 | LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS" |
---|
[2925] | 348 | # checking gl header |
---|
[3424] | 349 | AC_CHECK_HEADERS([GL/gl.h] ,, |
---|
[2879] | 350 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
[2701] | 351 | |
---|
| 352 | # checking for Unix GL |
---|
[3385] | 353 | AC_CHECK_LIB([GL], [glLoadIdentity], FOUND_GL=yes) |
---|
[3424] | 354 | if test x$FOUND_GL = xyes ; then |
---|
[2701] | 355 | LIBS="$LIBS -lGL" |
---|
| 356 | else |
---|
[4555] | 357 | echo "------------------" |
---|
| 358 | echo "opengl not found." |
---|
| 359 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
| 360 | echo "------------------" |
---|
| 361 | exit -1 |
---|
[2701] | 362 | fi |
---|
| 363 | |
---|
| 364 | # cheking for GLU-header |
---|
[3424] | 365 | AC_CHECK_HEADERS([GL/glu.h] ,, |
---|
[2701] | 366 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 367 | |
---|
| 368 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
[3424] | 369 | if test x$FOUND_GLU = xyes ; then |
---|
[2701] | 370 | LIBS="$LIBS -lGLU" |
---|
| 371 | else |
---|
[4555] | 372 | echo "------------------" |
---|
| 373 | echo "GLU library not found." |
---|
| 374 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
| 375 | echo "------------------" |
---|
| 376 | exit -1 |
---|
| 377 | fi |
---|
[2995] | 378 | |
---|
[4697] | 379 | #--------# |
---|
| 380 | # openAL # |
---|
| 381 | #--------# |
---|
| 382 | # checking for openAL-headers |
---|
| 383 | AC_CHECK_HEADERS([AL/al.h] ,, |
---|
| 384 | [AC_MSG_ERROR([cannot find openAL header.])]) |
---|
| 385 | # checking for openAL-lib |
---|
| 386 | AC_CHECK_LIB([openal], [main], [FOUND_openal=yes]) |
---|
| 387 | if test x$FOUND_openal = xyes ; then |
---|
| 388 | LIBS="$LIBS -lopenal" |
---|
| 389 | else |
---|
| 390 | echo "------------------" |
---|
| 391 | echo "openal library not found." |
---|
| 392 | echo "please install the openal library, which can be found at http://www.openal.org" |
---|
| 393 | echo "------------------" |
---|
| 394 | exit -1 |
---|
| 395 | fi |
---|
| 396 | |
---|
[4664] | 397 | # checking for SDL |
---|
| 398 | AC_MSG_CHECKING([for SDL-version]) |
---|
| 399 | SDL_VERSION=`sdl-config --version` |
---|
| 400 | echo $SDL_VERSION |
---|
[2982] | 401 | |
---|
[4664] | 402 | CPPFLAGS="`sdl-config --cflags` $CPPFLAGS" |
---|
[4665] | 403 | AC_CHECK_HEADERS([SDL.h] ,, |
---|
| 404 | [AC_CHECK_HEADERS([SDL/SDL.h] ,,AC_MSG_ERROR([cannot find SDL header. please download from libsdl.org])])) |
---|
[2991] | 405 | |
---|
[4664] | 406 | LIBS="`sdl-config --libs` $LIBS" |
---|
| 407 | ;; |
---|
[3140] | 408 | |
---|
[4825] | 409 | ############# |
---|
[3424] | 410 | #-----------# |
---|
| 411 | # MAC -OS X # |
---|
| 412 | #-----------# |
---|
[4825] | 413 | ############# |
---|
[2995] | 414 | *darwin*) |
---|
[3424] | 415 | echo "OS X detected" |
---|
[2995] | 416 | |
---|
| 417 | osX="yes" |
---|
| 418 | |
---|
[4662] | 419 | CPPFLAGS="-I/sw/include -I/sw/include $CPPFLAGS" |
---|
[2995] | 420 | # checking gl header |
---|
[3424] | 421 | AC_CHECK_HEADERS([OpenGL/gl.h] ,, |
---|
[2995] | 422 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 423 | # cheking for GLU-header |
---|
[3424] | 424 | AC_CHECK_HEADERS([OpenGL/glu.h] ,, |
---|
[2995] | 425 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 426 | |
---|
| 427 | LIBS="$LIBS -framework OpenGL" |
---|
| 428 | |
---|
[4662] | 429 | |
---|
| 430 | ## SDL-check |
---|
[3424] | 431 | SDL_CFLAGS=`sdl-config --cflags` |
---|
| 432 | SDL_LIBS=`sdl-config --libs` |
---|
| 433 | CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" |
---|
| 434 | LIBS="$LIBS $SDL_LIBS" |
---|
| 435 | |
---|
| 436 | |
---|
[2995] | 437 | # checking for SDL-headers |
---|
[3001] | 438 | # AC_CHECK_HEADERS(SDL/SDL.h ,, |
---|
| 439 | # [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
[2995] | 440 | |
---|
| 441 | ## checking for SDL |
---|
| 442 | # SDL_VERSION=1.2.7 |
---|
| 443 | # AM_PATH_SDL($SDL_VERSION, |
---|
| 444 | # :, |
---|
| 445 | # AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) |
---|
| 446 | # ) |
---|
| 447 | |
---|
[3140] | 448 | |
---|
[2995] | 449 | ;; |
---|
| 450 | |
---|
[2701] | 451 | *) |
---|
| 452 | ;; |
---|
| 453 | esac |
---|
[2968] | 454 | |
---|
[2701] | 455 | AC_SUBST(MSBITFIELDS) |
---|
| 456 | |
---|
[3424] | 457 | ################################### |
---|
| 458 | ## CHECKING FOR HEADERS AND LIBS ## |
---|
| 459 | ################################### |
---|
| 460 | |
---|
[4665] | 461 | #---------# |
---|
| 462 | # SDL_ttf # |
---|
| 463 | #---------# |
---|
| 464 | # checking for SDL_ttf-headers |
---|
[4672] | 465 | AC_CHECK_HEADERS([SDL_ttf.h] ,, |
---|
| 466 | [AC_CHECK_HEADERS([SDL/SDL_ttf.h] ,,AC_MSG_ERROR([cannot find SDL_ttf header.])])) |
---|
[4665] | 467 | # checking for SDL_ttf-lib |
---|
[4697] | 468 | AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], [FOUND_SDL_ttf=yes]) |
---|
[4665] | 469 | if test x$FOUND_SDL_ttf = xyes ; then |
---|
| 470 | LIBS="$LIBS -lSDL_ttf" |
---|
| 471 | else |
---|
| 472 | echo "------------------" |
---|
| 473 | echo "SDL_ttf library not found." |
---|
| 474 | echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/" |
---|
| 475 | echo "------------------" |
---|
| 476 | exit -1 |
---|
| 477 | fi |
---|
| 478 | |
---|
| 479 | |
---|
| 480 | #-----------# |
---|
| 481 | # SDL_Image # |
---|
| 482 | #-----------# |
---|
| 483 | # checking for SDL_image-headers |
---|
| 484 | AC_CHECK_HEADERS([SDL_image.h] ,, |
---|
[4672] | 485 | [AC_CHECK_HEADERS([SDL/SDL_image.h],, AC_MSG_ERROR([SDL_image header not found.]))]) |
---|
[4665] | 486 | # checking for SDL_image-lib |
---|
| 487 | AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes]) |
---|
| 488 | if test x$FOUND_SDL_image = xyes ; then |
---|
| 489 | LIBS="$LIBS -lSDL_image" |
---|
| 490 | else |
---|
| 491 | echo "------------------" |
---|
| 492 | echo "SDL_image library not found." |
---|
| 493 | echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/" |
---|
| 494 | echo "------------------" |
---|
| 495 | exit -1 |
---|
| 496 | fi |
---|
| 497 | |
---|
[4504] | 498 | #-----# |
---|
| 499 | # ogg # |
---|
| 500 | #-----# |
---|
[4825] | 501 | # checking for ogg-headers |
---|
| 502 | AC_CHECK_HEADERS([ogg/ogg.h] ,, |
---|
| 503 | [AC_MSG_ERROR([cannot find ogg header.])]) |
---|
| 504 | # checking for ogg-lib |
---|
| 505 | AC_CHECK_LIB([ogg], [main], [FOUND_ogg=yes]) |
---|
| 506 | if test x$FOUND_ogg = xyes ; then |
---|
| 507 | LIBS="$LIBS -logg" |
---|
| 508 | else |
---|
| 509 | echo "------------------" |
---|
| 510 | echo "ogg library not found." |
---|
| 511 | echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
| 512 | echo "------------------" |
---|
| 513 | exit -1 |
---|
| 514 | fi |
---|
[4504] | 515 | |
---|
| 516 | #--------# |
---|
| 517 | # vorbis # |
---|
| 518 | #--------# |
---|
[4825] | 519 | # checking for vorbis-lib |
---|
| 520 | AC_CHECK_LIB([vorbis], [main], [FOUND_vorbis=yes]) |
---|
| 521 | if test x$FOUND_vorbis = xyes ; then |
---|
| 522 | LIBS="$LIBS -lvorbis" |
---|
| 523 | else |
---|
| 524 | echo "------------------" |
---|
| 525 | echo "vorbis library not found." |
---|
| 526 | echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
| 527 | echo "------------------" |
---|
| 528 | exit -1 |
---|
| 529 | fi |
---|
[4504] | 530 | |
---|
| 531 | #------------# |
---|
| 532 | # vorbisfile # |
---|
| 533 | #------------# |
---|
[4825] | 534 | # checking for vorbis-headers |
---|
| 535 | AC_CHECK_HEADERS([vorbis/vorbisfile.h] ,, |
---|
| 536 | [AC_MSG_ERROR([cannot find vorbisfile header.])]) |
---|
| 537 | # checking for vorbisfile-lib |
---|
| 538 | AC_CHECK_LIB([vorbisfile], [main], [FOUND_vorbisfile=yes]) |
---|
| 539 | if test x$FOUND_vorbisfile = xyes ; then |
---|
| 540 | LIBS="$LIBS -lvorbisfile" |
---|
| 541 | else |
---|
| 542 | echo "------------------" |
---|
| 543 | echo "vorbisfile library not found." |
---|
| 544 | echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
| 545 | echo "------------------" |
---|
| 546 | exit -1 |
---|
| 547 | fi |
---|
[4504] | 548 | |
---|
[3424] | 549 | #-----# |
---|
| 550 | # GTK # |
---|
| 551 | #-----# |
---|
[4555] | 552 | if test x$def_gtk = xyes; then |
---|
| 553 | #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no) |
---|
| 554 | AC_MSG_CHECKING([for gtk2.0]) |
---|
| 555 | if `$PKG_CONFIG --exists gtk+-2.0`; then |
---|
| 556 | echo "yes" |
---|
| 557 | have_gtk2=yes |
---|
| 558 | GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0` |
---|
| 559 | GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` |
---|
| 560 | AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2]) |
---|
| 561 | if test $DEBUG -ge 3; then |
---|
| 562 | echo "cflags: $GTK2_CFLAGS" |
---|
| 563 | echo "libs: $GTK2_LIBS" |
---|
| 564 | fi |
---|
| 565 | else |
---|
| 566 | echo "no" |
---|
| 567 | fi |
---|
[3101] | 568 | |
---|
[3099] | 569 | fi |
---|
[2980] | 570 | AC_SUBST(GTK2_LIBS) |
---|
| 571 | AC_SUBST(GTK2_CFLAGS) |
---|
[3100] | 572 | AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes) |
---|
[2980] | 573 | |
---|
[3424] | 574 | #---------# |
---|
| 575 | # libcURL # |
---|
| 576 | #---------# |
---|
[4555] | 577 | if test x$def_curl = xyes; then |
---|
[2190] | 578 | |
---|
[3424] | 579 | AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"]) |
---|
[3423] | 580 | AC_CHECK_LIB([curl], [main], [FOUND_curl=yes]) |
---|
| 581 | if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then |
---|
| 582 | have_curl=yes |
---|
| 583 | CURL_LIBS=`curl-config --libs` |
---|
| 584 | CURLCFLAGS=`curl-config --cflags` |
---|
| 585 | AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL]) |
---|
[3424] | 586 | else |
---|
[3423] | 587 | have_curl=no |
---|
| 588 | fi |
---|
| 589 | |
---|
| 590 | fi |
---|
| 591 | AC_SUBST(CURL_LIBS) |
---|
| 592 | AC_SUBST(CURL_CFLAGS) |
---|
| 593 | AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes) |
---|
| 594 | |
---|
[3863] | 595 | #--------# |
---|
| 596 | # efence # |
---|
| 597 | #--------# |
---|
| 598 | if test x$def_efence = xyes ; then |
---|
| 599 | AC_CHECK_LIB([efence], [main], [FOUND_efence=yes]) |
---|
| 600 | if test x$FOUND_efence = xyes ; then |
---|
| 601 | LIBS="$LIBS -lefence" |
---|
| 602 | fi |
---|
[4555] | 603 | |
---|
[3863] | 604 | fi |
---|
| 605 | |
---|
[1945] | 606 | # FIXME: Replace `main' with a function in `-lm': |
---|
[2968] | 607 | AC_CHECK_LIB([m], [main]) |
---|
[1945] | 608 | |
---|
[4555] | 609 | |
---|
[1945] | 610 | # Checks for header files. |
---|
| 611 | AC_HEADER_STDC |
---|
| 612 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
| 613 | |
---|
| 614 | # Checks for typedefs, structures, and compiler characteristics. |
---|
| 615 | AC_HEADER_STDBOOL |
---|
| 616 | |
---|
| 617 | # Checks for library functions. |
---|
| 618 | AC_FUNC_MALLOC |
---|
| 619 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
| 620 | |
---|
[3424] | 621 | ###################### |
---|
| 622 | ## OUTPUT CONFIGURE ## |
---|
| 623 | ###################### |
---|
[1946] | 624 | AC_CONFIG_FILES([Makefile |
---|
[3377] | 625 | src/Makefile |
---|
[4555] | 626 | src/lib/Makefile |
---|
| 627 | src/lib/graphics/Makefile |
---|
| 628 | src/lib/graphics/importer/Makefile |
---|
[4789] | 629 | src/lib/graphics/spatial_separation/Makefile |
---|
[4555] | 630 | src/lib/sound/Makefile |
---|
| 631 | src/lib/event/Makefile |
---|
| 632 | src/lib/physics/Makefile |
---|
| 633 | src/lib/particles/Makefile |
---|
| 634 | src/lib/collision_detection/Makefile |
---|
| 635 | src/lib/gui/Makefile |
---|
[4265] | 636 | src/lib/tinyxml/Makefile |
---|
[4662] | 637 | src/subprojects/Makefile |
---|
[4555] | 638 | src/subprojects/testmain/Makefile |
---|
| 639 | src/subprojects/importer/Makefile |
---|
| 640 | src/subprojects/particles/Makefile |
---|
| 641 | src/subprojects/collision_detection/Makefile |
---|
| 642 | ]) |
---|
[3377] | 643 | |
---|
[1945] | 644 | AC_OUTPUT |
---|