[3424] | 1 | ########################################################################## |
---|
| 2 | # orxonox - the future of 3D-vertical-scrollers # |
---|
| 3 | # # |
---|
| 4 | # Copyright (C) 2004 orx # |
---|
| 5 | # # |
---|
| 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) # |
---|
| 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. # |
---|
| 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) |
---|
[3240] | 25 | AC_INIT(orxonox, 0.2.1-pre-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 |
---|
[2925] | 41 | AC_HEADER_STDC |
---|
[2701] | 42 | |
---|
[3424] | 43 | ################################## |
---|
| 44 | ## CHECKING OPTIONAL ARGUMENTS ## |
---|
| 45 | ################################## |
---|
| 46 | |
---|
| 47 | #-----------------# |
---|
| 48 | # DEBUG-statement # |
---|
| 49 | #-----------------# |
---|
[3173] | 50 | DEBUG=no |
---|
| 51 | AC_MSG_CHECKING([if DEBUG-mode should be enabled]) |
---|
[3181] | 52 | AC_ARG_ENABLE([debug], |
---|
[3205] | 53 | AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]), |
---|
| 54 | DEBUG=$enableval) |
---|
| 55 | |
---|
[3424] | 56 | if test x$DEBUG = xno; then |
---|
[3205] | 57 | echo "no" |
---|
[3424] | 58 | echo " -> Setting debuglevel to 3. (orxonox is still in Development. It really is needed." |
---|
| 59 | DEBUG=3 |
---|
| 60 | elif test x$DEBUG = xyes; then |
---|
[3205] | 61 | echo "yes" |
---|
[3424] | 62 | echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!." |
---|
| 63 | DEBUG=4 |
---|
[3205] | 64 | else |
---|
[3424] | 65 | echo "yes: setting debuglevel to to $DEBUG" |
---|
[3173] | 66 | fi |
---|
[3205] | 67 | AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are]) |
---|
| 68 | |
---|
[3173] | 69 | AC_SUBST(DEBUG) |
---|
| 70 | |
---|
[3424] | 71 | #--------------# |
---|
| 72 | # GTK-disabled # |
---|
| 73 | #--------------# |
---|
[3100] | 74 | AC_MSG_CHECKING([if gtk should be enabled]) |
---|
[3181] | 75 | AC_ARG_WITH([gtk], |
---|
| 76 | AC_HELP_STRING( [--without-gtk], |
---|
[3205] | 77 | [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes]) |
---|
[3424] | 78 | if test x$def_gtk = xyes; then |
---|
[3100] | 79 | echo "yes" |
---|
| 80 | fi |
---|
[3424] | 81 | if test x$def_gtk = xno; then |
---|
[3100] | 82 | echo "no" |
---|
| 83 | fi |
---|
[3423] | 84 | |
---|
[3424] | 85 | #------------------# |
---|
| 86 | # gThread-disabled # |
---|
| 87 | #------------------# |
---|
[3423] | 88 | AC_MSG_CHECKING([if gThread should be enabled]) |
---|
| 89 | AC_ARG_WITH([gthread], |
---|
[3424] | 90 | AC_HELP_STRING( [--without-gthread], |
---|
[3423] | 91 | [Prevents gThread from being loaded]), [def_gthread=no], [def_gthread=yes]) |
---|
[3424] | 92 | if test x$def_gthread = xyes; then |
---|
[3423] | 93 | echo "yes" |
---|
| 94 | fi |
---|
[3424] | 95 | if test x$def_gthread = xno; then |
---|
[3423] | 96 | echo "no" |
---|
| 97 | fi |
---|
| 98 | |
---|
[3424] | 99 | #------------------# |
---|
| 100 | # pthread-disabled # |
---|
| 101 | #------------------# |
---|
[3423] | 102 | AC_MSG_CHECKING([if pthread should be enabled]) |
---|
| 103 | AC_ARG_WITH([pthread], |
---|
| 104 | AC_HELP_STRING( [--without-pthread], |
---|
| 105 | [Prevents pthread from being loaded]), [def_pthread=no], [def_pthread=yes]) |
---|
[3424] | 106 | if test x$def_pthread = xyes; then |
---|
[3423] | 107 | echo "yes" |
---|
| 108 | fi |
---|
[3424] | 109 | if test x$def_pthread = xno; then |
---|
[3423] | 110 | echo "no" |
---|
| 111 | fi |
---|
| 112 | |
---|
[3424] | 113 | #------------------# |
---|
| 114 | # libCurl-disabled # |
---|
| 115 | #------------------# |
---|
[3423] | 116 | AC_MSG_CHECKING([if libcURL should be enabled]) |
---|
| 117 | AC_ARG_WITH([curl], |
---|
| 118 | AC_HELP_STRING( [--without-curl], |
---|
| 119 | [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes]) |
---|
[3424] | 120 | if test x$def_curl = xyes; then |
---|
[3423] | 121 | echo "yes" |
---|
| 122 | fi |
---|
[3424] | 123 | if test x$def_curl = xno; then |
---|
[3423] | 124 | echo "no" |
---|
| 125 | fi |
---|
| 126 | |
---|
[3424] | 127 | #-------------------# |
---|
| 128 | # SDL_image-disable # |
---|
| 129 | #-------------------# |
---|
[3140] | 130 | def_sdl_image=yes |
---|
| 131 | AC_MSG_CHECKING([if SDL_image should be enabled]) |
---|
[3181] | 132 | AC_ARG_WITH([sdl_image], |
---|
| 133 | AC_HELP_STRING( [--without-sdl-image], |
---|
[3140] | 134 | [Prevents SDL_image from being loaded]), [def_sdl_image=no]) |
---|
[3424] | 135 | if test x$def_sdl_image = xyes; then |
---|
[3140] | 136 | echo "yes" |
---|
| 137 | fi |
---|
[3424] | 138 | if test x$def_sdl_image = xno; then |
---|
[3140] | 139 | echo "no" |
---|
| 140 | fi |
---|
[3558] | 141 | |
---|
[3424] | 142 | #-------------------# |
---|
| 143 | # SubProject-enable # |
---|
| 144 | #-------------------# |
---|
| 145 | def_sub_projects=no |
---|
[3377] | 146 | AC_MSG_CHECKING([if the SubProjects should be built]) |
---|
| 147 | AC_ARG_ENABLE([sub-projects], |
---|
| 148 | AC_HELP_STRING( [--enable-sub-projects], |
---|
[3424] | 149 | [also builds the subProjects while make from srcdir]), [def_sub_projects=yes]) |
---|
| 150 | if test x$def_sub_projects = xyes; then |
---|
[3377] | 151 | echo "yes" |
---|
| 152 | fi |
---|
[3424] | 153 | if test x$def_sub_projects = xno; then |
---|
[3377] | 154 | echo "no" |
---|
| 155 | fi |
---|
| 156 | AM_CONDITIONAL(SUB_PROJECTS, test x$def_sub_projects = xyes) |
---|
| 157 | |
---|
[3558] | 158 | #----------------------# |
---|
| 159 | # Documentation-enable # |
---|
| 160 | #----------------------# |
---|
| 161 | def_documentation=no |
---|
| 162 | AC_MSG_CHECKING([if the Documentation should be build by default]) |
---|
| 163 | AC_ARG_ENABLE([documentation], |
---|
| 164 | AC_HELP_STRING( [--enable-documentation], |
---|
| 165 | [also builds the sDocumentation while make from srcdir]), [def_documentation=yes]) |
---|
| 166 | if test x$def_documentation = xyes; then |
---|
| 167 | echo "yes" |
---|
| 168 | fi |
---|
| 169 | if test x$def_documentation = xno; then |
---|
| 170 | echo "no" |
---|
| 171 | fi |
---|
| 172 | AM_CONDITIONAL(DOCUMENTATION, test x$def_documentation = xyes) |
---|
[3424] | 173 | ####################### |
---|
| 174 | ## PROGRAMM CHECKING ## |
---|
| 175 | ## 3. party Programs ## |
---|
| 176 | ####################### |
---|
| 177 | |
---|
| 178 | #----------------------# |
---|
| 179 | # checking for Doxygen # |
---|
| 180 | #----------------------# |
---|
[3219] | 181 | AC_PATH_PROG(DOXYGEN, doxygen) |
---|
| 182 | AM_CONDITIONAL(DOXYGEN, test $DOXYGEN) |
---|
| 183 | |
---|
[3424] | 184 | ######################### |
---|
| 185 | ## CHECKING FOR SYSTEM ## |
---|
| 186 | ######################### |
---|
| 187 | ## here the system is checked, and openGL is included |
---|
| 188 | ## also checking for SDL on differen Systems |
---|
[2701] | 189 | |
---|
| 190 | AC_MSG_CHECKING([for System]) |
---|
[2980] | 191 | ## checking for openGL-environment and other sys-specific parameters |
---|
| 192 | case "$target" in |
---|
[3424] | 193 | #---------# |
---|
| 194 | # WINDOWS # |
---|
| 195 | #---------# |
---|
[2980] | 196 | *-*-mingw32*) |
---|
[2701] | 197 | echo "mingw-WINDOWS detected" |
---|
| 198 | |
---|
| 199 | mingw="yes" |
---|
| 200 | MSBITFIELDS="-mms-bitfields" |
---|
| 201 | MWINDOWS="-mwindows" |
---|
| 202 | |
---|
| 203 | # checking gl header |
---|
| 204 | #done before loop |
---|
| 205 | |
---|
[2925] | 206 | # checking gl header |
---|
[2879] | 207 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
| 208 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
[2701] | 209 | # checking for Windows openGl library |
---|
[1971] | 210 | AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h") |
---|
[3424] | 211 | if test x$FOUND_opengl32 = xyes ; then |
---|
[1959] | 212 | LIBS="$LIBS -lopengl32" |
---|
[1971] | 213 | else |
---|
[1959] | 214 | echo "------------------" |
---|
| 215 | echo "opengl not found." |
---|
| 216 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
| 217 | echo "------------------" |
---|
| 218 | exit -1 |
---|
| 219 | fi |
---|
| 220 | |
---|
[2701] | 221 | # cheking for GLU-header |
---|
[3424] | 222 | AC_CHECK_HEADERS([GL/glu.h] ,, |
---|
[1971] | 223 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 224 | |
---|
[2701] | 225 | # checking for libGLU |
---|
[1971] | 226 | AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes) |
---|
[3424] | 227 | if test x$FOUND_glu32 = xyes ; then |
---|
[1959] | 228 | LIBS="$LIBS -lGLU32" |
---|
[2701] | 229 | else |
---|
[1959] | 230 | echo "------------------" |
---|
| 231 | echo "GLU library not found." |
---|
| 232 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
| 233 | echo "------------------" |
---|
| 234 | exit -1 |
---|
| 235 | fi |
---|
[1971] | 236 | |
---|
[2701] | 237 | # checking for mingw32 |
---|
| 238 | AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) |
---|
[3424] | 239 | if test x$FOUND_mingw32 = xyes; then |
---|
[2701] | 240 | LIBS="$LIBS -lmingw32" |
---|
| 241 | fi |
---|
[2982] | 242 | # checking for SDL-headers |
---|
[3424] | 243 | AC_CHECK_HEADERS([SDL/SDL.h] ,, |
---|
[2982] | 244 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
[2701] | 245 | |
---|
[2982] | 246 | #checking for libSDL |
---|
| 247 | AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes) |
---|
[3424] | 248 | if test x$FOUND_sdlmain = xyes ; then |
---|
[2982] | 249 | LIBS="$LIBS -lsdlmain" |
---|
| 250 | else |
---|
| 251 | echo "------------------" |
---|
| 252 | echo "SDL library not found." |
---|
| 253 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
| 254 | echo "------------------" |
---|
| 255 | exit 1 |
---|
| 256 | fi |
---|
| 257 | AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes) |
---|
[3424] | 258 | if test x$FOUND_sdl = xyes ; then |
---|
[2982] | 259 | LIBS="$LIBS -lsdl" |
---|
| 260 | else |
---|
| 261 | echo "------------------" |
---|
| 262 | echo "SDL library not found." |
---|
| 263 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
| 264 | echo "------------------" |
---|
| 265 | exit -1 |
---|
| 266 | fi |
---|
| 267 | |
---|
[2701] | 268 | ;; |
---|
[3424] | 269 | #-------# |
---|
| 270 | # LINUX # |
---|
| 271 | #-------# |
---|
[2980] | 272 | *-*-linux*) |
---|
[2701] | 273 | echo "Linux detected" |
---|
| 274 | |
---|
| 275 | Linux="yes" |
---|
| 276 | |
---|
[3180] | 277 | CPPFLAGS="-I/usr/X11R6/include" |
---|
[3385] | 278 | LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS" |
---|
[2925] | 279 | # checking gl header |
---|
[3424] | 280 | AC_CHECK_HEADERS([GL/gl.h] ,, |
---|
[2879] | 281 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
[2701] | 282 | |
---|
| 283 | # checking for Unix GL |
---|
[3385] | 284 | AC_CHECK_LIB([GL], [glLoadIdentity], FOUND_GL=yes) |
---|
[3424] | 285 | if test x$FOUND_GL = xyes ; then |
---|
[2701] | 286 | LIBS="$LIBS -lGL" |
---|
| 287 | else |
---|
| 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 |
---|
| 293 | fi |
---|
| 294 | |
---|
| 295 | # cheking for GLU-header |
---|
[3424] | 296 | AC_CHECK_HEADERS([GL/glu.h] ,, |
---|
[2701] | 297 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 298 | |
---|
| 299 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
[3424] | 300 | if test x$FOUND_GLU = xyes ; then |
---|
[2701] | 301 | LIBS="$LIBS -lGLU" |
---|
| 302 | else |
---|
| 303 | echo "------------------" |
---|
| 304 | echo "GLU library not found." |
---|
| 305 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
| 306 | echo "------------------" |
---|
| 307 | exit -1 |
---|
| 308 | fi |
---|
[2995] | 309 | |
---|
[2991] | 310 | # checking for SDL-headers |
---|
[3424] | 311 | AC_CHECK_HEADERS([SDL/SDL.h] ,, |
---|
[2991] | 312 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
[2982] | 313 | |
---|
[3140] | 314 | # checking for SDL-lib |
---|
[2991] | 315 | AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes) |
---|
[3424] | 316 | if test x$FOUND_SDL = xyes ; then |
---|
[2991] | 317 | LIBS="$LIBS -lSDL" |
---|
| 318 | else |
---|
| 319 | echo "------------------" |
---|
| 320 | echo "SDL library not found." |
---|
| 321 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
| 322 | echo "------------------" |
---|
| 323 | exit -1 |
---|
| 324 | fi |
---|
| 325 | |
---|
[3140] | 326 | |
---|
[2982] | 327 | ## checking for SDL |
---|
[2991] | 328 | # SDL_VERSION=1.2.7 |
---|
| 329 | # AM_PATH_SDL($SDL_VERSION, |
---|
| 330 | # :, |
---|
| 331 | # AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) |
---|
| 332 | # ) |
---|
| 333 | # CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" |
---|
| 334 | # LIBS="$LIBS $SDL_LIBS" |
---|
[2701] | 335 | ;; |
---|
[3424] | 336 | #-----------# |
---|
| 337 | # MAC -OS X # |
---|
| 338 | #-----------# |
---|
[2995] | 339 | *darwin*) |
---|
[3424] | 340 | echo "OS X detected" |
---|
[2995] | 341 | |
---|
| 342 | osX="yes" |
---|
| 343 | |
---|
[3140] | 344 | CPPFLAGS="-I/sw/include $CPPFLAGS" |
---|
[2995] | 345 | # checking gl header |
---|
[3424] | 346 | AC_CHECK_HEADERS([OpenGL/gl.h] ,, |
---|
[2995] | 347 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 348 | # cheking for GLU-header |
---|
[3424] | 349 | AC_CHECK_HEADERS([OpenGL/glu.h] ,, |
---|
[2995] | 350 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 351 | |
---|
| 352 | LIBS="$LIBS -framework OpenGL" |
---|
| 353 | |
---|
[3424] | 354 | SDL_CFLAGS=`sdl-config --cflags` |
---|
| 355 | SDL_LIBS=`sdl-config --libs` |
---|
| 356 | CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" |
---|
| 357 | LIBS="$LIBS $SDL_LIBS" |
---|
| 358 | |
---|
| 359 | |
---|
[2995] | 360 | # checking for SDL-headers |
---|
[3001] | 361 | # AC_CHECK_HEADERS(SDL/SDL.h ,, |
---|
| 362 | # [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
[2995] | 363 | |
---|
| 364 | ## checking for SDL |
---|
| 365 | # SDL_VERSION=1.2.7 |
---|
| 366 | # AM_PATH_SDL($SDL_VERSION, |
---|
| 367 | # :, |
---|
| 368 | # AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) |
---|
| 369 | # ) |
---|
| 370 | |
---|
[3140] | 371 | |
---|
[2995] | 372 | ;; |
---|
| 373 | |
---|
[2701] | 374 | *) |
---|
| 375 | ;; |
---|
| 376 | esac |
---|
[2968] | 377 | |
---|
[2701] | 378 | AC_SUBST(MSBITFIELDS) |
---|
| 379 | |
---|
[3424] | 380 | ################################### |
---|
| 381 | ## CHECKING FOR HEADERS AND LIBS ## |
---|
| 382 | ################################### |
---|
| 383 | |
---|
| 384 | #-----------# |
---|
| 385 | # SDL_Image # |
---|
| 386 | #-----------# |
---|
| 387 | if test x$def_sdl_image = xyes; then |
---|
[3140] | 388 | # checking for SDL_image-headers |
---|
[3424] | 389 | AC_CHECK_HEADERS([SDL/SDL_image.h] ,, |
---|
[3178] | 390 | [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ]) |
---|
[3140] | 391 | fi |
---|
[3424] | 392 | if test x$def_sdl_image = xyes; then |
---|
[3140] | 393 | # checking for SDL_image-lib |
---|
[3424] | 394 | AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes]) |
---|
| 395 | if test x$FOUND_SDL_image = xyes ; then |
---|
[3140] | 396 | LIBS="$LIBS -lSDL_image" |
---|
| 397 | else |
---|
| 398 | echo "------------------" |
---|
| 399 | echo "SDL_image library not found." |
---|
| 400 | echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/" |
---|
| 401 | echo "------------------" |
---|
| 402 | exit -1 |
---|
| 403 | fi |
---|
| 404 | fi |
---|
[2701] | 405 | |
---|
[3424] | 406 | ## case no SDL-image: |
---|
| 407 | if test x$def_sdl_image = xno; then |
---|
| 408 | #---------# |
---|
| 409 | # libjpeg # |
---|
| 410 | #---------# |
---|
| 411 | AC_CHECK_HEADERS([jpeglib.h], [jpegHeader="yes"], |
---|
| 412 | [jpegHeader="no"]) |
---|
[3425] | 413 | if test x$jpegHeader = xno; then |
---|
[3140] | 414 | echo " not including jpeg." |
---|
| 415 | else |
---|
[3424] | 416 | AC_CHECK_LIB([jpeg], [main], [FOUND_jpeg=yes]) |
---|
| 417 | if test x$FOUND_jpeg = xyes ; then |
---|
[3140] | 418 | LIBS="$LIBS -ljpeg" |
---|
| 419 | else |
---|
| 420 | echo "------------------" |
---|
| 421 | echo "jpeg library not found." |
---|
| 422 | echo "please install the jpeg library from the Independent JPEG Group, which can be found at http://www.ijg.org" |
---|
| 423 | echo "------------------" |
---|
| 424 | exit -1 |
---|
| 425 | fi |
---|
| 426 | fi |
---|
[2980] | 427 | |
---|
[3424] | 428 | #--------# |
---|
| 429 | # libpng # |
---|
| 430 | #--------# |
---|
| 431 | AC_CHECK_HEADERS([png.h], [pngHeader="yes"], |
---|
| 432 | [pngHeader="no"]) |
---|
| 433 | if test x$pngHeader = xno; then |
---|
[3140] | 434 | echo " not including png." |
---|
| 435 | else |
---|
| 436 | AC_CHECK_LIB([png], [main], FOUND_png=yes) |
---|
[3424] | 437 | if test x$FOUND_png = xyes ; then |
---|
[3140] | 438 | LIBS="$LIBS -lpng" |
---|
| 439 | else |
---|
| 440 | echo "------------------" |
---|
| 441 | echo "png library not found." |
---|
| 442 | echo "please install the png library, which can be found at http://libpng.org/pub/png/libpng.html" |
---|
| 443 | echo "------------------" |
---|
| 444 | exit -1 |
---|
| 445 | fi |
---|
| 446 | fi |
---|
| 447 | fi |
---|
| 448 | |
---|
[3424] | 449 | #-----# |
---|
| 450 | # GTK # |
---|
| 451 | #-----# |
---|
| 452 | if test x$def_gtk = xyes; then |
---|
[3100] | 453 | |
---|
| 454 | #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no) |
---|
| 455 | AC_MSG_CHECKING([for gtk2.0]) |
---|
| 456 | if `pkg-config --exists gtk+-2.0`; then |
---|
| 457 | echo "yes" |
---|
| 458 | have_gtk2=yes |
---|
| 459 | GTK2_LIBS=`pkg-config --libs gtk+-2.0` |
---|
| 460 | GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0` |
---|
[3101] | 461 | AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2]) |
---|
[3100] | 462 | else |
---|
| 463 | echo "no" |
---|
| 464 | fi |
---|
[3101] | 465 | |
---|
[3099] | 466 | fi |
---|
[2980] | 467 | AC_SUBST(GTK2_LIBS) |
---|
| 468 | AC_SUBST(GTK2_CFLAGS) |
---|
[3100] | 469 | AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes) |
---|
[2980] | 470 | |
---|
[3424] | 471 | #---------# |
---|
| 472 | # gThread # |
---|
| 473 | #---------# |
---|
| 474 | if test x$def_gthread = xyes; then |
---|
[2980] | 475 | |
---|
[3423] | 476 | AC_MSG_CHECKING([for gthread]) |
---|
| 477 | if `pkg-config --exists gthread-2.0`; then |
---|
| 478 | echo "yes" |
---|
| 479 | have_gthread=yes |
---|
| 480 | GTHREAD_LIBS=`pkg-config --libs gthread-2.0` |
---|
| 481 | GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0` |
---|
| 482 | AC_DEFINE_UNQUOTED(HAVE_GTHREAD, 1, [if we have gThread]) |
---|
| 483 | else |
---|
| 484 | echo "no" |
---|
| 485 | fi |
---|
[3100] | 486 | |
---|
[3423] | 487 | fi |
---|
| 488 | AC_SUBST(GTHREAD_LIBS) |
---|
| 489 | AC_SUBST(GTHREAD_CFLAGS) |
---|
| 490 | AM_CONDITIONAL(HAVE_GTHREAD, test x$have_gthread = xyes) |
---|
[2190] | 491 | |
---|
[3424] | 492 | #---------# |
---|
| 493 | # libcURL # |
---|
| 494 | #---------# |
---|
| 495 | if test x$def_curl = xyes; then |
---|
[2190] | 496 | |
---|
[3424] | 497 | AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"]) |
---|
[3423] | 498 | AC_CHECK_LIB([curl], [main], [FOUND_curl=yes]) |
---|
| 499 | if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then |
---|
| 500 | have_curl=yes |
---|
| 501 | CURL_LIBS=`curl-config --libs` |
---|
| 502 | CURLCFLAGS=`curl-config --cflags` |
---|
| 503 | AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL]) |
---|
[3424] | 504 | else |
---|
[3423] | 505 | have_curl=no |
---|
| 506 | fi |
---|
| 507 | |
---|
| 508 | fi |
---|
| 509 | AC_SUBST(CURL_LIBS) |
---|
| 510 | AC_SUBST(CURL_CFLAGS) |
---|
| 511 | AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes) |
---|
| 512 | |
---|
[3424] | 513 | #---------# |
---|
| 514 | # pthread # |
---|
| 515 | #---------# |
---|
[3423] | 516 | if test x$def_pthread = xyes ; then |
---|
| 517 | if test x$have_gthread = xyes ; then |
---|
[3424] | 518 | AC_CHECK_HEADERS([pthread.h], [pthreadHeader="yes"], [pthreadHeader="no"]) |
---|
| 519 | AC_CHECK_LIB([pthread], [main], [FOUND_pthread=yes]) |
---|
| 520 | if test x$FOUND_pthread = xyes ; then |
---|
[3423] | 521 | LIBS="$LIBS -lpthread" |
---|
| 522 | fi |
---|
| 523 | fi |
---|
| 524 | fi |
---|
[3424] | 525 | |
---|
| 526 | |
---|
[1945] | 527 | # FIXME: Replace `main' with a function in `-lm': |
---|
[2968] | 528 | AC_CHECK_LIB([m], [main]) |
---|
[1945] | 529 | |
---|
[3099] | 530 | |
---|
[1945] | 531 | # Checks for header files. |
---|
| 532 | AC_HEADER_STDC |
---|
| 533 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
| 534 | |
---|
| 535 | # Checks for typedefs, structures, and compiler characteristics. |
---|
| 536 | AC_HEADER_STDBOOL |
---|
| 537 | |
---|
| 538 | # Checks for library functions. |
---|
| 539 | AC_FUNC_MALLOC |
---|
| 540 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
| 541 | |
---|
[3424] | 542 | ###################### |
---|
| 543 | ## OUTPUT CONFIGURE ## |
---|
| 544 | ###################### |
---|
[1946] | 545 | AC_CONFIG_FILES([Makefile |
---|
[3377] | 546 | src/Makefile |
---|
[3493] | 547 | src/lib/Makefile |
---|
| 548 | src/lib/graphics/Makefile |
---|
[3485] | 549 | src/lib/graphics/importer/Makefile |
---|
[3493] | 550 | src/lib/gui/Makefile |
---|
[3489] | 551 | src/lib/gui/console/Makefile |
---|
[3549] | 552 | src/lib/gui/gui/Makefile |
---|
| 553 | src/subprojects/Makefile |
---|
| 554 | src/subprojects/testmain/Makefile]) |
---|
[3377] | 555 | |
---|
[1945] | 556 | AC_OUTPUT |
---|