Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 5010 was 4944, checked in by bensch, 19 years ago

orxonox/trunk: opened and saved some files, and also rewritten some organizatory stuff

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