Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/soundEngine/configure.ac @ 3892

Last change on this file since 3892 was 3508, checked in by bensch, 20 years ago

orxonox/branche/soundManager: added sound_control and it compiles

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