Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/sound_engine/configure.ac @ 4225

Last change on this file since 4225 was 3885, checked in by bensch, 20 years ago

orxonox/branches/sound_engine: configure works

File size: 15.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)
[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# SubProject-enable #
145#-------------------#
146def_sub_projects=no
[3377]147AC_MSG_CHECKING([if the SubProjects should be built])
148AC_ARG_ENABLE([sub-projects],
149        AC_HELP_STRING( [--enable-sub-projects],
[3424]150        [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
151if test x$def_sub_projects = xyes; then
[3377]152  echo "yes"
153fi
[3424]154if test x$def_sub_projects = xno; then
[3377]155  echo "no"
156fi
157AM_CONDITIONAL(SUB_PROJECTS, test x$def_sub_projects = xyes)
158
[3788]159#-------------------#
160# Profiling Enabled #
161#-------------------#
162def_profiling=no
163AC_MSG_CHECKING([if Profiling should be enabled])
164AC_ARG_ENABLE([profile],
165        AC_HELP_STRING( [--enable-profile],
166        [builds orxonox with profiling support]), [def_profiling=yes])
167if test x$def_profiling = xyes; then
168  echo "yes"
169  CXXFLAGS="$CXXFLAGS -pg"
170fi
171if test x$def_profiling = xno; then
172  echo "no"
173fi
174
[3863]175#----------------#
176# efence Enabled #
177#----------------#
178def_efence=no
179AC_MSG_CHECKING([if efence should be enabled])
180AC_ARG_ENABLE([efence],
181        AC_HELP_STRING( [--enable-efence],
182        [builds orxonox with efence support]), [def_efence=yes])
183if test x$def_efence = xyes; then
184  echo "yes"
185fi
186if test x$def_efence = xno; then
187  echo "no"
188fi
189
[3558]190#----------------------#
191# Documentation-enable #
192#----------------------#
193def_documentation=no
194AC_MSG_CHECKING([if the Documentation should be build by default])
195AC_ARG_ENABLE([documentation],
196        AC_HELP_STRING( [--enable-documentation],
197        [also builds the sDocumentation while make from srcdir]), [def_documentation=yes])
198if test x$def_documentation = xyes; then
199  echo "yes"
200fi
201if test x$def_documentation = xno; then
202  echo "no"
203fi
204AM_CONDITIONAL(DOCUMENTATION, test x$def_documentation = xyes)
[3424]205#######################
206## PROGRAMM CHECKING ##
207## 3. party Programs ##
208#######################
209
210#----------------------#
211# checking for Doxygen #
212#----------------------#
[3219]213AC_PATH_PROG(DOXYGEN, doxygen)
214AM_CONDITIONAL(DOXYGEN, test $DOXYGEN)
215
[3789]216#--------------------#
217# checking for gprof #
218#--------------------#
219AC_PATH_PROG(GPROF, gprof)
220
[3424]221#########################
222## CHECKING FOR SYSTEM ##
223#########################
224## here the system is checked, and openGL is included
225## also checking for SDL on differen Systems
[2701]226
227AC_MSG_CHECKING([for System])
[2980]228## checking for openGL-environment and other sys-specific parameters
229case "$target" in
[3424]230#---------#
231# WINDOWS #
232#---------#
[2980]233  *-*-mingw32*)
[2701]234echo "mingw-WINDOWS detected"
235
[3790]236CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL"
237
[2701]238    mingw="yes"
239    MSBITFIELDS="-mms-bitfields"
240    MWINDOWS="-mwindows"
241
242# checking gl header
243        #done before loop
244
[2925]245# checking gl header
[2879]246   AC_CHECK_HEADERS(GL/gl.h ,,
247      [AC_MSG_ERROR([cannot find opengl headers]) ])
[2701]248#   checking for Windows openGl library
[1971]249    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
[3424]250    if test x$FOUND_opengl32 = xyes ; then
[1959]251        LIBS="$LIBS -lopengl32"
[1971]252    else
[1959]253         echo "------------------"
254         echo "opengl not found."
255         echo "please install the opengl package which can be found at http://www.opengl.org"
256         echo "------------------"
257         exit -1
258    fi
259
[2701]260# cheking for GLU-header
[3424]261    AC_CHECK_HEADERS([GL/glu.h] ,,
[1971]262      [AC_MSG_ERROR([cannot find opengl headers]) ])
263
[2701]264# checking for libGLU
[1971]265    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
[3424]266    if test x$FOUND_glu32 = xyes ; then
[1959]267        LIBS="$LIBS -lGLU32"
[2701]268    else
[1959]269         echo "------------------"
270         echo "GLU library not found."
271         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
272         echo "------------------"
273         exit -1
274    fi
[1971]275
[2701]276# checking for mingw32
277    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
[3424]278    if test x$FOUND_mingw32 = xyes; then
[2701]279        LIBS="$LIBS -lmingw32"
280    fi
[2982]281# checking for SDL-headers
[3790]282    AC_CHECK_HEADERS([SDL.h] ,,
[2982]283      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2701]284
[2982]285#checking for libSDL
286    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
[3424]287    if test x$FOUND_sdlmain = xyes ; then
[2982]288       LIBS="$LIBS -lsdlmain"
289    else
290        echo "------------------"
291        echo "SDL library not found."
292        echo "please install the SDL library, which can be found at http://www.libsdl.org"
293        echo "------------------"
294        exit 1
295    fi
296    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
[3424]297    if test x$FOUND_sdl = xyes ; then
[2982]298       LIBS="$LIBS -lsdl"
299    else
300        echo "------------------"
301        echo "SDL library not found."
302        echo "please install the SDL library, which can be found at http://www.libsdl.org"
303        echo "------------------"
304        exit -1
305    fi
306
[2701]307    ;;
[3424]308#-------#
309# LINUX #
310#-------#
[2980]311 *-*-linux*)
[2701]312echo "Linux detected"
313
314 Linux="yes"
315
[3790]316CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL"
[3385]317LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
[2925]318# checking gl header
[3424]319   AC_CHECK_HEADERS([GL/gl.h] ,,
[2879]320      [AC_MSG_ERROR([cannot find opengl headers]) ])
[2701]321
322#  checking for Unix GL
[3385]323   AC_CHECK_LIB([GL], [glLoadIdentity], FOUND_GL=yes)
[3424]324   if test x$FOUND_GL = xyes ; then
[2701]325     LIBS="$LIBS -lGL"
326   else
327         echo "------------------"
328         echo "opengl not found."
329         echo "please install the opengl package which can be found at http://www.opengl.org"
330         echo "------------------"
331         exit -1
332   fi
333
334# cheking for GLU-header
[3424]335    AC_CHECK_HEADERS([GL/glu.h] ,,
[2701]336      [AC_MSG_ERROR([cannot find opengl headers]) ])
337
338    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
[3424]339    if test x$FOUND_GLU = xyes ; then
[2701]340      LIBS="$LIBS -lGLU"
341    else
342         echo "------------------"
343         echo "GLU library not found."
344         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
345         echo "------------------"
346         exit -1
347    fi   
[2995]348
[2991]349# checking for SDL-headers
[3790]350    AC_CHECK_HEADERS([SDL.h] ,,
[2991]351      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2982]352
[3140]353# checking for SDL-lib
[2991]354    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
[3424]355     if test x$FOUND_SDL = xyes ; then
[2991]356       LIBS="$LIBS -lSDL"
357     else
358        echo "------------------"
359        echo "SDL library not found."
360        echo "please install the SDL library, which can be found at http://www.libsdl.org"
361        echo "------------------"
362        exit -1
363     fi   
364
[3140]365
[2982]366## checking for SDL
[2991]367#    SDL_VERSION=1.2.7
368#    AM_PATH_SDL($SDL_VERSION,
369#      :,
370#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
371#      )
372#    CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
373#    LIBS="$LIBS $SDL_LIBS"
[2701]374    ;;
[3424]375#-----------#
376# MAC -OS X #
377#-----------#
[2995]378 *darwin*)
[3424]379 echo "OS X detected"
[2995]380
381 osX="yes"
382
[3140]383 CPPFLAGS="-I/sw/include $CPPFLAGS"
[2995]384# checking gl header
[3424]385   AC_CHECK_HEADERS([OpenGL/gl.h] ,,
[2995]386      [AC_MSG_ERROR([cannot find opengl headers]) ])
387# cheking for GLU-header
[3424]388    AC_CHECK_HEADERS([OpenGL/glu.h] ,,
[2995]389      [AC_MSG_ERROR([cannot find opengl headers]) ])
390
391   LIBS="$LIBS -framework OpenGL"
392
[3424]393       SDL_CFLAGS=`sdl-config --cflags`
394       SDL_LIBS=`sdl-config --libs`
395       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
396       LIBS="$LIBS $SDL_LIBS"
397
398
[2995]399# checking for SDL-headers
[3001]400#    AC_CHECK_HEADERS(SDL/SDL.h ,,
401#      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2995]402
403## checking for SDL
404#    SDL_VERSION=1.2.7
405#    AM_PATH_SDL($SDL_VERSION,
406#      :,
407#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
408#      )
409
[3140]410
[2995]411    ;;
412
[2701]413  *)
414    ;;
415esac
[2968]416
[2701]417AC_SUBST(MSBITFIELDS)
418
[3424]419###################################
420## CHECKING FOR HEADERS AND LIBS ##
421###################################
[3885]422#-----------#
423# SDL_mixer #
424#-----------#
425AC_CHECK_HEADERS([SDL/SDL_mixer.h] ,,
426      [AC_MSG_ERROR([sdl_mixer not found])])
427# checking for SDL_mixer-lib
428AC_CHECK_LIB([SDL_mixer], [main], [FOUND_SDL_mixer=yes])
429   if test x$FOUND_SDL_mixer = xyes ; then
430     LIBS="$LIBS -lSDL_mixer"
431   else
432      echo "------------------"
433      echo "SDL_mixer library not found."
434      echo "please install the SDL_mixer library, which can be found at http://www.libsdl.org/projects/SDL_mixer/"
435      echo "------------------"
436      exit -1
437   fi   
[3424]438
[3790]439#---------#
440# SDL_ttf #
441#---------#
442# checking for SDL_ttf-headers
443  AC_CHECK_HEADERS([SDL_ttf.h] ,,
444      [AC_MSG_ERROR([cannot find SDL_ttf header.])])
445#fi
446# checking for SDL_ttf-lib
447  AC_CHECK_LIB([SDL_ttf], [main], [FOUND_SDL_ttf=yes])
448     if test x$FOUND_SDL_ttf = xyes ; then
449       LIBS="$LIBS -lSDL_ttf"
450     else
451        echo "------------------"
452        echo "SDL_ttf library not found."
453        echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
454        echo "------------------"
455        exit -1
456     fi   
457
[3424]458#-----------#
459# SDL_Image #
460#-----------#
[3140]461# checking for SDL_image-headers
[3863]462AC_CHECK_HEADERS([SDL_image.h] ,,
463    [echo "sdl_image header not found."; def_sdl_image=no; exit -1])
[3140]464# checking for SDL_image-lib
[3863]465AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes])
466   if test x$FOUND_SDL_image = xyes ; then
467     LIBS="$LIBS -lSDL_image"
468   else
469      echo "------------------"
470      echo "SDL_image library not found."
471      echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
472      echo "------------------"
473      exit -1
474   fi
[2701]475
[3424]476#-----#
477# GTK #
478#-----#
479if test x$def_gtk = xyes; then
[3100]480
481        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
482        AC_MSG_CHECKING([for gtk2.0])
483        if `pkg-config --exists gtk+-2.0`; then
484                echo "yes"
485                have_gtk2=yes
486                GTK2_LIBS=`pkg-config --libs gtk+-2.0`
487                GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
[3101]488                AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
[3100]489        else
490                echo "no"
491        fi
[3101]492
[3099]493fi
[2980]494AC_SUBST(GTK2_LIBS)
495AC_SUBST(GTK2_CFLAGS)
[3100]496AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
[2980]497
[3424]498#---------#
499# gThread #
500#---------#
501if test x$def_gthread = xyes; then
[2980]502
[3423]503        AC_MSG_CHECKING([for gthread])
504        if `pkg-config --exists gthread-2.0`; then
505                echo "yes"
506                have_gthread=yes
507                GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
508                GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
509                AC_DEFINE_UNQUOTED(HAVE_GTHREAD, 1, [if we have gThread])
510        else
511                echo "no"
512        fi
[3100]513
[3423]514fi
515AC_SUBST(GTHREAD_LIBS)
516AC_SUBST(GTHREAD_CFLAGS)
517AM_CONDITIONAL(HAVE_GTHREAD, test x$have_gthread = xyes)
[2190]518
[3424]519#---------#
520# libcURL #
521#---------#
522if test x$def_curl = xyes; then
[2190]523
[3424]524 AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"])
[3423]525 AC_CHECK_LIB([curl], [main], [FOUND_curl=yes])
526 if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
527  have_curl=yes
528  CURL_LIBS=`curl-config --libs`
529  CURLCFLAGS=`curl-config --cflags`
530  AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL])
[3424]531 else
[3423]532  have_curl=no
533 fi
534
535fi
536AC_SUBST(CURL_LIBS)
537AC_SUBST(CURL_CFLAGS)
538AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
539
[3424]540#---------#
541# pthread #
542#---------#
[3423]543if test x$def_pthread = xyes ; then
544 if test x$have_gthread = xyes ; then
[3424]545  AC_CHECK_HEADERS([pthread.h], [pthreadHeader="yes"], [pthreadHeader="no"])
546  AC_CHECK_LIB([pthread], [main], [FOUND_pthread=yes])
547   if test x$FOUND_pthread = xyes ; then
[3423]548      LIBS="$LIBS -lpthread"
549   fi
550 fi
551fi
[3424]552
553
[3863]554#--------#
555# efence #
556#--------#
557if test x$def_efence = xyes ; then
558  AC_CHECK_LIB([efence], [main], [FOUND_efence=yes])
559   if test x$FOUND_efence = xyes ; then
560      LIBS="$LIBS -lefence"
561   fi
562 
563fi
564
[1945]565# FIXME: Replace `main' with a function in `-lm':
[2968]566 AC_CHECK_LIB([m], [main])
[1945]567
[3099]568 
[1945]569# Checks for header files.
570AC_HEADER_STDC
571AC_CHECK_HEADERS([stdlib.h string.h])
572
573# Checks for typedefs, structures, and compiler characteristics.
574AC_HEADER_STDBOOL
575
576# Checks for library functions.
577AC_FUNC_MALLOC
578AC_CHECK_FUNCS([bzero sqrt])
579
[3424]580######################
581## OUTPUT CONFIGURE ##
582######################
[1946]583AC_CONFIG_FILES([Makefile
[3377]584                 src/Makefile
[3493]585                 src/lib/Makefile
586                 src/lib/graphics/Makefile
[3485]587                 src/lib/graphics/importer/Makefile
[3493]588                 src/lib/gui/Makefile
[3489]589                 src/lib/gui/console/Makefile
[3549]590                 src/lib/gui/gui/Makefile
591                 src/subprojects/Makefile
592                 src/subprojects/testmain/Makefile])
[3377]593
[1945]594AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.