Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/configure.ac @ 4127

Last change on this file since 4127 was 4061, checked in by bensch, 20 years ago

orxonox/trunk: no more multi-Threading-support… maybe again in the future, who knows

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