Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/importer/configure.ac @ 2810

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

orxonox/branches/importer: made it autoconf

File size: 4.7 KB
RevLine 
[1945]1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
[2611]4AC_PREREQ(2.56)
[1950]5AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch)
[1959]6AM_INIT_AUTOMAKE
[2618]7
[1951]8AC_CONFIG_SRCDIR([.])
[1945]9AC_CONFIG_HEADER([config.h])
10
[2018]11
[1945]12# Checks for programs.
13AC_PROG_CXX
14AC_PROG_CC
15
[1959]16
[2701]17# checking gl header (has to be here because of a Linux error)
18   AC_CHECK_HEADERS(GL/gl.h ,,
[1971]19      [AC_MSG_ERROR([cannot find opengl headers]) ])
20
[2701]21
22
23### CHECKING FOR SYSTEM ###
24
25AC_MSG_CHECKING([for System])
26case `uname` in
27### WINDOWS ###
28  *MINGW*)
29echo "mingw-WINDOWS detected"
30
31    mingw="yes"
32    MSBITFIELDS="-mms-bitfields"
33    MWINDOWS="-mwindows"
34
35# checking gl header
36        #done before loop
37
38#   checking for Windows openGl library
[1971]39    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
40    if test "$FOUND_opengl32" = "yes" ; then
[1959]41        LIBS="$LIBS -lopengl32"
[1971]42    else
[1959]43         echo "------------------"
44         echo "opengl not found."
45         echo "please install the opengl package which can be found at http://www.opengl.org"
46         echo "------------------"
47         exit -1
48    fi
49
[2701]50# cheking for GLU-header
51    AC_CHECK_HEADERS(GL/glu.h ,,
[1971]52      [AC_MSG_ERROR([cannot find opengl headers]) ])
53
[2701]54# checking for libGLU
[1971]55    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
56    if test "$FOUND_glu32" = "yes" ; then
[1959]57        LIBS="$LIBS -lGLU32"
[2701]58    else
[1959]59         echo "------------------"
60         echo "GLU library not found."
61         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
62         echo "------------------"
63         exit -1
64    fi
[1971]65
[2701]66
67# checking for mingw32
68    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
69    if test $FOUND_mingw32 = "yes"; then
70        LIBS="$LIBS -lmingw32"
71    fi
72# checking for SDL-headers
73    AC_CHECK_HEADERS(SDL/SDL.h ,,
74      [AC_MSG_ERROR([cannot find SDL headers]) ])
75
76#checking for libSDL
77    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
78    if test "$FOUND_sdlmain" = "yes" ; then
79        LIBS="$LIBS -lsdlmain"
80    else
81         echo "------------------"
82         echo "SDL library not found."
83         echo "please install the SDL library, which can be found at http://www.libsdl.org"
84         echo "------------------"
85         exit 1
86    fi
87    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
88    if test "$FOUND_sdl" = "yes" ; then
89        LIBS="$LIBS -lsdl"
90    else
91         echo "------------------"
92         echo "SDL library not found."
93         echo "please install the SDL library, which can be found at http://www.libsdl.org"
94         echo "------------------"
95         exit -1
96    fi
97
98    ;;
99
100### LINUX ###
101 *Linux*)
102echo "Linux detected"
103
104 Linux="yes"
105
106# checking gl header
107        #has been done befor linux-check
108
109#  checking for Unix GL
110   AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
111   if test "$FOUND_GL" = "yes" ; then
112     LIBS="$LIBS -lGL"
113   else
114         echo "------------------"
115         echo "opengl not found."
116         echo "please install the opengl package which can be found at http://www.opengl.org"
117         echo "------------------"
118         exit -1
119   fi
120
121# cheking for GLU-header
122    AC_CHECK_HEADERS(GL/glu.h ,,
123      [AC_MSG_ERROR([cannot find opengl headers]) ])
124
125    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
126    if test "$FOUND_GLU" = "yes" ; then
127      LIBS="$LIBS -lGLU"
128    else
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   
135
136# checking for SDL-headers
137    AC_CHECK_HEADERS(SDL/SDL.h ,,
138      [AC_MSG_ERROR([cannot find SDL headers]) ])
139
140    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
141     if test "$FOUND_SDL" = "yes" ; then
142        LIBS="$LIBS -lSDL"
143     else
144         echo "------------------"
145         echo "SDL library not found."
146         echo "please install the SDL library, which can be found at http://www.libsdl.org"
147         echo "------------------"
148         exit -1
149     fi   
150       
151    ;;
152  *)
153    mingw="no"
154    ;;
155esac
156AC_MSG_RESULT([$mingw])
157AC_SUBST(MSBITFIELDS)
158
159#### Checking for LIBraries.
160
[1945]161# FIXME: Replace `main' with a function in `-lOSMesa':
162AC_CHECK_LIB([OSMesa], [main])
163# FIXME: Replace `main' with a function in `-lX11':
164AC_CHECK_LIB([X11], [main])
165# FIXME: Replace `main' with a function in `-lXt':
166AC_CHECK_LIB([Xt], [main])
[1959]167
[2190]168
169#checking for pthread libs
170AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
171if test "$FOUND_pthread" = "yes" ; then
172    LIBS="$LIBS -lpthread"
173fi
174
175
176
177
[1945]178# FIXME: Replace `main' with a function in `-lm':
179AC_CHECK_LIB([m], [main])
180
[2018]181LIBS="$LIBS `pkg-config --libs  gtk+-2.0`"
182
183
[1945]184# Checks for header files.
185AC_HEADER_STDC
186AC_CHECK_HEADERS([stdlib.h string.h])
187
188# Checks for typedefs, structures, and compiler characteristics.
189AC_HEADER_STDBOOL
190
191# Checks for library functions.
192AC_FUNC_MALLOC
193AC_CHECK_FUNCS([bzero sqrt])
194
[1946]195AC_CONFIG_FILES([Makefile
196                 console/Makefile
[1945]197                 gui/Makefile
[2751]198                 src/Makefile
199                 importer/Makefile])
[1945]200AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.