Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 3837 was 3790, checked in by bensch, 20 years ago

orxonox/trunk: merged the textEngine back into the trunk.
merged with command:
svn merge -r 3681:HEAD branches/textEngine/ trunk/

conflicts in:
world.cc/h orxonox.cc NEWS
changed in favor of the trunk

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