1 | # -*- Autoconf -*- |
---|
2 | # Process this file with autoconf to produce a configure script. |
---|
3 | |
---|
4 | AC_PREREQ(2.56) |
---|
5 | AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch) |
---|
6 | AM_INIT_AUTOMAKE |
---|
7 | |
---|
8 | AC_CONFIG_SRCDIR([.]) |
---|
9 | AC_CONFIG_HEADER([config.h]) |
---|
10 | |
---|
11 | |
---|
12 | # Checks for programs. |
---|
13 | AC_PROG_CXX |
---|
14 | AC_PROG_CC |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | AC_HEADER_STDC |
---|
19 | |
---|
20 | ### CHECKING FOR SYSTEM ### |
---|
21 | |
---|
22 | AC_MSG_CHECKING([for System]) |
---|
23 | case `uname` in |
---|
24 | ### WINDOWS ### |
---|
25 | *MINGW*) |
---|
26 | echo "mingw-WINDOWS detected" |
---|
27 | |
---|
28 | mingw="yes" |
---|
29 | MSBITFIELDS="-mms-bitfields" |
---|
30 | MWINDOWS="-mwindows" |
---|
31 | |
---|
32 | # checking gl header |
---|
33 | #done before loop |
---|
34 | |
---|
35 | # checking gl header |
---|
36 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
37 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
38 | # checking for Windows openGl library |
---|
39 | AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h") |
---|
40 | if test "$FOUND_opengl32" = "yes" ; then |
---|
41 | LIBS="$LIBS -lopengl32" |
---|
42 | else |
---|
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 | |
---|
50 | # cheking for GLU-header |
---|
51 | AC_CHECK_HEADERS(GL/glu.h ,, |
---|
52 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
53 | |
---|
54 | # checking for libGLU |
---|
55 | AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes) |
---|
56 | if test "$FOUND_glu32" = "yes" ; then |
---|
57 | LIBS="$LIBS -lGLU32" |
---|
58 | else |
---|
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 |
---|
65 | |
---|
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 | # checking for SDL-Mixer-headers |
---|
99 | AC_CHECK_HEADERS(SDL/SDL_mixer.h ,, |
---|
100 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
101 | |
---|
102 | #checking for libSDL_mixer |
---|
103 | AC_CHECK_LIB([SDL_mixer], [main], FOUND_SDL_mixer=yes) |
---|
104 | if test "$FOUND_SDL_mixer" = "yes" ; then |
---|
105 | LIBS="$LIBS -lSDL_mixer" |
---|
106 | else |
---|
107 | echo "------------------" |
---|
108 | echo "SDL Mixer library not found." |
---|
109 | echo "please install the SDL Mixer library, which can be found at http://www.libsdl.org" |
---|
110 | echo "------------------" |
---|
111 | exit 1 |
---|
112 | fi |
---|
113 | |
---|
114 | |
---|
115 | ;; |
---|
116 | |
---|
117 | ### LINUX ### |
---|
118 | *Linux*) |
---|
119 | echo "Linux detected" |
---|
120 | |
---|
121 | Linux="yes" |
---|
122 | |
---|
123 | # checking gl header |
---|
124 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
125 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
126 | |
---|
127 | # checking for Unix GL |
---|
128 | AC_CHECK_LIB([GL], [main], FOUND_GL=yes) |
---|
129 | if test "$FOUND_GL" = "yes" ; then |
---|
130 | LIBS="$LIBS -lGL" |
---|
131 | else |
---|
132 | echo "------------------" |
---|
133 | echo "opengl not found." |
---|
134 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
135 | echo "------------------" |
---|
136 | exit -1 |
---|
137 | fi |
---|
138 | |
---|
139 | # cheking for GLU-header |
---|
140 | AC_CHECK_HEADERS(GL/glu.h ,, |
---|
141 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
142 | |
---|
143 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
144 | if test "$FOUND_GLU" = "yes" ; then |
---|
145 | LIBS="$LIBS -lGLU" |
---|
146 | else |
---|
147 | echo "------------------" |
---|
148 | echo "GLU library not found." |
---|
149 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
150 | echo "------------------" |
---|
151 | exit -1 |
---|
152 | fi |
---|
153 | |
---|
154 | # checking for SDL-headers |
---|
155 | AC_CHECK_HEADERS(SDL/SDL.h ,, |
---|
156 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
157 | |
---|
158 | AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes) |
---|
159 | if test "$FOUND_SDL" = "yes" ; then |
---|
160 | LIBS="$LIBS -lSDL" |
---|
161 | else |
---|
162 | echo "------------------" |
---|
163 | echo "SDL library not found." |
---|
164 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
165 | echo "------------------" |
---|
166 | exit -1 |
---|
167 | fi |
---|
168 | |
---|
169 | # checking for SDL-Mixer-headers |
---|
170 | AC_CHECK_HEADERS(SDL/SDL_mixer.h ,, |
---|
171 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
172 | |
---|
173 | |
---|
174 | #checking for libSDL_mixer |
---|
175 | AC_CHECK_LIB([SDL_mixer], [main], FOUND_SDL_mixer=yes) |
---|
176 | if test "$FOUND_SDL_mixer" = "yes" ; then |
---|
177 | LIBS="$LIBS -lSDL_mixer" |
---|
178 | else |
---|
179 | echo "------------------" |
---|
180 | echo "SDL Mixer library not found." |
---|
181 | echo "please install the SDL Mixer library, which can be found at http://www.libsdl.org" |
---|
182 | echo "------------------" |
---|
183 | exit 1 |
---|
184 | fi |
---|
185 | |
---|
186 | ;; |
---|
187 | *) |
---|
188 | mingw="no" |
---|
189 | ;; |
---|
190 | esac |
---|
191 | AC_MSG_RESULT([$mingw]) |
---|
192 | AC_SUBST(MSBITFIELDS) |
---|
193 | |
---|
194 | #### Checking for LIBraries. |
---|
195 | |
---|
196 | # FIXME: Replace `main' with a function in `-lOSMesa': |
---|
197 | AC_CHECK_LIB([OSMesa], [main]) |
---|
198 | # FIXME: Replace `main' with a function in `-lX11': |
---|
199 | AC_CHECK_LIB([X11], [main]) |
---|
200 | # FIXME: Replace `main' with a function in `-lXt': |
---|
201 | AC_CHECK_LIB([Xt], [main]) |
---|
202 | |
---|
203 | |
---|
204 | #checking for pthread libs |
---|
205 | AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes) |
---|
206 | if test "$FOUND_pthread" = "yes" ; then |
---|
207 | LIBS="$LIBS -lpthread" |
---|
208 | fi |
---|
209 | |
---|
210 | |
---|
211 | |
---|
212 | |
---|
213 | # FIXME: Replace `main' with a function in `-lm': |
---|
214 | AC_CHECK_LIB([m], [main]) |
---|
215 | |
---|
216 | LIBS="$LIBS `pkg-config --libs gtk+-2.0`" |
---|
217 | |
---|
218 | |
---|
219 | # Checks for header files. |
---|
220 | AC_HEADER_STDC |
---|
221 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
222 | |
---|
223 | # Checks for typedefs, structures, and compiler characteristics. |
---|
224 | AC_HEADER_STDBOOL |
---|
225 | |
---|
226 | # Checks for library functions. |
---|
227 | AC_FUNC_MALLOC |
---|
228 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
229 | |
---|
230 | AC_CONFIG_FILES([Makefile |
---|
231 | console/Makefile |
---|
232 | gui/Makefile |
---|
233 | src/Makefile |
---|
234 | importer/Makefile]) |
---|
235 | AC_OUTPUT |
---|