Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 4868 was 4825, checked in by bensch, 19 years ago

orxonox/trunk: compile with the ogg, and vorbis lib again

File size: 18.1 KB
Line 
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#########################
24AC_PREREQ(2.56)
25AC_INIT(orxonox, 0.3.0_alpha, [orxonox-dev at mail.datacore.ch])
26
27## Detect the canonical host and target build environment.
28AC_CANONICAL_BUILD
29AC_CANONICAL_HOST
30AC_CANONICAL_TARGET
31
32AM_INIT_AUTOMAKE
33
34AC_CONFIG_SRCDIR([.])
35AC_CONFIG_HEADER([config.h])
36
37#########################
38## Checks for programs ##
39#########################
40AC_PROG_CXX
41AC_PROG_RANLIB
42AC_HEADER_STDC
43
44## THIS IS OUR DEFAULT-DATA-DIRECTORY
45
46##################################
47## CHECKING  OPTIONAL ARGUMENTS ##
48##################################
49#----------------#
50# Data-Directory #
51#----------------#
52DATA_DIR=$datadir
53echo \$\{prefix\}
54if test $DATA_DIR = \$\{prefix\}/share ; then
55        echo "not given"
56        DATA_DIR=/usr/share
57else
58        echo "given: $DATA_DIR"
59fi
60AC_DEFINE_UNQUOTED([DATADIR], ["$DATA_DIR"],
61                   [Define to the read-only architecture-independent
62                    data directory.])
63
64#-----------------#
65# DEBUG-statement #
66#-----------------#
67DEBUG=no
68AC_MSG_CHECKING([if DEBUG-mode should be enabled])
69AC_ARG_ENABLE([debug],
70        AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]),
71         DEBUG=$enableval)
72
73if test x$DEBUG = xno; then
74        echo "no"
75        echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed."
76        DEBUG=4
77elif test x$DEBUG = xyes; then
78        echo "yes"
79        echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!."
80        DEBUG=4
81else
82        echo "yes: setting debuglevel to to $DEBUG"
83fi
84        AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are])
85
86AC_SUBST(DEBUG)
87
88#---------------#
89# Modular Debug #
90#---------------#
91MODULAR_DEBUG=yes
92AC_MSG_CHECKING([if Modular-DEBUG-mode should be ebabled])
93AC_ARG_ENABLE([modular-debug],
94        AC_HELP_STRING( [--disable-modular-debug], [compiles in modular-debug mode, that logs differently on the many modules of orxonox.]),
95         MODULAR_DEBUG=$enableval)
96
97if test x$MODULAR_DEBUG = xno; then
98        echo "no"
99elif test x$MODULAR_DEBUG = xyes; then
100        echo "yes"
101        AC_DEFINE_UNQUOTED(MODULAR_DEBUG, 1, [if Modular-DUBUG mode is enabled])
102fi
103
104#--------------#
105# GTK-disabled #
106#--------------#
107AC_MSG_CHECKING([if gtk should be enabled])
108AC_ARG_ENABLE([gtk],
109        AC_HELP_STRING( [--disable-gtk],
110        [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
111if test x$def_gtk = xyes; then
112  echo "yes"
113fi
114if test x$def_gtk = xno; then
115  echo "no"
116fi
117
118#------------------#
119# libCurl-disabled #
120#------------------#
121AC_MSG_CHECKING([if libcURL should be enabled])
122AC_ARG_ENABLE([curl],
123        AC_HELP_STRING( [--disable-curl],
124        [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
125if test x$def_curl = xyes; then
126  echo "yes"
127fi
128if test x$def_curl = xno; then
129  echo "no"
130fi
131
132#-------------------#
133# SubProject-enable #
134#-------------------#
135def_sub_projects=no
136AC_MSG_CHECKING([if the SubProjects should be built])
137AC_ARG_WITH([sub-projects],
138        AC_HELP_STRING( [--with-sub-projects],
139        [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
140if test x$def_sub_projects = xyes; then
141  echo "yes"
142fi
143if test x$def_sub_projects = xno; then
144  echo "no"
145fi
146AM_CONDITIONAL(SUB_PROJECTS, test x$def_sub_projects = xyes)
147
148#-------------------#
149# Profiling Enabled #
150#-------------------#
151def_profiling=no
152AC_MSG_CHECKING([if Profiling should be enabled])
153AC_ARG_ENABLE([profile],
154        AC_HELP_STRING( [--enable-profile],
155        [builds orxonox with profiling support]), [def_profiling=yes])
156if test x$def_profiling = xyes; then
157  echo "yes"
158  CXXFLAGS="$CXXFLAGS -pg"
159fi
160if test x$def_profiling = xno; then
161  echo "no"
162fi
163
164#----------------#
165# efence Enabled #
166#----------------#
167def_efence=no
168AC_MSG_CHECKING([if efence should be enabled])
169AC_ARG_ENABLE([efence],
170        AC_HELP_STRING( [--enable-efence],
171        [builds orxonox with efence support]), [def_efence=yes])
172if test x$def_efence = xyes; then
173  echo "yes"
174fi
175if test x$def_efence = xno; then
176  echo "no"
177fi
178
179#----------------------#
180# Documentation-enable #
181#----------------------#
182def_documentation=no
183AC_MSG_CHECKING([if the Documentation should be build by default])
184AC_ARG_ENABLE([documentation],
185        AC_HELP_STRING( [--enable-documentation],
186        [also builds the sDocumentation while make from srcdir]), [def_documentation=yes])
187if test x$def_documentation = xyes; then
188  echo "yes"
189fi
190if test x$def_documentation = xno; then
191  echo "no"
192fi
193AM_CONDITIONAL(DOCUMENTATION, test x$def_documentation = xyes)
194
195#######################
196## PROGRAMM CHECKING ##
197## 3. party Programs ##
198#######################
199
200#----------------------#
201# checking for Doxygen #
202#----------------------#
203AC_PATH_PROG(DOXYGEN, doxygen)
204AM_CONDITIONAL(DOXYGEN, test $DOXYGEN)
205
206#--------------------#
207# checking for gprof #
208#--------------------#
209AC_PATH_PROG(GPROF, gprof)
210
211#-------------------------#
212# checking for pkg-config #
213#-------------------------#
214if test x$def_gtk = xyes; then
215 AC_PATH_PROG(PKG_CONFIG, pkg-config)
216fi
217
218
219#########################
220## CHECKING FOR SYSTEM ##
221#########################
222## here the system is checked, and openGL is included
223## also checking for SDL on differen Systems
224
225AC_MSG_CHECKING([for System])
226## checking for openGL-environment and other sys-specific parameters
227case "$target" in
228
229###########
230#---------#
231# WINDOWS #
232#---------#
233###########
234  *-*-mingw32*)
235echo "mingw-WINDOWS detected"
236
237CPPFLAGS="-I/usr/include -I/mingw/include"
238
239    mingw="yes"
240    MSBITFIELDS="-mms-bitfields"
241    MWINDOWS="-mwindows"
242
243
244
245# checking for mingw32
246    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
247    if test x$FOUND_mingw32 = xyes; then
248        LIBS="$LIBS -lmingw32"
249    fi
250
251#-----------#
252# SDL (win) #
253#-----------#
254# checking for SDL-headers
255    AC_CHECK_HEADERS([SDL/SDL.h] ,,
256      [AC_MSG_ERROR([cannot find SDL headers]) ])
257
258#checking for libSDL
259    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
260    if test x$FOUND_sdlmain = xyes ; then
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)
270    if test x$FOUND_sdl = xyes ; then
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
280#---------------#
281# open-GL (win) #
282#---------------#
283# checking gl header
284   AC_CHECK_HEADERS(GL/gl.h ,,
285      [AC_MSG_ERROR([cannot find opengl headers]) ])
286#   checking for Windows openGl library
287    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
288    if test x$FOUND_opengl32 = xyes ; then
289        LIBS="$LIBS -lopengl32"
290    else
291         echo "------------------"
292         echo "opengl not found."
293         echo "please install the opengl package which can be found at http://www.opengl.org"
294         echo "------------------"
295         exit -1
296    fi
297
298# cheking for GLU-header
299    AC_CHECK_HEADERS([GL/glu.h] ,,
300      [AC_MSG_ERROR([cannot find opengl headers]) ])
301
302# checking for libGLU
303    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
304    if test x$FOUND_glu32 = xyes ; then
305        LIBS="$LIBS -lGLU32"
306    else
307         echo "------------------"
308         echo "GLU library not found."
309         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
310         echo "------------------"
311         exit -1
312    fi
313
314#--------#
315# openAL #
316#--------#
317# checking for openAL-headers
318  AC_CHECK_HEADERS([AL/al.h] ,,
319      [AC_MSG_ERROR([cannot find openAL header.])])
320# checking for openAL-lib
321  AC_CHECK_LIB([OpenAL32], [main], [FOUND_openal=yes])
322  AC_CHECK_LIB([ALut], [main], [FOUND_ALut=yes])
323     if test x$FOUND_openal = xyes ; then
324      if test x$FOUND_ALut = xyes ; then
325       LIBS="$LIBS -lALut -lOpenAL32"
326     else
327        echo "------------------"
328        echo "openal library not found."
329        echo "please install the openal library, which can be found at http://www.openal.org"
330        echo "------------------"
331        exit -1
332      fi
333     fi
334    ;;
335
336#########
337#-------#
338# LINUX #
339#-------#
340#########
341 *-*-linux*)
342echo "Linux detected"
343
344 Linux="yes"
345
346CPPFLAGS="-I/usr/X11R6/include -I/usr/include"
347LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
348# checking gl header
349   AC_CHECK_HEADERS([GL/gl.h] ,,
350      [AC_MSG_ERROR([cannot find opengl headers]) ])
351
352#  checking for Unix GL
353   AC_CHECK_LIB([GL], [glLoadIdentity], FOUND_GL=yes)
354   if test x$FOUND_GL = xyes ; then
355     LIBS="$LIBS -lGL"
356   else
357         echo "------------------"
358         echo "opengl not found."
359         echo "please install the opengl package which can be found at http://www.opengl.org"
360         echo "------------------"
361         exit -1
362   fi
363
364# cheking for GLU-header
365    AC_CHECK_HEADERS([GL/glu.h] ,,
366      [AC_MSG_ERROR([cannot find opengl headers]) ])
367
368    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
369    if test x$FOUND_GLU = xyes ; then
370      LIBS="$LIBS -lGLU"
371    else
372         echo "------------------"
373         echo "GLU library not found."
374         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
375         echo "------------------"
376         exit -1
377    fi
378
379#--------#
380# openAL #
381#--------#
382# checking for openAL-headers
383  AC_CHECK_HEADERS([AL/al.h] ,,
384      [AC_MSG_ERROR([cannot find openAL header.])])
385# checking for openAL-lib
386  AC_CHECK_LIB([openal], [main], [FOUND_openal=yes])
387     if test x$FOUND_openal = xyes ; then
388       LIBS="$LIBS -lopenal"
389     else
390        echo "------------------"
391        echo "openal library not found."
392        echo "please install the openal library, which can be found at http://www.openal.org"
393        echo "------------------"
394        exit -1
395     fi
396
397# checking for SDL
398  AC_MSG_CHECKING([for SDL-version])
399  SDL_VERSION=`sdl-config --version`
400  echo $SDL_VERSION
401
402   CPPFLAGS="`sdl-config --cflags` $CPPFLAGS"
403   AC_CHECK_HEADERS([SDL.h] ,,
404      [AC_CHECK_HEADERS([SDL/SDL.h] ,,AC_MSG_ERROR([cannot find SDL header. please download from libsdl.org])]))
405
406   LIBS="`sdl-config --libs` $LIBS"
407    ;;
408
409#############
410#-----------#
411# MAC -OS X #
412#-----------#
413#############
414 *darwin*)
415 echo "OS X detected"
416
417 osX="yes"
418
419 CPPFLAGS="-I/sw/include -I/sw/include $CPPFLAGS"
420# checking gl header
421   AC_CHECK_HEADERS([OpenGL/gl.h] ,,
422      [AC_MSG_ERROR([cannot find opengl headers]) ])
423# cheking for GLU-header
424    AC_CHECK_HEADERS([OpenGL/glu.h] ,,
425      [AC_MSG_ERROR([cannot find opengl headers]) ])
426
427   LIBS="$LIBS -framework OpenGL"
428
429
430## SDL-check
431       SDL_CFLAGS=`sdl-config --cflags`
432       SDL_LIBS=`sdl-config --libs`
433       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
434       LIBS="$LIBS $SDL_LIBS"
435
436
437# checking for SDL-headers
438#    AC_CHECK_HEADERS(SDL/SDL.h ,,
439#      [AC_MSG_ERROR([cannot find SDL headers]) ])
440
441## checking for SDL
442#    SDL_VERSION=1.2.7
443#    AM_PATH_SDL($SDL_VERSION,
444#      :,
445#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
446#      )
447
448
449    ;;
450
451  *)
452    ;;
453esac
454
455AC_SUBST(MSBITFIELDS)
456
457###################################
458## CHECKING FOR HEADERS AND LIBS ##
459###################################
460
461#---------#
462# SDL_ttf #
463#---------#
464# checking for SDL_ttf-headers
465  AC_CHECK_HEADERS([SDL_ttf.h] ,,
466      [AC_CHECK_HEADERS([SDL/SDL_ttf.h] ,,AC_MSG_ERROR([cannot find SDL_ttf header.])]))
467# checking for SDL_ttf-lib
468  AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], [FOUND_SDL_ttf=yes])
469     if test x$FOUND_SDL_ttf = xyes ; then
470       LIBS="$LIBS -lSDL_ttf"
471     else
472        echo "------------------"
473        echo "SDL_ttf library not found."
474        echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
475        echo "------------------"
476        exit -1
477     fi
478
479
480#-----------#
481# SDL_Image #
482#-----------#
483# checking for SDL_image-headers
484AC_CHECK_HEADERS([SDL_image.h] ,,
485    [AC_CHECK_HEADERS([SDL/SDL_image.h],, AC_MSG_ERROR([SDL_image header not found.]))])
486# checking for SDL_image-lib
487AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes])
488   if test x$FOUND_SDL_image = xyes ; then
489     LIBS="$LIBS -lSDL_image"
490   else
491      echo "------------------"
492      echo "SDL_image library not found."
493      echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
494      echo "------------------"
495      exit -1
496   fi
497
498#-----#
499# ogg #
500#-----#
501# checking for ogg-headers
502  AC_CHECK_HEADERS([ogg/ogg.h] ,,
503      [AC_MSG_ERROR([cannot find ogg header.])])
504# checking for ogg-lib
505  AC_CHECK_LIB([ogg], [main], [FOUND_ogg=yes])
506     if test x$FOUND_ogg = xyes ; then
507       LIBS="$LIBS -logg"
508     else
509        echo "------------------"
510        echo "ogg library not found."
511        echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
512        echo "------------------"
513        exit -1
514     fi
515
516#--------#
517# vorbis #
518#--------#
519# checking for vorbis-lib
520  AC_CHECK_LIB([vorbis], [main], [FOUND_vorbis=yes])
521     if test x$FOUND_vorbis = xyes ; then
522       LIBS="$LIBS -lvorbis"
523     else
524        echo "------------------"
525        echo "vorbis library not found."
526        echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
527        echo "------------------"
528        exit -1
529     fi
530
531#------------#
532# vorbisfile #
533#------------#
534# checking for vorbis-headers
535  AC_CHECK_HEADERS([vorbis/vorbisfile.h] ,,
536      [AC_MSG_ERROR([cannot find vorbisfile header.])])
537# checking for vorbisfile-lib
538  AC_CHECK_LIB([vorbisfile], [main], [FOUND_vorbisfile=yes])
539     if test x$FOUND_vorbisfile = xyes ; then
540       LIBS="$LIBS -lvorbisfile"
541     else
542        echo "------------------"
543        echo "vorbisfile library not found."
544        echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
545        echo "------------------"
546        exit -1
547     fi
548
549#-----#
550# GTK #
551#-----#
552if test x$def_gtk = xyes; then
553        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
554        AC_MSG_CHECKING([for gtk2.0])
555        if `$PKG_CONFIG --exists gtk+-2.0`; then
556                echo "yes"
557                have_gtk2=yes
558                GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
559                GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
560                AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
561                if test $DEBUG -ge 3; then
562                 echo "cflags: $GTK2_CFLAGS"
563                 echo "libs: $GTK2_LIBS"
564                fi
565        else
566                echo "no"
567        fi
568
569fi
570AC_SUBST(GTK2_LIBS)
571AC_SUBST(GTK2_CFLAGS)
572AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
573
574#---------#
575# libcURL #
576#---------#
577if test x$def_curl = xyes; then
578
579 AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"])
580 AC_CHECK_LIB([curl], [main], [FOUND_curl=yes])
581 if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
582  have_curl=yes
583  CURL_LIBS=`curl-config --libs`
584  CURLCFLAGS=`curl-config --cflags`
585  AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL])
586 else
587  have_curl=no
588 fi
589
590fi
591AC_SUBST(CURL_LIBS)
592AC_SUBST(CURL_CFLAGS)
593AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
594
595#--------#
596# efence #
597#--------#
598if test x$def_efence = xyes ; then
599  AC_CHECK_LIB([efence], [main], [FOUND_efence=yes])
600   if test x$FOUND_efence = xyes ; then
601      LIBS="$LIBS -lefence"
602   fi
603
604fi
605
606# FIXME: Replace `main' with a function in `-lm':
607 AC_CHECK_LIB([m], [main])
608
609
610# Checks for header files.
611AC_HEADER_STDC
612AC_CHECK_HEADERS([stdlib.h string.h])
613
614# Checks for typedefs, structures, and compiler characteristics.
615AC_HEADER_STDBOOL
616
617# Checks for library functions.
618AC_FUNC_MALLOC
619AC_CHECK_FUNCS([bzero sqrt])
620
621######################
622## OUTPUT CONFIGURE ##
623######################
624AC_CONFIG_FILES([Makefile
625                 src/Makefile
626                 src/lib/Makefile
627                 src/lib/graphics/Makefile
628                 src/lib/graphics/importer/Makefile
629                 src/lib/graphics/spatial_separation/Makefile
630                 src/lib/sound/Makefile
631                 src/lib/event/Makefile
632                 src/lib/physics/Makefile
633                 src/lib/particles/Makefile
634                 src/lib/collision_detection/Makefile
635                 src/lib/gui/Makefile
636                 src/lib/tinyxml/Makefile
637                 src/subprojects/Makefile
638                 src/subprojects/testmain/Makefile
639                 src/subprojects/importer/Makefile
640                 src/subprojects/particles/Makefile
641                 src/subprojects/collision_detection/Makefile
642                 src/subprojects/gui/Makefile
643                 ])
644
645AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.