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 | ;; |
---|
99 | |
---|
100 | ### LINUX ### |
---|
101 | *Linux*) |
---|
102 | echo "Linux detected" |
---|
103 | |
---|
104 | Linux="yes" |
---|
105 | |
---|
106 | # checking gl header |
---|
107 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
108 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
109 | |
---|
110 | # checking for Unix GL |
---|
111 | AC_CHECK_LIB([GL], [main], FOUND_GL=yes) |
---|
112 | if test "$FOUND_GL" = "yes" ; then |
---|
113 | LIBS="$LIBS -lGL" |
---|
114 | else |
---|
115 | echo "------------------" |
---|
116 | echo "opengl not found." |
---|
117 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
118 | echo "------------------" |
---|
119 | exit -1 |
---|
120 | fi |
---|
121 | |
---|
122 | # cheking for GLU-header |
---|
123 | AC_CHECK_HEADERS(GL/glu.h ,, |
---|
124 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
125 | |
---|
126 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
127 | if test "$FOUND_GLU" = "yes" ; then |
---|
128 | LIBS="$LIBS -lGLU" |
---|
129 | else |
---|
130 | echo "------------------" |
---|
131 | echo "GLU library not found." |
---|
132 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
133 | echo "------------------" |
---|
134 | exit -1 |
---|
135 | fi |
---|
136 | |
---|
137 | # checking for SDL-headers |
---|
138 | AC_CHECK_HEADERS(SDL/SDL.h ,, |
---|
139 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
140 | |
---|
141 | AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes) |
---|
142 | if test "$FOUND_SDL" = "yes" ; then |
---|
143 | LIBS="$LIBS -lSDL" |
---|
144 | else |
---|
145 | echo "------------------" |
---|
146 | echo "SDL library not found." |
---|
147 | echo "please install the SDL library, which can be found at http://www.libsdl.org" |
---|
148 | echo "------------------" |
---|
149 | exit -1 |
---|
150 | fi |
---|
151 | |
---|
152 | # FIXME: Replace `main' with a function in `-lOSMesa': |
---|
153 | AC_CHECK_LIB([OSMesa], [main]) |
---|
154 | # FIXME: Replace `main' with a function in `-lX11': |
---|
155 | AC_CHECK_LIB([X11], [main]) |
---|
156 | # FIXME: Replace `main' with a function in `-lXt': |
---|
157 | AC_CHECK_LIB([Xt], [main]) |
---|
158 | ;; |
---|
159 | *) |
---|
160 | mingw="no" |
---|
161 | ;; |
---|
162 | esac |
---|
163 | |
---|
164 | AC_SUBST(MSBITFIELDS) |
---|
165 | |
---|
166 | |
---|
167 | |
---|
168 | #checking for pthread libs |
---|
169 | AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes) |
---|
170 | if test "$FOUND_pthread" = "yes" ; then |
---|
171 | LIBS="$LIBS -lpthread" |
---|
172 | fi |
---|
173 | |
---|
174 | |
---|
175 | |
---|
176 | |
---|
177 | # FIXME: Replace `main' with a function in `-lm': |
---|
178 | AC_CHECK_LIB([m], [main]) |
---|
179 | |
---|
180 | LIBS="$LIBS `pkg-config --libs gtk+-2.0`" |
---|
181 | |
---|
182 | |
---|
183 | # Checks for header files. |
---|
184 | AC_HEADER_STDC |
---|
185 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
186 | |
---|
187 | # Checks for typedefs, structures, and compiler characteristics. |
---|
188 | AC_HEADER_STDBOOL |
---|
189 | |
---|
190 | # Checks for library functions. |
---|
191 | AC_FUNC_MALLOC |
---|
192 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
193 | |
---|
194 | AC_CONFIG_FILES([Makefile |
---|
195 | console/Makefile |
---|
196 | gui/Makefile |
---|
197 | src/Makefile |
---|
198 | importer/Makefile]) |
---|
199 | AC_OUTPUT |
---|