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