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