Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/images/configure.ac @ 3103

Last change on this file since 3103 was 3103, checked in by bensch, 21 years ago

orxonox/branches/images: testing SDL_image. It rocks.

File size: 7.2 KB
RevLine 
[1945]1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
[2980]4#AC_PREREQ(2.56)
[1950]5AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@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
23### CHECKING FOR SYSTEM ###
24
25AC_MSG_CHECKING([for System])
[2980]26## checking for openGL-environment and other sys-specific parameters
27case "$target" in
[2701]28### WINDOWS ###
[2980]29  *-*-mingw32*)
[2701]30echo "mingw-WINDOWS detected"
31
32    mingw="yes"
33    MSBITFIELDS="-mms-bitfields"
34    MWINDOWS="-mwindows"
35
36# checking gl header
37        #done before loop
38
[2925]39# checking gl header
[2879]40   AC_CHECK_HEADERS(GL/gl.h ,,
41      [AC_MSG_ERROR([cannot find opengl headers]) ])
[2701]42#   checking for Windows openGl library
[1971]43    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
44    if test "$FOUND_opengl32" = "yes" ; then
[1959]45        LIBS="$LIBS -lopengl32"
[1971]46    else
[1959]47         echo "------------------"
48         echo "opengl not found."
49         echo "please install the opengl package which can be found at http://www.opengl.org"
50         echo "------------------"
51         exit -1
52    fi
53
[2701]54# cheking for GLU-header
55    AC_CHECK_HEADERS(GL/glu.h ,,
[1971]56      [AC_MSG_ERROR([cannot find opengl headers]) ])
57
[2701]58# checking for libGLU
[1971]59    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
60    if test "$FOUND_glu32" = "yes" ; then
[1959]61        LIBS="$LIBS -lGLU32"
[2701]62    else
[1959]63         echo "------------------"
64         echo "GLU library not found."
65         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
66         echo "------------------"
67         exit -1
68    fi
[1971]69
[2701]70# checking for mingw32
71    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
72    if test $FOUND_mingw32 = "yes"; then
73        LIBS="$LIBS -lmingw32"
74    fi
[2982]75# checking for SDL-headers
76    AC_CHECK_HEADERS(SDL/SDL.h ,,
77      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2701]78
[2982]79#checking for libSDL
80    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
81    if test "$FOUND_sdlmain" = "yes" ; then
82       LIBS="$LIBS -lsdlmain"
83    else
84        echo "------------------"
85        echo "SDL library not found."
86        echo "please install the SDL library, which can be found at http://www.libsdl.org"
87        echo "------------------"
88        exit 1
89    fi
90    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
91    if test "$FOUND_sdl" = "yes" ; then
92       LIBS="$LIBS -lsdl"
93    else
94        echo "------------------"
95        echo "SDL library not found."
96        echo "please install the SDL library, which can be found at http://www.libsdl.org"
97        echo "------------------"
98        exit -1
99    fi
100
101
[2701]102    ;;
103
104### LINUX ###
[2980]105 *-*-linux*)
[2701]106echo "Linux detected"
107
108 Linux="yes"
109
[2925]110# checking gl header
[2879]111   AC_CHECK_HEADERS(GL/gl.h ,,
112      [AC_MSG_ERROR([cannot find opengl headers]) ])
[2701]113
114#  checking for Unix GL
115   AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
116   if test "$FOUND_GL" = "yes" ; then
117     LIBS="$LIBS -lGL"
118   else
119         echo "------------------"
120         echo "opengl not found."
121         echo "please install the opengl package which can be found at http://www.opengl.org"
122         echo "------------------"
123         exit -1
124   fi
125
126# cheking for GLU-header
127    AC_CHECK_HEADERS(GL/glu.h ,,
128      [AC_MSG_ERROR([cannot find opengl headers]) ])
129
130    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
131    if test "$FOUND_GLU" = "yes" ; then
132      LIBS="$LIBS -lGLU"
133    else
134         echo "------------------"
135         echo "GLU library not found."
136         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
137         echo "------------------"
138         exit -1
139    fi   
[2995]140
[2991]141# checking for SDL-headers
142    AC_CHECK_HEADERS(SDL/SDL.h ,,
143      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2982]144
[2995]145# checking for SDL-libs
[2991]146    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
147     if test "$FOUND_SDL" = "yes" ; then
148       LIBS="$LIBS -lSDL"
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
[3103]157#checking for SDL_image-headers
158  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
159      [AC_MSG_ERROR([cannot find SDL_image headers]) ])
160  AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
161     if test "$FOUND_SDL_image" = "yes" ; then
162       LIBS="$LIBS -lSDL_image"
163     else
164        echo "------------------"
165        echo "SDL_image library not found."
166        echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
167        echo "------------------"
168        exit -1
169     fi   
170
[2982]171## checking for SDL
[2991]172#    SDL_VERSION=1.2.7
173#    AM_PATH_SDL($SDL_VERSION,
174#      :,
175#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
176#      )
177#    CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
178#    LIBS="$LIBS $SDL_LIBS"
[2701]179    ;;
[2995]180
181### OS X ###
182 *darwin*)
183echo "OS X detected"
184
185 osX="yes"
186
187# checking gl header
188   AC_CHECK_HEADERS(OpenGL/gl.h ,,
189      [AC_MSG_ERROR([cannot find opengl headers]) ])
190# cheking for GLU-header
191    AC_CHECK_HEADERS(OpenGL/glu.h ,,
192      [AC_MSG_ERROR([cannot find opengl headers]) ])
193
194   LIBS="$LIBS -framework OpenGL"
195
196# checking for SDL-headers
[3001]197#    AC_CHECK_HEADERS(SDL/SDL.h ,,
198#      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2995]199
200## checking for SDL
201#    SDL_VERSION=1.2.7
202#    AM_PATH_SDL($SDL_VERSION,
203#      :,
204#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
205#      )
206
207       SDL_CFLAGS=`sdl-config --cflags`
208       SDL_LIBS=`sdl-config --libs`
209       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
210       LIBS="$LIBS $SDL_LIBS"
211    ;;
212
[2701]213  *)
214    ;;
215esac
[2968]216
[2701]217AC_SUBST(MSBITFIELDS)
218
[3086]219## checking for libjpeg
220AC_CHECK_HEADERS(jpeglib.h ,,
221        [AC_MSG_ERROR([cannot find jpeg headers]) ])
[2701]222
[3086]223AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes)
224    if test "$FOUND_jpeg" = "yes" ; then
225      LIBS="$LIBS -ljpeg"
226    else
227         echo "------------------"
228         echo "jpeg library not found."
229         echo "please install the jpeg library from the Independent JPEG Group, which can be found at http://www.ijg.org"
230         echo "------------------"
231         exit -1
232    fi   
[1959]233
[2980]234
[3098]235## checking for libpng
236AC_CHECK_HEADERS(png.h ,,
237        [AC_MSG_ERROR([cannot find jpeg headers]) ])
238
239AC_CHECK_LIB([png], [main], FOUND_png=yes)
240    if test "$FOUND_png" = "yes" ; then
241      LIBS="$LIBS -lpng"
242    else
243         echo "------------------"
244         echo "png library not found."
245         echo "please install the png library, which can be found at http://libpng.org/pub/png/libpng.html"
246         echo "------------------"
247         exit -1
248    fi   
249
250
[2980]251## checking for GTK
252PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
253AC_SUBST(GTK2_LIBS)
254AC_SUBST(GTK2_CFLAGS)
255AM_CONDITIONAL(HAVE_GTK2, test "x$have_gtk2" = xyes)
256
257
[2190]258#checking for pthread libs
[2968]259 AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
260 if test "$FOUND_pthread" = "yes" ; then
[2190]261    LIBS="$LIBS -lpthread"
[2968]262 fi
[2190]263
264
[1945]265# FIXME: Replace `main' with a function in `-lm':
[2968]266 AC_CHECK_LIB([m], [main])
[1945]267
[2018]268
[1945]269# Checks for header files.
270AC_HEADER_STDC
271AC_CHECK_HEADERS([stdlib.h string.h])
272
273# Checks for typedefs, structures, and compiler characteristics.
274AC_HEADER_STDBOOL
275
276# Checks for library functions.
277AC_FUNC_MALLOC
278AC_CHECK_FUNCS([bzero sqrt])
279
[1946]280AC_CONFIG_FILES([Makefile
281                 console/Makefile
[1945]282                 gui/Makefile
[2819]283                 src/Makefile
284                 importer/Makefile])
[1945]285AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.