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