1 | # -*- Autoconf -*- |
---|
2 | # Process this file with autoconf to produce a configure script. |
---|
3 | |
---|
4 | AC_PREREQ(2.59) |
---|
5 | AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch) |
---|
6 | AM_INIT_AUTOMAKE |
---|
7 | AC_CONFIG_SRCDIR([.]) |
---|
8 | AC_CONFIG_HEADER([config.h]) |
---|
9 | |
---|
10 | AC_MSG_CHECKING([for mingw]) |
---|
11 | case `uname` in |
---|
12 | *MINGW*) |
---|
13 | mingw="yes" |
---|
14 | MSBITFIELDS="-mms-bitfields" |
---|
15 | MWINDOWS="-mwindows" |
---|
16 | ;; |
---|
17 | *) |
---|
18 | mingw="no" |
---|
19 | ;; |
---|
20 | esac |
---|
21 | AC_MSG_RESULT([$mingw]) |
---|
22 | AC_SUBST(MSBITFIELDS) |
---|
23 | |
---|
24 | |
---|
25 | # Checks for programs. |
---|
26 | AC_PROG_CXX |
---|
27 | AC_PROG_CC |
---|
28 | |
---|
29 | # Checks for libraries. |
---|
30 | |
---|
31 | # cheking for libGL |
---|
32 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
33 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
34 | |
---|
35 | # checking for Unix GL |
---|
36 | AC_CHECK_LIB([GL], [main], FOUND_GL=yes) |
---|
37 | if test "$FOUND_GL" = "yes" ; then |
---|
38 | LIBS="$LIBS -lGL" |
---|
39 | # checking for Windows openGl library |
---|
40 | else |
---|
41 | echo "We did not find the Linux opengl Library. Checking for Windows Library" |
---|
42 | AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h") |
---|
43 | if test "$FOUND_opengl32" = "yes" ; then |
---|
44 | LIBS="$LIBS -lopengl32" |
---|
45 | |
---|
46 | else |
---|
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 | fi |
---|
54 | |
---|
55 | # cheking for libGLU |
---|
56 | AC_CHECK_HEADERS(GL/glu.h ,, |
---|
57 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
58 | |
---|
59 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
60 | if test "$FOUND_GLU" = "yes" ; then |
---|
61 | LIBS="$LIBS -lGLU" |
---|
62 | # checking for Windows GLU32 library |
---|
63 | else |
---|
64 | echo "We did not find the Linux GLU Library. Checking for Windows Library" |
---|
65 | AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes) |
---|
66 | if test "$FOUND_glu32" = "yes" ; then |
---|
67 | LIBS="$LIBS -lGLU32" |
---|
68 | |
---|
69 | else |
---|
70 | echo "------------------" |
---|
71 | echo "GLU library not found." |
---|
72 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
73 | echo "------------------" |
---|
74 | exit -1 |
---|
75 | fi |
---|
76 | fi |
---|
77 | |
---|
78 | # FIXME: Replace `main' with a function in `-lOSMesa': |
---|
79 | AC_CHECK_LIB([OSMesa], [main]) |
---|
80 | # FIXME: Replace `main' with a function in `-lX11': |
---|
81 | AC_CHECK_LIB([X11], [main]) |
---|
82 | # FIXME: Replace `main' with a function in `-lXt': |
---|
83 | AC_CHECK_LIB([Xt], [main]) |
---|
84 | |
---|
85 | # cheking for libglut32 |
---|
86 | AC_CHECK_HEADERS(GL/glut.h ,, |
---|
87 | [AC_MSG_ERROR([cannot find glut headers]) ]) |
---|
88 | AC_CHECK_LIB([glut], [glutInit], FOUND_glut=yes) |
---|
89 | if test "$FOUND_glut" = "yes" ; then |
---|
90 | LIBS="$LIBS -lglut" |
---|
91 | # checking for Windows glut32 library |
---|
92 | else |
---|
93 | echo "We did not find the Linux glut Library. Checking for Windows Library" |
---|
94 | AC_CHECK_LIB([glut32], [main], FOUND_glut32=yes) |
---|
95 | if test "$FOUND_glut32" = "yes" ; then |
---|
96 | LIBS="$LIBS -lglut32" |
---|
97 | else |
---|
98 | echo "------------------" |
---|
99 | echo "glut library not found." |
---|
100 | echo "please install the glut library, which can be found at http://www.xmission.com/~nate/glut.html" |
---|
101 | echo "------------------" |
---|
102 | exit -1 |
---|
103 | fi |
---|
104 | fi |
---|
105 | |
---|
106 | ## mingw CHECK |
---|
107 | if test $mingw = yes ; then |
---|
108 | AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) |
---|
109 | if test $FOUND_mingw32 = "yes"; then |
---|
110 | LIBS="$LIBS -lmingw32" |
---|
111 | fi |
---|
112 | fi |
---|
113 | |
---|
114 | ## SDL CHECK |
---|
115 | |
---|
116 | #checking for SDL libs |
---|
117 | AC_CHECK_HEADERS(SDL/SDL.h ,, |
---|
118 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
119 | if test $mingw = no ; then |
---|
120 | AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes) |
---|
121 | if test "$FOUND_SDL" = "yes" ; then |
---|
122 | LIBS="$LIBS -lSDL" |
---|
123 | fi |
---|
124 | # checking for Windows sdl library |
---|
125 | else |
---|
126 | AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes) |
---|
127 | if test "$FOUND_sdlmain" = "yes" ; then |
---|
128 | LIBS="$LIBS -lsdlmain" |
---|
129 | fi |
---|
130 | AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes) |
---|
131 | if test "$FOUND_sdl" = "yes" ; then |
---|
132 | LIBS="$LIBS -lsdl" |
---|
133 | fi |
---|
134 | fi |
---|
135 | |
---|
136 | #checking for pthread libs |
---|
137 | AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes) |
---|
138 | if test "$FOUND_pthread" = "yes" ; then |
---|
139 | LIBS="$LIBS -lpthread" |
---|
140 | fi |
---|
141 | |
---|
142 | |
---|
143 | |
---|
144 | |
---|
145 | # FIXME: Replace `main' with a function in `-lm': |
---|
146 | AC_CHECK_LIB([m], [main]) |
---|
147 | |
---|
148 | LIBS="$LIBS `pkg-config --libs gtk+-2.0`" |
---|
149 | |
---|
150 | |
---|
151 | # Checks for header files. |
---|
152 | AC_HEADER_STDC |
---|
153 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
154 | |
---|
155 | # Checks for typedefs, structures, and compiler characteristics. |
---|
156 | AC_HEADER_STDBOOL |
---|
157 | |
---|
158 | # Checks for library functions. |
---|
159 | AC_FUNC_MALLOC |
---|
160 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
161 | |
---|
162 | AC_CONFIG_FILES([Makefile |
---|
163 | console/Makefile |
---|
164 | gui/Makefile |
---|
165 | src/Makefile]) |
---|
166 | AC_OUTPUT |
---|