Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/updater/configure.ac @ 3247

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

orxonox/branches/updater: checking for libCurl

File size: 10.1 KB
RevLine 
[1945]1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
[3218]4AC_PREREQ(2.56)
[3240]5AC_INIT(orxonox, 0.2.1-pre-alpha, [orxonox-dev at mail.datacore.ch])
[2980]6
7# Detect the canonical host and target build environment.
8AC_CANONICAL_BUILD
9AC_CANONICAL_HOST
10AC_CANONICAL_TARGET
11
12
[1959]13AM_INIT_AUTOMAKE
[2618]14
[1951]15AC_CONFIG_SRCDIR([.])
[1945]16AC_CONFIG_HEADER([config.h])
17
[2018]18
[1945]19# Checks for programs.
20AC_PROG_CXX
[2925]21AC_HEADER_STDC
[2701]22
[3100]23### CHECKING  OPTIONAT ARGUMENTS
[3173]24## DEBUG-statement
25DEBUG=no
26AC_MSG_CHECKING([if DEBUG-mode should be enabled])
[3181]27AC_ARG_ENABLE([debug],
[3205]28        AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]),
29         DEBUG=$enableval)
30
31if test "$DEBUG" = "no"; then
32        echo "no"
33        echo " -> Setting debuglevel to 1. Like this you can still see errors."
34        DEBUG=1
35elif test "$DEBUG" = yes; then
36        echo "yes"
37        echo " -> Setting debuglevel to 3. HARD DEBUG MODE!!."
38        DEBUG=3
39else       
40        echo "yes set to $DEBUG"
[3173]41fi
[3205]42        AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are])
43
[3173]44AC_SUBST(DEBUG)
45
[3100]46## GTK-disabled
47AC_MSG_CHECKING([if gtk should be enabled])
[3181]48AC_ARG_WITH([gtk],
49        AC_HELP_STRING( [--without-gtk],
[3205]50        [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
[3100]51if test "$def_gtk" = yes; then
52  echo "yes"
53fi
54if test "$def_gtk" = no; then
55  echo "no"
56fi
[3243]57
58## libCurl disabled?
59AC_MSG_CHECKING([if libcURL should be enabled])
60AC_ARG_WITH([curl],
61        AC_HELP_STRING( [--without-curl],
62        [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
63if test "$def_curl" = yes; then
64  echo "yes"
65fi
66if test "$def_curl" = no; then
67  echo "no"
68fi
69
[3140]70### SDL_image-disable
71def_sdl_image=yes
72AC_MSG_CHECKING([if SDL_image should be enabled])
[3181]73AC_ARG_WITH([sdl_image],
74        AC_HELP_STRING( [--without-sdl-image],
[3140]75        [Prevents SDL_image from being loaded]), [def_sdl_image=no])
76if test "$def_sdl_image" = yes; then
77  echo "yes"
78fi
79if test "$def_sdl_image" = no; then
80  echo "no"
81fi
[3100]82
[3219]83
84## PROGRAMM CHECKING
85# checking for Doxygen
86AC_PATH_PROG(DOXYGEN, doxygen)
87AM_CONDITIONAL(DOXYGEN, test $DOXYGEN)
88
[2701]89### CHECKING FOR SYSTEM ###
90
91AC_MSG_CHECKING([for System])
[2980]92## checking for openGL-environment and other sys-specific parameters
93case "$target" in
[2701]94### WINDOWS ###
[2980]95  *-*-mingw32*)
[2701]96echo "mingw-WINDOWS detected"
97
98    mingw="yes"
99    MSBITFIELDS="-mms-bitfields"
100    MWINDOWS="-mwindows"
101
102# checking gl header
103        #done before loop
104
[2925]105# checking gl header
[2879]106   AC_CHECK_HEADERS(GL/gl.h ,,
107      [AC_MSG_ERROR([cannot find opengl headers]) ])
[2701]108#   checking for Windows openGl library
[1971]109    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
110    if test "$FOUND_opengl32" = "yes" ; then
[1959]111        LIBS="$LIBS -lopengl32"
[1971]112    else
[1959]113         echo "------------------"
114         echo "opengl not found."
115         echo "please install the opengl package which can be found at http://www.opengl.org"
116         echo "------------------"
117         exit -1
118    fi
119
[2701]120# cheking for GLU-header
121    AC_CHECK_HEADERS(GL/glu.h ,,
[1971]122      [AC_MSG_ERROR([cannot find opengl headers]) ])
123
[2701]124# checking for libGLU
[1971]125    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
126    if test "$FOUND_glu32" = "yes" ; then
[1959]127        LIBS="$LIBS -lGLU32"
[2701]128    else
[1959]129         echo "------------------"
130         echo "GLU library not found."
131         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
132         echo "------------------"
133         exit -1
134    fi
[1971]135
[2701]136# checking for mingw32
137    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
138    if test $FOUND_mingw32 = "yes"; then
139        LIBS="$LIBS -lmingw32"
140    fi
[2982]141# checking for SDL-headers
142    AC_CHECK_HEADERS(SDL/SDL.h ,,
143      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2701]144
[2982]145#checking for libSDL
146    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
147    if test "$FOUND_sdlmain" = "yes" ; then
148       LIBS="$LIBS -lsdlmain"
149    else
150        echo "------------------"
151        echo "SDL library not found."
152        echo "please install the SDL library, which can be found at http://www.libsdl.org"
153        echo "------------------"
154        exit 1
155    fi
156    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
157    if test "$FOUND_sdl" = "yes" ; then
158       LIBS="$LIBS -lsdl"
159    else
160        echo "------------------"
161        echo "SDL library not found."
162        echo "please install the SDL library, which can be found at http://www.libsdl.org"
163        echo "------------------"
164        exit -1
165    fi
166
[2701]167    ;;
168
169### LINUX ###
[2980]170 *-*-linux*)
[2701]171echo "Linux detected"
172
173 Linux="yes"
174
[3180]175CPPFLAGS="-I/usr/X11R6/include"
176LDFLAGS="-L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
[2925]177# checking gl header
[2879]178   AC_CHECK_HEADERS(GL/gl.h ,,
179      [AC_MSG_ERROR([cannot find opengl headers]) ])
[2701]180
181#  checking for Unix GL
182   AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
183   if test "$FOUND_GL" = "yes" ; then
184     LIBS="$LIBS -lGL"
185   else
186         echo "------------------"
187         echo "opengl not found."
188         echo "please install the opengl package which can be found at http://www.opengl.org"
189         echo "------------------"
190         exit -1
191   fi
192
193# cheking for GLU-header
194    AC_CHECK_HEADERS(GL/glu.h ,,
195      [AC_MSG_ERROR([cannot find opengl headers]) ])
196
197    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
198    if test "$FOUND_GLU" = "yes" ; then
199      LIBS="$LIBS -lGLU"
200    else
201         echo "------------------"
202         echo "GLU library not found."
203         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
204         echo "------------------"
205         exit -1
206    fi   
[2995]207
[2991]208# checking for SDL-headers
209    AC_CHECK_HEADERS(SDL/SDL.h ,,
210      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2982]211
[3140]212# checking for SDL-lib
[2991]213    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
214     if test "$FOUND_SDL" = "yes" ; then
215       LIBS="$LIBS -lSDL"
216     else
217        echo "------------------"
218        echo "SDL library not found."
219        echo "please install the SDL library, which can be found at http://www.libsdl.org"
220        echo "------------------"
221        exit -1
222     fi   
223
[3140]224
[2982]225## checking for SDL
[2991]226#    SDL_VERSION=1.2.7
227#    AM_PATH_SDL($SDL_VERSION,
228#      :,
229#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
230#      )
231#    CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
232#    LIBS="$LIBS $SDL_LIBS"
[2701]233    ;;
[2995]234
235### OS X ###
236 *darwin*)
237echo "OS X detected"
238
239 osX="yes"
240
[3140]241 CPPFLAGS="-I/sw/include $CPPFLAGS"
[2995]242# checking gl header
243   AC_CHECK_HEADERS(OpenGL/gl.h ,,
244      [AC_MSG_ERROR([cannot find opengl headers]) ])
245# cheking for GLU-header
246    AC_CHECK_HEADERS(OpenGL/glu.h ,,
247      [AC_MSG_ERROR([cannot find opengl headers]) ])
248
249   LIBS="$LIBS -framework OpenGL"
250
251# checking for SDL-headers
[3001]252#    AC_CHECK_HEADERS(SDL/SDL.h ,,
253#      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2995]254
255## checking for SDL
256#    SDL_VERSION=1.2.7
257#    AM_PATH_SDL($SDL_VERSION,
258#      :,
259#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
260#      )
261
262       SDL_CFLAGS=`sdl-config --cflags`
263       SDL_LIBS=`sdl-config --libs`
264       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
265       LIBS="$LIBS $SDL_LIBS"
[3140]266
[2995]267    ;;
268
[2701]269  *)
270    ;;
271esac
[2968]272
[2701]273AC_SUBST(MSBITFIELDS)
274
[3140]275## check for SDL_Image
276if test "$def_sdl_image" = "yes"; then
277# checking for SDL_image-headers
278  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
[3178]279      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
[3140]280fi
281if test "$def_sdl_image" = "yes"; then
282# checking for SDL_image-lib
283  AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
284     if test "$FOUND_SDL_image" = "yes" ; then
285       LIBS="$LIBS -lSDL_image"
286     else
287        echo "------------------"
288        echo "SDL_image library not found."
289        echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
290        echo "------------------"
291        exit -1
292     fi   
293fi
[2701]294
[1959]295
[3140]296if test "$def_sdl_image" = "no"; then
297 ## checking for libjpeg
298 AC_CHECK_HEADERS(jpeglib.h ,jpegHeader="yes",
299        jpegHeader="no")
300 if test $jpegHeader = "no"; then
301        echo " not including jpeg."
302 else
303  AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes)
304    if test "$FOUND_jpeg" = "yes" ; then
305      LIBS="$LIBS -ljpeg"
306    else
307         echo "------------------"
308         echo "jpeg library not found."
309         echo "please install the jpeg library from the Independent JPEG Group, which can be found at http://www.ijg.org"
310         echo "------------------"
311         exit -1
312    fi   
313 fi
[2980]314
[3140]315 ## checking for libpng
316 AC_CHECK_HEADERS(png.h ,pngHeader="yes",
317        pngHeader="no")
318 if test $pngHeader = "no"; then
319        echo " not including png."
320 else
321  AC_CHECK_LIB([png], [main], FOUND_png=yes)
322    if test "$FOUND_png" = "yes" ; then
323      LIBS="$LIBS -lpng"
324    else
325         echo "------------------"
326         echo "png library not found."
327         echo "please install the png library, which can be found at http://libpng.org/pub/png/libpng.html"
328         echo "------------------"
329         exit -1
330    fi
331 fi   
332fi
333
[2980]334## checking for GTK
[3100]335if test "$def_gtk" = yes; then
336
337        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
338        AC_MSG_CHECKING([for gtk2.0])
339        if `pkg-config --exists gtk+-2.0`; then
340                echo "yes"
341                have_gtk2=yes
342                GTK2_LIBS=`pkg-config --libs gtk+-2.0`
343                GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
[3101]344                AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
[3100]345        else
346                echo "no"
347        fi
[3101]348
[3099]349fi
[2980]350AC_SUBST(GTK2_LIBS)
351AC_SUBST(GTK2_CFLAGS)
[3100]352AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
[2980]353
[3243]354## checking for libcURL
355if test "$def_curl" = yes; then
[2980]356
[3243]357 AC_CHECK_HEADERS([curl/curl.h], curlHeader="yes", curlHeader="no")
358 AC_CHECK_LIB([curl], [main], [FOUND_curl=yes])
359 if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
360  have_curl=yes
361  CURL_LIBS=`curl-config --libs`
362  CURLCFLAGS=`curl-config --cflags`
363  AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL])
364 else
365  have_curl=no
366 fi
[3100]367
[3243]368fi
369AC_SUBST(CURL_LIBS)
370AC_SUBST(CURL_CFLAGS)
371AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
372
373
[2190]374#checking for pthread libs
[3218]375# AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
376# if test "$FOUND_pthread" = "yes" ; then
377#    LIBS="$LIBS -lpthread"
378# fi
[2190]379
380
[1945]381# FIXME: Replace `main' with a function in `-lm':
[2968]382 AC_CHECK_LIB([m], [main])
[1945]383
[3099]384 
[1945]385# Checks for header files.
386AC_HEADER_STDC
387AC_CHECK_HEADERS([stdlib.h string.h])
388
389# Checks for typedefs, structures, and compiler characteristics.
390AC_HEADER_STDBOOL
391
392# Checks for library functions.
393AC_FUNC_MALLOC
394AC_CHECK_FUNCS([bzero sqrt])
395
[1946]396AC_CONFIG_FILES([Makefile
[3191]397                 src/console/Makefile
398                 src/gui/Makefile
[2819]399                 src/Makefile
[3196]400                 src/importer/Makefile])
[1945]401AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.