Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 3485 was 3485, checked in by patrick, 19 years ago

orxonox/trunk: modified configure.ac because of importer movement

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