Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3499 in orxonox.OLD for orxonox/branches/levelloader/configure.ac


Ignore:
Timestamp:
Mar 11, 2005, 2:55:27 PM (20 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: merged updated trunk structure into levelloader branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/configure.ac

    r3385 r3499  
    1 #                                               -*- Autoconf -*-
    2 # Process this file with autoconf to produce a configure script.
    3 
     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##########################################################################
     20
     21#########################
     22## AUTOCONF INIT PHASE ##
     23#########################
    424AC_PREREQ(2.56)
    525AC_INIT(orxonox, 0.2.1-pre-alpha, [orxonox-dev at mail.datacore.ch])
    626
    7 # Detect the canonical host and target build environment.
     27## Detect the canonical host and target build environment.
    828AC_CANONICAL_BUILD
    929AC_CANONICAL_HOST
    1030AC_CANONICAL_TARGET
    1131
    12 
    1332AM_INIT_AUTOMAKE
    1433
     
    1635AC_CONFIG_HEADER([config.h])
    1736
    18 
    19 # Checks for programs.
     37#########################
     38## Checks for programs ##
     39#########################
    2040AC_PROG_CXX
    2141AC_HEADER_STDC
    2242
    23 ### CHECKING  OPTIONAT ARGUMENTS
    24 ## DEBUG-statement
     43##################################
     44## CHECKING  OPTIONAL ARGUMENTS ##
     45##################################
     46
     47#-----------------#
     48# DEBUG-statement #
     49#-----------------#
    2550DEBUG=no
    2651AC_MSG_CHECKING([if DEBUG-mode should be enabled])
     
    2954         DEBUG=$enableval)
    3055
    31 if test "$DEBUG" = "no"; then
     56if test x$DEBUG = xno; then
    3257        echo "no"
    33         echo " -> Setting debuglevel to 1. Like this you can still see errors."
    34         DEBUG=1
    35 elif test "$DEBUG" = yes; then
     58        echo " -> Setting debuglevel to 3. (orxonox is still in Development. It really is needed."
     59        DEBUG=3
     60elif test x$DEBUG = xyes; then
    3661        echo "yes"
    37         echo " -> Setting debuglevel to 3. HARD DEBUG MODE!!."
    38         DEBUG=3
     62        echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!."
     63        DEBUG=4
    3964else       
    40         echo "yes set to $DEBUG"
     65        echo "yes: setting debuglevel to to $DEBUG"
    4166fi
    4267        AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are])
     
    4469AC_SUBST(DEBUG)
    4570
    46 ## GTK-disabled
     71#--------------#
     72# GTK-disabled #
     73#--------------#
    4774AC_MSG_CHECKING([if gtk should be enabled])
    4875AC_ARG_WITH([gtk],
    4976        AC_HELP_STRING( [--without-gtk],
    5077        [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
    51 if test "$def_gtk" = yes; then
     78if test x$def_gtk = xyes; then
    5279  echo "yes"
    5380fi
    54 if test "$def_gtk" = no; then
     81if test x$def_gtk = xno; then
    5582  echo "no"
    5683fi
    57 ### SDL_image-disable
     84
     85#------------------#
     86# gThread-disabled #
     87#------------------#
     88AC_MSG_CHECKING([if gThread should be enabled])
     89AC_ARG_WITH([gthread],
     90        AC_HELP_STRING( [--without-gthread],
     91        [Prevents gThread from being loaded]), [def_gthread=no], [def_gthread=yes])
     92if test x$def_gthread = xyes; then
     93  echo "yes"
     94fi
     95if test x$def_gthread = xno; then
     96  echo "no"
     97fi
     98
     99#------------------#
     100# pthread-disabled #
     101#------------------#
     102AC_MSG_CHECKING([if pthread should be enabled])
     103AC_ARG_WITH([pthread],
     104        AC_HELP_STRING( [--without-pthread],
     105        [Prevents pthread from being loaded]), [def_pthread=no], [def_pthread=yes])
     106if test x$def_pthread = xyes; then
     107  echo "yes"
     108fi
     109if test x$def_pthread = xno; then
     110  echo "no"
     111fi
     112
     113#------------------#
     114# libCurl-disabled #
     115#------------------#
     116AC_MSG_CHECKING([if libcURL should be enabled])
     117AC_ARG_WITH([curl],
     118        AC_HELP_STRING( [--without-curl],
     119        [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
     120if test x$def_curl = xyes; then
     121  echo "yes"
     122fi
     123if test x$def_curl = xno; then
     124  echo "no"
     125fi
     126
     127#-------------------#
     128# SDL_image-disable #
     129#-------------------#
    58130def_sdl_image=yes
    59131AC_MSG_CHECKING([if SDL_image should be enabled])
     
    61133        AC_HELP_STRING( [--without-sdl-image],
    62134        [Prevents SDL_image from being loaded]), [def_sdl_image=no])
    63 if test "$def_sdl_image" = yes; then
     135if test x$def_sdl_image = xyes; then
    64136  echo "yes"
    65137fi
    66 if test "$def_sdl_image" = no; then
     138if test x$def_sdl_image = xno; then
    67139  echo "no"
    68140fi
    69 
    70 
    71 ### SubProject-enable
    72 def_sdl_image=yes
     141#-------------------#
     142# SubProject-enable #
     143#-------------------#
     144def_sub_projects=no
    73145AC_MSG_CHECKING([if the SubProjects should be built])
    74146AC_ARG_ENABLE([sub-projects],
    75147        AC_HELP_STRING( [--enable-sub-projects],
    76         [also builds the subProjects by default]), [def_sub_projects=yes])
    77 if test "$def_sub_projects" = yes; then
     148        [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
     149if test x$def_sub_projects = xyes; then
    78150  echo "yes"
    79151fi
    80 if test "$def_sub_projects" = no; then
     152if test x$def_sub_projects = xno; then
    81153  echo "no"
    82154fi
    83155AM_CONDITIONAL(SUB_PROJECTS, test x$def_sub_projects = xyes)
    84156
    85 ## PROGRAMM CHECKING
    86 # checking for Doxygen
     157#######################
     158## PROGRAMM CHECKING ##
     159## 3. party Programs ##
     160#######################
     161
     162#----------------------#
     163# checking for Doxygen #
     164#----------------------#
    87165AC_PATH_PROG(DOXYGEN, doxygen)
    88166AM_CONDITIONAL(DOXYGEN, test $DOXYGEN)
    89167
    90 ### CHECKING FOR SYSTEM ###
     168#########################
     169## CHECKING FOR SYSTEM ##
     170#########################
     171## here the system is checked, and openGL is included
     172## also checking for SDL on differen Systems
    91173
    92174AC_MSG_CHECKING([for System])
    93175## checking for openGL-environment and other sys-specific parameters
    94176case "$target" in
    95 ### WINDOWS ###
     177#---------#
     178# WINDOWS #
     179#---------#
    96180  *-*-mingw32*)
    97181echo "mingw-WINDOWS detected"
     
    109193#   checking for Windows openGl library
    110194    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
    111     if test "$FOUND_opengl32" = "yes" ; then
     195    if test x$FOUND_opengl32 = xyes ; then
    112196        LIBS="$LIBS -lopengl32"
    113197    else
     
    120204
    121205# cheking for GLU-header
    122     AC_CHECK_HEADERS(GL/glu.h ,,
     206    AC_CHECK_HEADERS([GL/glu.h] ,,
    123207      [AC_MSG_ERROR([cannot find opengl headers]) ])
    124208
    125209# checking for libGLU
    126210    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
    127     if test "$FOUND_glu32" = "yes" ; then
     211    if test x$FOUND_glu32 = xyes ; then
    128212        LIBS="$LIBS -lGLU32"
    129213    else
     
    137221# checking for mingw32
    138222    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
    139     if test $FOUND_mingw32 = "yes"; then
     223    if test x$FOUND_mingw32 = xyes; then
    140224        LIBS="$LIBS -lmingw32"
    141225    fi
    142226# checking for SDL-headers
    143     AC_CHECK_HEADERS(SDL/SDL.h ,,
     227    AC_CHECK_HEADERS([SDL/SDL.h] ,,
    144228      [AC_MSG_ERROR([cannot find SDL headers]) ])
    145229
    146230#checking for libSDL
    147231    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
    148     if test "$FOUND_sdlmain" = "yes" ; then
     232    if test x$FOUND_sdlmain = xyes ; then
    149233       LIBS="$LIBS -lsdlmain"
    150234    else
     
    156240    fi
    157241    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
    158     if test "$FOUND_sdl" = "yes" ; then
     242    if test x$FOUND_sdl = xyes ; then
    159243       LIBS="$LIBS -lsdl"
    160244    else
     
    167251
    168252    ;;
    169 
    170 ### LINUX ###
     253#-------#
     254# LINUX #
     255#-------#
    171256 *-*-linux*)
    172257echo "Linux detected"
     
    177262LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
    178263# checking gl header
    179    AC_CHECK_HEADERS(GL/gl.h ,,
     264   AC_CHECK_HEADERS([GL/gl.h] ,,
    180265      [AC_MSG_ERROR([cannot find opengl headers]) ])
    181266
    182267#  checking for Unix GL
    183268   AC_CHECK_LIB([GL], [glLoadIdentity], FOUND_GL=yes)
    184    if test "$FOUND_GL" = "yes" ; then
     269   if test x$FOUND_GL = xyes ; then
    185270     LIBS="$LIBS -lGL"
    186271   else
     
    193278
    194279# cheking for GLU-header
    195     AC_CHECK_HEADERS(GL/glu.h ,,
     280    AC_CHECK_HEADERS([GL/glu.h] ,,
    196281      [AC_MSG_ERROR([cannot find opengl headers]) ])
    197282
    198283    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
    199     if test "$FOUND_GLU" = "yes" ; then
     284    if test x$FOUND_GLU = xyes ; then
    200285      LIBS="$LIBS -lGLU"
    201286    else
     
    208293
    209294# checking for SDL-headers
    210     AC_CHECK_HEADERS(SDL/SDL.h ,,
     295    AC_CHECK_HEADERS([SDL/SDL.h] ,,
    211296      [AC_MSG_ERROR([cannot find SDL headers]) ])
    212297
    213298# checking for SDL-lib
    214299    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
    215      if test "$FOUND_SDL" = "yes" ; then
     300     if test x$FOUND_SDL = xyes ; then
    216301       LIBS="$LIBS -lSDL"
    217302     else
     
    233318#    LIBS="$LIBS $SDL_LIBS"
    234319    ;;
    235 
    236 ### OS X ###
     320#-----------#
     321# MAC -OS X #
     322#-----------#
    237323 *darwin*)
    238 echo "OS X detected"
     324 echo "OS X detected"
    239325
    240326 osX="yes"
     
    242328 CPPFLAGS="-I/sw/include $CPPFLAGS"
    243329# checking gl header
    244    AC_CHECK_HEADERS(OpenGL/gl.h ,,
     330   AC_CHECK_HEADERS([OpenGL/gl.h] ,,
    245331      [AC_MSG_ERROR([cannot find opengl headers]) ])
    246332# cheking for GLU-header
    247     AC_CHECK_HEADERS(OpenGL/glu.h ,,
     333    AC_CHECK_HEADERS([OpenGL/glu.h] ,,
    248334      [AC_MSG_ERROR([cannot find opengl headers]) ])
    249335
    250336   LIBS="$LIBS -framework OpenGL"
     337
     338       SDL_CFLAGS=`sdl-config --cflags`
     339       SDL_LIBS=`sdl-config --libs`
     340       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
     341       LIBS="$LIBS $SDL_LIBS"
     342
    251343
    252344# checking for SDL-headers
     
    261353#      )
    262354
    263        SDL_CFLAGS=`sdl-config --cflags`
    264        SDL_LIBS=`sdl-config --libs`
    265        CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
    266        LIBS="$LIBS $SDL_LIBS"
    267355
    268356    ;;
     
    274362AC_SUBST(MSBITFIELDS)
    275363
    276 ## check for SDL_Image
    277 if test "$def_sdl_image" = "yes"; then
     364###################################
     365## CHECKING FOR HEADERS AND LIBS ##
     366###################################
     367
     368#-----------#
     369# SDL_Image #
     370#-----------#
     371if test x$def_sdl_image = xyes; then
    278372# checking for SDL_image-headers
    279   AC_CHECK_HEADERS(SDL/SDL_image.h ,,
     373  AC_CHECK_HEADERS([SDL/SDL_image.h] ,,
    280374      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
    281375fi
    282 if test "$def_sdl_image" = "yes"; then
     376if test x$def_sdl_image = xyes; then
    283377# checking for SDL_image-lib
    284   AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
    285      if test "$FOUND_SDL_image" = "yes" ; then
     378  AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes])
     379     if test x$FOUND_SDL_image = xyes ; then
    286380       LIBS="$LIBS -lSDL_image"
    287381     else
     
    294388fi
    295389
    296 
    297 if test "$def_sdl_image" = "no"; then
    298  ## checking for libjpeg
    299  AC_CHECK_HEADERS(jpeglib.h ,jpegHeader="yes",
    300         jpegHeader="no")
    301  if test $jpegHeader = "no"; then
     390## case no SDL-image:
     391if test x$def_sdl_image = xno; then
     392#---------#
     393# libjpeg #
     394#---------#
     395 AC_CHECK_HEADERS([jpeglib.h], [jpegHeader="yes"],
     396        [jpegHeader="no"])
     397 if test x$jpegHeader = xno; then
    302398        echo " not including jpeg."
    303399 else
    304   AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes)
    305     if test "$FOUND_jpeg" = "yes" ; then
     400  AC_CHECK_LIB([jpeg], [main], [FOUND_jpeg=yes])
     401    if test x$FOUND_jpeg = xyes ; then
    306402      LIBS="$LIBS -ljpeg"
    307403    else
     
    314410 fi
    315411
    316  ## checking for libpng
    317  AC_CHECK_HEADERS(png.h ,pngHeader="yes",
    318         pngHeader="no")
    319  if test $pngHeader = "no"; then
     412#--------#
     413# libpng #
     414#--------#
     415 AC_CHECK_HEADERS([png.h], [pngHeader="yes"],
     416        [pngHeader="no"])
     417 if test x$pngHeader = xno; then
    320418        echo " not including png."
    321419 else
    322420  AC_CHECK_LIB([png], [main], FOUND_png=yes)
    323     if test "$FOUND_png" = "yes" ; then
     421    if test x$FOUND_png = xyes ; then
    324422      LIBS="$LIBS -lpng"
    325423    else
     
    333431fi
    334432
    335 ## checking for GTK
    336 if test "$def_gtk" = yes; then
     433#-----#
     434# GTK #
     435#-----#
     436if test x$def_gtk = xyes; then
    337437
    338438        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
     
    353453AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
    354454
    355 
    356 
    357 #checking for pthread libs
    358 # AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
    359 # if test "$FOUND_pthread" = "yes" ; then
    360 #    LIBS="$LIBS -lpthread"
    361 # fi
     455#---------#
     456# gThread #
     457#---------#
     458if test x$def_gthread = xyes; then
     459
     460        AC_MSG_CHECKING([for gthread])
     461        if `pkg-config --exists gthread-2.0`; then
     462                echo "yes"
     463                have_gthread=yes
     464                GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
     465                GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
     466                AC_DEFINE_UNQUOTED(HAVE_GTHREAD, 1, [if we have gThread])
     467        else
     468                echo "no"
     469        fi
     470
     471fi
     472AC_SUBST(GTHREAD_LIBS)
     473AC_SUBST(GTHREAD_CFLAGS)
     474AM_CONDITIONAL(HAVE_GTHREAD, test x$have_gthread = xyes)
     475
     476#---------#
     477# libcURL #
     478#---------#
     479if test x$def_curl = xyes; then
     480
     481 AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"])
     482 AC_CHECK_LIB([curl], [main], [FOUND_curl=yes])
     483 if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
     484  have_curl=yes
     485  CURL_LIBS=`curl-config --libs`
     486  CURLCFLAGS=`curl-config --cflags`
     487  AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL])
     488 else
     489  have_curl=no
     490 fi
     491
     492fi
     493AC_SUBST(CURL_LIBS)
     494AC_SUBST(CURL_CFLAGS)
     495AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
     496
     497#---------#
     498# pthread #
     499#---------#
     500if test x$def_pthread = xyes ; then
     501 if test x$have_gthread = xyes ; then
     502  AC_CHECK_HEADERS([pthread.h], [pthreadHeader="yes"], [pthreadHeader="no"])
     503  AC_CHECK_LIB([pthread], [main], [FOUND_pthread=yes])
     504   if test x$FOUND_pthread = xyes ; then
     505      LIBS="$LIBS -lpthread"
     506   fi
     507 fi
     508fi
    362509
    363510
     
    377524AC_CHECK_FUNCS([bzero sqrt])
    378525
     526######################
     527## OUTPUT CONFIGURE ##
     528######################
    379529AC_CONFIG_FILES([Makefile
    380530                 src/Makefile
    381                  src/importer/Makefile
    382                  src/console/Makefile
    383                  src/gui/Makefile])
     531                 src/lib/Makefile
     532                 src/lib/graphics/Makefile
     533                 src/lib/graphics/importer/Makefile
     534                 src/lib/gui/Makefile
     535                 src/lib/gui/console/Makefile
     536                 src/lib/gui/gui/Makefile])
    384537
    385538AC_OUTPUT
Note: See TracChangeset for help on using the changeset viewer.