Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/textEngine/configure.ac @ 3682

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

orxonox/branches/textEngine: configure.ac adapded, and some minor changes at glfont

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