[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 |
---|
[3424] | 228 | #---------# |
---|
| 229 | # WINDOWS # |
---|
| 230 | #---------# |
---|
[2980] | 231 | *-*-mingw32*) |
---|
[2701] | 232 | echo "mingw-WINDOWS detected" |
---|
| 233 | |
---|
[4662] | 234 | CPPFLAGS="-I/usr/include -I/mingw/include" |
---|
[3790] | 235 | |
---|
[2701] | 236 | mingw="yes" |
---|
| 237 | MSBITFIELDS="-mms-bitfields" |
---|
| 238 | MWINDOWS="-mwindows" |
---|
| 239 | |
---|
| 240 | |
---|
[4697] | 241 | |
---|
| 242 | # checking for mingw32 |
---|
| 243 | AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) |
---|
| 244 | if test x$FOUND_mingw32 = xyes; then |
---|
| 245 | LIBS="$LIBS -lmingw32" |
---|
| 246 | fi |
---|
| 247 | |
---|
| 248 | #-----------# |
---|
| 249 | # SDL (win) # |
---|
| 250 | #-----------# |
---|
| 251 | # checking for SDL-headers |
---|
| 252 | AC_CHECK_HEADERS([SDL/SDL.h] ,, |
---|
| 253 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
| 254 | |
---|
| 255 | #checking for libSDL |
---|
| 256 | AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes) |
---|
| 257 | if test x$FOUND_sdlmain = xyes ; then |
---|
| 258 | LIBS="$LIBS -lsdlmain" |
---|
| 259 | else |
---|
| 260 | echo "------------------" |
---|
| 261 | echo "SDL library not found." |
---|
| 262 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
| 263 | echo "------------------" |
---|
| 264 | exit 1 |
---|
| 265 | fi |
---|
| 266 | AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes) |
---|
| 267 | if test x$FOUND_sdl = xyes ; then |
---|
| 268 | LIBS="$LIBS -lsdl" |
---|
| 269 | else |
---|
| 270 | echo "------------------" |
---|
| 271 | echo "SDL library not found." |
---|
| 272 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
| 273 | echo "------------------" |
---|
| 274 | exit -1 |
---|
| 275 | fi |
---|
| 276 | |
---|
| 277 | #---------------# |
---|
| 278 | # open-GL (win) # |
---|
| 279 | #---------------# |
---|
[2925] | 280 | # checking gl header |
---|
[2879] | 281 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
| 282 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
[2701] | 283 | # checking for Windows openGl library |
---|
[1971] | 284 | AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h") |
---|
[3424] | 285 | if test x$FOUND_opengl32 = xyes ; then |
---|
[4555] | 286 | LIBS="$LIBS -lopengl32" |
---|
[1971] | 287 | else |
---|
[4555] | 288 | echo "------------------" |
---|
| 289 | echo "opengl not found." |
---|
| 290 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
| 291 | echo "------------------" |
---|
| 292 | exit -1 |
---|
[1959] | 293 | fi |
---|
| 294 | |
---|
[2701] | 295 | # cheking for GLU-header |
---|
[3424] | 296 | AC_CHECK_HEADERS([GL/glu.h] ,, |
---|
[1971] | 297 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 298 | |
---|
[2701] | 299 | # checking for libGLU |
---|
[1971] | 300 | AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes) |
---|
[3424] | 301 | if test x$FOUND_glu32 = xyes ; then |
---|
[4555] | 302 | LIBS="$LIBS -lGLU32" |
---|
[2701] | 303 | else |
---|
[4555] | 304 | echo "------------------" |
---|
| 305 | echo "GLU library not found." |
---|
| 306 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
| 307 | echo "------------------" |
---|
| 308 | exit -1 |
---|
[1959] | 309 | fi |
---|
[1971] | 310 | |
---|
[4697] | 311 | #--------# |
---|
| 312 | # openAL # |
---|
| 313 | #--------# |
---|
| 314 | # checking for openAL-headers |
---|
| 315 | AC_CHECK_HEADERS([AL/al.h] ,, |
---|
| 316 | [AC_MSG_ERROR([cannot find openAL header.])]) |
---|
| 317 | # checking for openAL-lib |
---|
| 318 | AC_CHECK_LIB([OpenAL32], [main], [FOUND_openal=yes]) |
---|
| 319 | AC_CHECK_LIB([ALut], [main], [FOUND_ALut=yes]) |
---|
| 320 | if test x$FOUND_openal = xyes ; then |
---|
| 321 | if test x$FOUND_ALut = xyes ; then |
---|
| 322 | LIBS="$LIBS -lALut -lOpenAL32" |
---|
| 323 | else |
---|
[2982] | 324 | echo "------------------" |
---|
[4697] | 325 | echo "openal library not found." |
---|
| 326 | echo "please install the openal library, which can be found at http://www.openal.org" |
---|
[2982] | 327 | echo "------------------" |
---|
| 328 | exit -1 |
---|
[4697] | 329 | fi |
---|
| 330 | fi |
---|
[2701] | 331 | ;; |
---|
[3424] | 332 | #-------# |
---|
| 333 | # LINUX # |
---|
| 334 | #-------# |
---|
[2980] | 335 | *-*-linux*) |
---|
[2701] | 336 | echo "Linux detected" |
---|
| 337 | |
---|
| 338 | Linux="yes" |
---|
| 339 | |
---|
[4662] | 340 | CPPFLAGS="-I/usr/X11R6/include -I/usr/include" |
---|
[3385] | 341 | LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS" |
---|
[2925] | 342 | # checking gl header |
---|
[3424] | 343 | AC_CHECK_HEADERS([GL/gl.h] ,, |
---|
[2879] | 344 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
[2701] | 345 | |
---|
| 346 | # checking for Unix GL |
---|
[3385] | 347 | AC_CHECK_LIB([GL], [glLoadIdentity], FOUND_GL=yes) |
---|
[3424] | 348 | if test x$FOUND_GL = xyes ; then |
---|
[2701] | 349 | LIBS="$LIBS -lGL" |
---|
| 350 | else |
---|
[4555] | 351 | echo "------------------" |
---|
| 352 | echo "opengl not found." |
---|
| 353 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
| 354 | echo "------------------" |
---|
| 355 | exit -1 |
---|
[2701] | 356 | fi |
---|
| 357 | |
---|
| 358 | # cheking for GLU-header |
---|
[3424] | 359 | AC_CHECK_HEADERS([GL/glu.h] ,, |
---|
[2701] | 360 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 361 | |
---|
| 362 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
[3424] | 363 | if test x$FOUND_GLU = xyes ; then |
---|
[2701] | 364 | LIBS="$LIBS -lGLU" |
---|
| 365 | else |
---|
[4555] | 366 | echo "------------------" |
---|
| 367 | echo "GLU library not found." |
---|
| 368 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
| 369 | echo "------------------" |
---|
| 370 | exit -1 |
---|
| 371 | fi |
---|
[2995] | 372 | |
---|
[4697] | 373 | #--------# |
---|
| 374 | # openAL # |
---|
| 375 | #--------# |
---|
| 376 | # checking for openAL-headers |
---|
| 377 | AC_CHECK_HEADERS([AL/al.h] ,, |
---|
| 378 | [AC_MSG_ERROR([cannot find openAL header.])]) |
---|
| 379 | # checking for openAL-lib |
---|
| 380 | AC_CHECK_LIB([openal], [main], [FOUND_openal=yes]) |
---|
| 381 | if test x$FOUND_openal = xyes ; then |
---|
| 382 | LIBS="$LIBS -lopenal" |
---|
| 383 | else |
---|
| 384 | echo "------------------" |
---|
| 385 | echo "openal library not found." |
---|
| 386 | echo "please install the openal library, which can be found at http://www.openal.org" |
---|
| 387 | echo "------------------" |
---|
| 388 | exit -1 |
---|
| 389 | fi |
---|
| 390 | |
---|
[4664] | 391 | # checking for SDL |
---|
| 392 | AC_MSG_CHECKING([for SDL-version]) |
---|
| 393 | SDL_VERSION=`sdl-config --version` |
---|
| 394 | echo $SDL_VERSION |
---|
[2982] | 395 | |
---|
[4664] | 396 | CPPFLAGS="`sdl-config --cflags` $CPPFLAGS" |
---|
[4665] | 397 | AC_CHECK_HEADERS([SDL.h] ,, |
---|
| 398 | [AC_CHECK_HEADERS([SDL/SDL.h] ,,AC_MSG_ERROR([cannot find SDL header. please download from libsdl.org])])) |
---|
[2991] | 399 | |
---|
[4664] | 400 | LIBS="`sdl-config --libs` $LIBS" |
---|
| 401 | ;; |
---|
[3140] | 402 | |
---|
[3424] | 403 | #-----------# |
---|
| 404 | # MAC -OS X # |
---|
| 405 | #-----------# |
---|
[2995] | 406 | *darwin*) |
---|
[3424] | 407 | echo "OS X detected" |
---|
[2995] | 408 | |
---|
| 409 | osX="yes" |
---|
| 410 | |
---|
[4662] | 411 | CPPFLAGS="-I/sw/include -I/sw/include $CPPFLAGS" |
---|
[2995] | 412 | # checking gl header |
---|
[3424] | 413 | AC_CHECK_HEADERS([OpenGL/gl.h] ,, |
---|
[2995] | 414 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 415 | # cheking for GLU-header |
---|
[3424] | 416 | AC_CHECK_HEADERS([OpenGL/glu.h] ,, |
---|
[2995] | 417 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 418 | |
---|
| 419 | LIBS="$LIBS -framework OpenGL" |
---|
| 420 | |
---|
[4662] | 421 | |
---|
| 422 | ## SDL-check |
---|
[3424] | 423 | SDL_CFLAGS=`sdl-config --cflags` |
---|
| 424 | SDL_LIBS=`sdl-config --libs` |
---|
| 425 | CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" |
---|
| 426 | LIBS="$LIBS $SDL_LIBS" |
---|
| 427 | |
---|
| 428 | |
---|
[2995] | 429 | # checking for SDL-headers |
---|
[3001] | 430 | # AC_CHECK_HEADERS(SDL/SDL.h ,, |
---|
| 431 | # [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
[2995] | 432 | |
---|
| 433 | ## checking for SDL |
---|
| 434 | # SDL_VERSION=1.2.7 |
---|
| 435 | # AM_PATH_SDL($SDL_VERSION, |
---|
| 436 | # :, |
---|
| 437 | # AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) |
---|
| 438 | # ) |
---|
| 439 | |
---|
[3140] | 440 | |
---|
[2995] | 441 | ;; |
---|
| 442 | |
---|
[2701] | 443 | *) |
---|
| 444 | ;; |
---|
| 445 | esac |
---|
[2968] | 446 | |
---|
[2701] | 447 | AC_SUBST(MSBITFIELDS) |
---|
| 448 | |
---|
[3424] | 449 | ################################### |
---|
| 450 | ## CHECKING FOR HEADERS AND LIBS ## |
---|
| 451 | ################################### |
---|
| 452 | |
---|
[4665] | 453 | #---------# |
---|
| 454 | # SDL_ttf # |
---|
| 455 | #---------# |
---|
| 456 | # checking for SDL_ttf-headers |
---|
[4672] | 457 | AC_CHECK_HEADERS([SDL_ttf.h] ,, |
---|
| 458 | [AC_CHECK_HEADERS([SDL/SDL_ttf.h] ,,AC_MSG_ERROR([cannot find SDL_ttf header.])])) |
---|
[4665] | 459 | # checking for SDL_ttf-lib |
---|
[4697] | 460 | AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], [FOUND_SDL_ttf=yes]) |
---|
[4665] | 461 | if test x$FOUND_SDL_ttf = xyes ; then |
---|
| 462 | LIBS="$LIBS -lSDL_ttf" |
---|
| 463 | else |
---|
| 464 | echo "------------------" |
---|
| 465 | echo "SDL_ttf library not found." |
---|
| 466 | echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/" |
---|
| 467 | echo "------------------" |
---|
| 468 | exit -1 |
---|
| 469 | fi |
---|
| 470 | |
---|
| 471 | |
---|
| 472 | #-----------# |
---|
| 473 | # SDL_Image # |
---|
| 474 | #-----------# |
---|
| 475 | # checking for SDL_image-headers |
---|
| 476 | AC_CHECK_HEADERS([SDL_image.h] ,, |
---|
[4672] | 477 | [AC_CHECK_HEADERS([SDL/SDL_image.h],, AC_MSG_ERROR([SDL_image header not found.]))]) |
---|
[4665] | 478 | # checking for SDL_image-lib |
---|
| 479 | AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes]) |
---|
| 480 | if test x$FOUND_SDL_image = xyes ; then |
---|
| 481 | LIBS="$LIBS -lSDL_image" |
---|
| 482 | else |
---|
| 483 | echo "------------------" |
---|
| 484 | echo "SDL_image library not found." |
---|
| 485 | echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/" |
---|
| 486 | echo "------------------" |
---|
| 487 | exit -1 |
---|
| 488 | fi |
---|
| 489 | |
---|
[4504] | 490 | #-----# |
---|
| 491 | # ogg # |
---|
| 492 | #-----# |
---|
[4697] | 493 | ## checking for ogg-headers |
---|
| 494 | # AC_CHECK_HEADERS([ogg/ogg.h] ,, |
---|
| 495 | # [AC_MSG_ERROR([cannot find ogg header.])]) |
---|
| 496 | ## checking for ogg-lib |
---|
| 497 | # AC_CHECK_LIB([ogg], [main], [FOUND_ogg=yes]) |
---|
| 498 | # if test x$FOUND_ogg = xyes ; then |
---|
| 499 | # LIBS="$LIBS -logg" |
---|
| 500 | # else |
---|
| 501 | # echo "------------------" |
---|
| 502 | # echo "ogg library not found." |
---|
| 503 | # echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
| 504 | # echo "------------------" |
---|
| 505 | # exit -1 |
---|
| 506 | # fi |
---|
[4504] | 507 | |
---|
| 508 | #--------# |
---|
| 509 | # vorbis # |
---|
| 510 | #--------# |
---|
[4697] | 511 | ## checking for vorbis-lib |
---|
| 512 | # AC_CHECK_LIB([vorbis], [main], [FOUND_vorbis=yes]) |
---|
| 513 | # if test x$FOUND_vorbis = xyes ; then |
---|
| 514 | # LIBS="$LIBS -lvorbis" |
---|
| 515 | # else |
---|
| 516 | # echo "------------------" |
---|
| 517 | # echo "vorbis library not found." |
---|
| 518 | # echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
| 519 | # echo "------------------" |
---|
| 520 | # exit -1 |
---|
| 521 | # fi |
---|
[4504] | 522 | |
---|
| 523 | #------------# |
---|
| 524 | # vorbisfile # |
---|
| 525 | #------------# |
---|
[4697] | 526 | ## checking for vorbis-headers |
---|
| 527 | # AC_CHECK_HEADERS([vorbis/vorbisfile.h] ,, |
---|
| 528 | # [AC_MSG_ERROR([cannot find vorbisfile header.])]) |
---|
| 529 | ## checking for vorbisfile-lib |
---|
| 530 | # AC_CHECK_LIB([vorbisfile], [main], [FOUND_vorbisfile=yes]) |
---|
| 531 | # if test x$FOUND_vorbisfile = xyes ; then |
---|
| 532 | # LIBS="$LIBS -lvorbisfile" |
---|
| 533 | # else |
---|
| 534 | # echo "------------------" |
---|
| 535 | # echo "vorbisfile library not found." |
---|
| 536 | # echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html" |
---|
| 537 | # echo "------------------" |
---|
| 538 | # exit -1 |
---|
| 539 | # fi |
---|
[4504] | 540 | |
---|
[3424] | 541 | #-----# |
---|
| 542 | # GTK # |
---|
| 543 | #-----# |
---|
[4555] | 544 | if test x$def_gtk = xyes; then |
---|
| 545 | #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no) |
---|
| 546 | AC_MSG_CHECKING([for gtk2.0]) |
---|
| 547 | if `$PKG_CONFIG --exists gtk+-2.0`; then |
---|
| 548 | echo "yes" |
---|
| 549 | have_gtk2=yes |
---|
| 550 | GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0` |
---|
| 551 | GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` |
---|
| 552 | AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2]) |
---|
| 553 | if test $DEBUG -ge 3; then |
---|
| 554 | echo "cflags: $GTK2_CFLAGS" |
---|
| 555 | echo "libs: $GTK2_LIBS" |
---|
| 556 | fi |
---|
| 557 | else |
---|
| 558 | echo "no" |
---|
| 559 | fi |
---|
[3101] | 560 | |
---|
[3099] | 561 | fi |
---|
[2980] | 562 | AC_SUBST(GTK2_LIBS) |
---|
| 563 | AC_SUBST(GTK2_CFLAGS) |
---|
[3100] | 564 | AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes) |
---|
[2980] | 565 | |
---|
[3424] | 566 | #---------# |
---|
| 567 | # libcURL # |
---|
| 568 | #---------# |
---|
[4555] | 569 | if test x$def_curl = xyes; then |
---|
[2190] | 570 | |
---|
[3424] | 571 | AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"]) |
---|
[3423] | 572 | AC_CHECK_LIB([curl], [main], [FOUND_curl=yes]) |
---|
| 573 | if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then |
---|
| 574 | have_curl=yes |
---|
| 575 | CURL_LIBS=`curl-config --libs` |
---|
| 576 | CURLCFLAGS=`curl-config --cflags` |
---|
| 577 | AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL]) |
---|
[3424] | 578 | else |
---|
[3423] | 579 | have_curl=no |
---|
| 580 | fi |
---|
| 581 | |
---|
| 582 | fi |
---|
| 583 | AC_SUBST(CURL_LIBS) |
---|
| 584 | AC_SUBST(CURL_CFLAGS) |
---|
| 585 | AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes) |
---|
| 586 | |
---|
[3863] | 587 | #--------# |
---|
| 588 | # efence # |
---|
| 589 | #--------# |
---|
| 590 | if test x$def_efence = xyes ; then |
---|
| 591 | AC_CHECK_LIB([efence], [main], [FOUND_efence=yes]) |
---|
| 592 | if test x$FOUND_efence = xyes ; then |
---|
| 593 | LIBS="$LIBS -lefence" |
---|
| 594 | fi |
---|
[4555] | 595 | |
---|
[3863] | 596 | fi |
---|
| 597 | |
---|
[1945] | 598 | # FIXME: Replace `main' with a function in `-lm': |
---|
[2968] | 599 | AC_CHECK_LIB([m], [main]) |
---|
[1945] | 600 | |
---|
[4555] | 601 | |
---|
[1945] | 602 | # Checks for header files. |
---|
| 603 | AC_HEADER_STDC |
---|
| 604 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
| 605 | |
---|
| 606 | # Checks for typedefs, structures, and compiler characteristics. |
---|
| 607 | AC_HEADER_STDBOOL |
---|
| 608 | |
---|
| 609 | # Checks for library functions. |
---|
| 610 | AC_FUNC_MALLOC |
---|
| 611 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
| 612 | |
---|
[3424] | 613 | ###################### |
---|
| 614 | ## OUTPUT CONFIGURE ## |
---|
| 615 | ###################### |
---|
[1946] | 616 | AC_CONFIG_FILES([Makefile |
---|
[3377] | 617 | src/Makefile |
---|
[4555] | 618 | src/lib/Makefile |
---|
| 619 | src/lib/graphics/Makefile |
---|
| 620 | src/lib/graphics/importer/Makefile |
---|
| 621 | src/lib/sound/Makefile |
---|
| 622 | src/lib/event/Makefile |
---|
| 623 | src/lib/physics/Makefile |
---|
| 624 | src/lib/particles/Makefile |
---|
| 625 | src/lib/collision_detection/Makefile |
---|
| 626 | src/lib/gui/Makefile |
---|
[4265] | 627 | src/lib/tinyxml/Makefile |
---|
[4662] | 628 | src/subprojects/Makefile |
---|
[4555] | 629 | src/subprojects/testmain/Makefile |
---|
| 630 | src/subprojects/importer/Makefile |
---|
| 631 | src/subprojects/particles/Makefile |
---|
| 632 | src/subprojects/collision_detection/Makefile |
---|
| 633 | src/subprojects/gui/Makefile |
---|
| 634 | ]) |
---|
[3377] | 635 | |
---|
[1945] | 636 | AC_OUTPUT |
---|