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