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 | ;; |
---|
16 | *) |
---|
17 | mingw=no |
---|
18 | ;; |
---|
19 | esac |
---|
20 | AC_MSG_RESULT([$mingw]) |
---|
21 | AC_SUBST(MSBITFIELDS) |
---|
22 | |
---|
23 | |
---|
24 | # Checks for programs. |
---|
25 | AC_PROG_CXX |
---|
26 | AC_PROG_CC |
---|
27 | |
---|
28 | # Checks for libraries. |
---|
29 | |
---|
30 | # cheking for libGL |
---|
31 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
32 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
33 | |
---|
34 | # checking for Unix GL |
---|
35 | AC_CHECK_LIB([GL], [main], FOUND_GL=yes) |
---|
36 | if test "$FOUND_GL" = "yes" ; then |
---|
37 | LIBS="$LIBS -lGL" |
---|
38 | # checking for Windows openGl library |
---|
39 | else |
---|
40 | echo "We did not find the Linux opengl Library. Checking for Windows Library" |
---|
41 | AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h") |
---|
42 | if test "$FOUND_opengl32" = "yes" ; then |
---|
43 | LIBS="$LIBS -lopengl32" |
---|
44 | |
---|
45 | else |
---|
46 | echo "------------------" |
---|
47 | echo "opengl not found." |
---|
48 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
49 | echo "------------------" |
---|
50 | exit -1 |
---|
51 | fi |
---|
52 | fi |
---|
53 | |
---|
54 | # cheking for libGLU |
---|
55 | AC_CHECK_HEADERS(GL/glu.h ,, |
---|
56 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
57 | |
---|
58 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
59 | if test "$FOUND_GLU" = "yes" ; then |
---|
60 | LIBS="$LIBS -lGLU" |
---|
61 | # checking for Windows GLU32 library |
---|
62 | else |
---|
63 | echo "We did not find the Linux GLU Library. Checking for Windows Library" |
---|
64 | AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes) |
---|
65 | if test "$FOUND_glu32" = "yes" ; then |
---|
66 | LIBS="$LIBS -lGLU32" |
---|
67 | |
---|
68 | else |
---|
69 | echo "------------------" |
---|
70 | echo "GLU library not found." |
---|
71 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
72 | echo "------------------" |
---|
73 | exit -1 |
---|
74 | fi |
---|
75 | fi |
---|
76 | |
---|
77 | # FIXME: Replace `main' with a function in `-lOSMesa': |
---|
78 | AC_CHECK_LIB([OSMesa], [main]) |
---|
79 | # FIXME: Replace `main' with a function in `-lX11': |
---|
80 | AC_CHECK_LIB([X11], [main]) |
---|
81 | # FIXME: Replace `main' with a function in `-lXt': |
---|
82 | AC_CHECK_LIB([Xt], [main]) |
---|
83 | |
---|
84 | # cheking for libglut32 |
---|
85 | AC_CHECK_HEADERS(GL/glut.h ,, |
---|
86 | [AC_MSG_ERROR([cannot find glut headers]) ]) |
---|
87 | AC_CHECK_LIB([glut], [glutInit], FOUND_glut=yes) |
---|
88 | if test "$FOUND_glut" = "yes" ; then |
---|
89 | LIBS="$LIBS -lglut" |
---|
90 | # checking for Windows glut32 library |
---|
91 | else |
---|
92 | echo "We did not find the Linux glut Library. Checking for Windows Library" |
---|
93 | AC_CHECK_LIB([glut32], [main], FOUND_glut32=yes) |
---|
94 | if test "$FOUND_glut32" = "yes" ; then |
---|
95 | LIBS="$LIBS -lglut32" |
---|
96 | else |
---|
97 | echo "------------------" |
---|
98 | echo "glut library not found." |
---|
99 | echo "please install the glut library, which can be found at http://www.xmission.com/~nate/glut.html" |
---|
100 | echo "------------------" |
---|
101 | exit -1 |
---|
102 | fi |
---|
103 | fi |
---|
104 | |
---|
105 | # FIXME: Replace `main' with a function in `-lm': |
---|
106 | AC_CHECK_LIB([m], [main]) |
---|
107 | |
---|
108 | LIBS="$LIBS `pkg-config --libs gtk+-2.0`" |
---|
109 | |
---|
110 | |
---|
111 | # Checks for header files. |
---|
112 | AC_HEADER_STDC |
---|
113 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
114 | |
---|
115 | # Checks for typedefs, structures, and compiler characteristics. |
---|
116 | AC_HEADER_STDBOOL |
---|
117 | |
---|
118 | # Checks for library functions. |
---|
119 | AC_FUNC_MALLOC |
---|
120 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
121 | |
---|
122 | AC_CONFIG_FILES([Makefile |
---|
123 | console/Makefile |
---|
124 | gui/Makefile |
---|
125 | src/Makefile]) |
---|
126 | AC_OUTPUT |
---|