Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: merged branches/images back into the trunk.
merged with command: svn merge bensches/images/ trunk/ -r 3084:HEAD

Conflicts in configure/.ac

resolved in favor of branches/images (newer)

Mayor differences:

  1. Image-Importing capability.
  2. configure remade for usage with sdl-image/jpeglib and so on.
  3. Absolutely no change in the trunk/src
File size: 8.5 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4#AC_PREREQ(2.56)
5AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch)
6
7# Detect the canonical host and target build environment.
8AC_CANONICAL_BUILD
9AC_CANONICAL_HOST
10AC_CANONICAL_TARGET
11
12
13AM_INIT_AUTOMAKE
14
15AC_CONFIG_SRCDIR([.])
16AC_CONFIG_HEADER([config.h])
17
18
19# Checks for programs.
20AC_PROG_CXX
21AC_HEADER_STDC
22
23### CHECKING  OPTIONAT ARGUMENTS
24## GTK-disabled
25def_gtk=yes
26AC_MSG_CHECKING([if gtk should be enabled])
27AC_ARG_ENABLE([gtk],
28        AC_HELP_STRING( [--disable-gtk],
29        [Prevents GTK from being loaded]), [def_gtk=no])
30if test "$def_gtk" = yes; then
31  echo "yes"
32fi
33if test "$def_gtk" = no; then
34  echo "no"
35fi
36### SDL_image-disable
37def_sdl_image=yes
38AC_MSG_CHECKING([if SDL_image should be enabled])
39AC_ARG_ENABLE([sdl_image],
40        AC_HELP_STRING( [--disabel-sdl-image],
41        [Prevents SDL_image from being loaded]), [def_sdl_image=no])
42if test "$def_sdl_image" = yes; then
43  echo "yes"
44fi
45if test "$def_sdl_image" = no; then
46  echo "no"
47fi
48
49### CHECKING FOR SYSTEM ###
50
51AC_MSG_CHECKING([for System])
52## checking for openGL-environment and other sys-specific parameters
53case "$target" in
54### WINDOWS ###
55  *-*-mingw32*)
56echo "mingw-WINDOWS detected"
57
58    mingw="yes"
59    MSBITFIELDS="-mms-bitfields"
60    MWINDOWS="-mwindows"
61
62# checking gl header
63        #done before loop
64
65# checking gl header
66   AC_CHECK_HEADERS(GL/gl.h ,,
67      [AC_MSG_ERROR([cannot find opengl headers]) ])
68#   checking for Windows openGl library
69    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
70    if test "$FOUND_opengl32" = "yes" ; then
71        LIBS="$LIBS -lopengl32"
72    else
73         echo "------------------"
74         echo "opengl not found."
75         echo "please install the opengl package which can be found at http://www.opengl.org"
76         echo "------------------"
77         exit -1
78    fi
79
80# cheking for GLU-header
81    AC_CHECK_HEADERS(GL/glu.h ,,
82      [AC_MSG_ERROR([cannot find opengl headers]) ])
83
84# checking for libGLU
85    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
86    if test "$FOUND_glu32" = "yes" ; then
87        LIBS="$LIBS -lGLU32"
88    else
89         echo "------------------"
90         echo "GLU library not found."
91         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
92         echo "------------------"
93         exit -1
94    fi
95
96# checking for mingw32
97    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
98    if test $FOUND_mingw32 = "yes"; then
99        LIBS="$LIBS -lmingw32"
100    fi
101# checking for SDL-headers
102    AC_CHECK_HEADERS(SDL/SDL.h ,,
103      [AC_MSG_ERROR([cannot find SDL headers]) ])
104
105#checking for libSDL
106    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
107    if test "$FOUND_sdlmain" = "yes" ; then
108       LIBS="$LIBS -lsdlmain"
109    else
110        echo "------------------"
111        echo "SDL library not found."
112        echo "please install the SDL library, which can be found at http://www.libsdl.org"
113        echo "------------------"
114        exit 1
115    fi
116    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
117    if test "$FOUND_sdl" = "yes" ; then
118       LIBS="$LIBS -lsdl"
119    else
120        echo "------------------"
121        echo "SDL library not found."
122        echo "please install the SDL library, which can be found at http://www.libsdl.org"
123        echo "------------------"
124        exit -1
125    fi
126
127    ;;
128
129### LINUX ###
130 *-*-linux*)
131echo "Linux detected"
132
133 Linux="yes"
134
135# checking gl header
136   AC_CHECK_HEADERS(GL/gl.h ,,
137      [AC_MSG_ERROR([cannot find opengl headers]) ])
138
139#  checking for Unix GL
140   AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
141   if test "$FOUND_GL" = "yes" ; then
142     LIBS="$LIBS -lGL"
143   else
144         echo "------------------"
145         echo "opengl not found."
146         echo "please install the opengl package which can be found at http://www.opengl.org"
147         echo "------------------"
148         exit -1
149   fi
150
151# cheking for GLU-header
152    AC_CHECK_HEADERS(GL/glu.h ,,
153      [AC_MSG_ERROR([cannot find opengl headers]) ])
154
155    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
156    if test "$FOUND_GLU" = "yes" ; then
157      LIBS="$LIBS -lGLU"
158    else
159         echo "------------------"
160         echo "GLU library not found."
161         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
162         echo "------------------"
163         exit -1
164    fi   
165
166# checking for SDL-headers
167    AC_CHECK_HEADERS(SDL/SDL.h ,,
168      [AC_MSG_ERROR([cannot find SDL headers]) ])
169
170# checking for SDL-lib
171    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
172     if test "$FOUND_SDL" = "yes" ; then
173       LIBS="$LIBS -lSDL"
174     else
175        echo "------------------"
176        echo "SDL library not found."
177        echo "please install the SDL library, which can be found at http://www.libsdl.org"
178        echo "------------------"
179        exit -1
180     fi   
181
182
183## checking for SDL
184#    SDL_VERSION=1.2.7
185#    AM_PATH_SDL($SDL_VERSION,
186#      :,
187#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
188#      )
189#    CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
190#    LIBS="$LIBS $SDL_LIBS"
191    ;;
192
193### OS X ###
194 *darwin*)
195echo "OS X detected"
196
197 osX="yes"
198
199 CPPFLAGS="-I/sw/include $CPPFLAGS"
200# checking gl header
201   AC_CHECK_HEADERS(OpenGL/gl.h ,,
202      [AC_MSG_ERROR([cannot find opengl headers]) ])
203# cheking for GLU-header
204    AC_CHECK_HEADERS(OpenGL/glu.h ,,
205      [AC_MSG_ERROR([cannot find opengl headers]) ])
206
207   LIBS="$LIBS -framework OpenGL"
208
209# checking for SDL-headers
210#    AC_CHECK_HEADERS(SDL/SDL.h ,,
211#      [AC_MSG_ERROR([cannot find SDL headers]) ])
212
213## checking for SDL
214#    SDL_VERSION=1.2.7
215#    AM_PATH_SDL($SDL_VERSION,
216#      :,
217#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
218#      )
219
220       SDL_CFLAGS=`sdl-config --cflags`
221       SDL_LIBS=`sdl-config --libs`
222       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
223       LIBS="$LIBS $SDL_LIBS"
224
225    ;;
226
227  *)
228    ;;
229esac
230
231AC_SUBST(MSBITFIELDS)
232
233## check for SDL_Image
234if test "$def_sdl_image" = "yes"; then
235# checking for SDL_image-headers
236  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
237      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
238fi
239if test "$def_sdl_image" = "yes"; then
240# checking for SDL_image-lib
241  AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
242     if test "$FOUND_SDL_image" = "yes" ; then
243       LIBS="$LIBS -lSDL_image"
244     else
245        echo "------------------"
246        echo "SDL_image library not found."
247        echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
248        echo "------------------"
249        exit -1
250     fi   
251fi
252
253
254if test "$def_sdl_image" = "no"; then
255 ## checking for libjpeg
256 AC_CHECK_HEADERS(jpeglib.h ,jpegHeader="yes",
257        jpegHeader="no")
258 if test $jpegHeader = "no"; then
259        echo " not including jpeg."
260 else
261  AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes)
262    if test "$FOUND_jpeg" = "yes" ; then
263      LIBS="$LIBS -ljpeg"
264    else
265         echo "------------------"
266         echo "jpeg library not found."
267         echo "please install the jpeg library from the Independent JPEG Group, which can be found at http://www.ijg.org"
268         echo "------------------"
269         exit -1
270    fi   
271 fi
272
273 ## checking for libpng
274 AC_CHECK_HEADERS(png.h ,pngHeader="yes",
275        pngHeader="no")
276 if test $pngHeader = "no"; then
277        echo " not including png."
278 else
279  AC_CHECK_LIB([png], [main], FOUND_png=yes)
280    if test "$FOUND_png" = "yes" ; then
281      LIBS="$LIBS -lpng"
282    else
283         echo "------------------"
284         echo "png library not found."
285         echo "please install the png library, which can be found at http://libpng.org/pub/png/libpng.html"
286         echo "------------------"
287         exit -1
288    fi
289 fi   
290fi
291
292## checking for GTK
293if test "$def_gtk" = yes; then
294
295        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
296        AC_MSG_CHECKING([for gtk2.0])
297        if `pkg-config --exists gtk+-2.0`; then
298                echo "yes"
299                have_gtk2=yes
300                GTK2_LIBS=`pkg-config --libs gtk+-2.0`
301                GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
302                AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
303        else
304                echo "no"
305        fi
306
307fi
308AC_SUBST(GTK2_LIBS)
309AC_SUBST(GTK2_CFLAGS)
310AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
311
312
313
314#checking for pthread libs
315 AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
316 if test "$FOUND_pthread" = "yes" ; then
317    LIBS="$LIBS -lpthread"
318 fi
319
320
321# FIXME: Replace `main' with a function in `-lm':
322 AC_CHECK_LIB([m], [main])
323
324 
325# Checks for header files.
326AC_HEADER_STDC
327AC_CHECK_HEADERS([stdlib.h string.h])
328
329# Checks for typedefs, structures, and compiler characteristics.
330AC_HEADER_STDBOOL
331
332# Checks for library functions.
333AC_FUNC_MALLOC
334AC_CHECK_FUNCS([bzero sqrt])
335
336AC_CONFIG_FILES([Makefile
337                 console/Makefile
338                 gui/Makefile
339                 src/Makefile
340                 importer/Makefile])
341AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.