Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/configure.ac @ 2879

Last change on this file since 2879 was 2879, checked in by bensch, 20 years ago

orxonox/trunk: fix for configure.ac checks one header before checking system headers. Now works better.

File size: 4.9 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.56)
5AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch)
6AM_INIT_AUTOMAKE
7
8AC_CONFIG_SRCDIR([.])
9AC_CONFIG_HEADER([config.h])
10
11
12# Checks for programs.
13AC_PROG_CXX
14AC_PROG_CC
15
16
17
18AC_CHECK_HEADERS(,,,)
19
20
21
22### CHECKING FOR SYSTEM ###
23
24AC_MSG_CHECKING([for System])
25case `uname` in
26### WINDOWS ###
27  *MINGW*)
28echo "mingw-WINDOWS detected"
29
30    mingw="yes"
31    MSBITFIELDS="-mms-bitfields"
32    MWINDOWS="-mwindows"
33
34# checking gl header
35        #done before loop
36
37# checking gl header (has to be here because of a Linux error)
38   AC_CHECK_HEADERS(GL/gl.h ,,
39      [AC_MSG_ERROR([cannot find opengl headers]) ])
40#   checking for Windows openGl 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    else
45         echo "------------------"
46         echo "opengl not found."
47         echo "please install the opengl package which can be found at http://www.opengl.org"
48         echo "------------------"
49         exit -1
50    fi
51
52# cheking for GLU-header
53    AC_CHECK_HEADERS(GL/glu.h ,,
54      [AC_MSG_ERROR([cannot find opengl headers]) ])
55
56# checking for libGLU
57    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
58    if test "$FOUND_glu32" = "yes" ; then
59        LIBS="$LIBS -lGLU32"
60    else
61         echo "------------------"
62         echo "GLU library not found."
63         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
64         echo "------------------"
65         exit -1
66    fi
67
68
69# checking for mingw32
70    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
71    if test $FOUND_mingw32 = "yes"; then
72        LIBS="$LIBS -lmingw32"
73    fi
74# checking for SDL-headers
75    AC_CHECK_HEADERS(SDL/SDL.h ,,
76      [AC_MSG_ERROR([cannot find SDL headers]) ])
77
78#checking for libSDL
79    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
80    if test "$FOUND_sdlmain" = "yes" ; then
81        LIBS="$LIBS -lsdlmain"
82    else
83         echo "------------------"
84         echo "SDL library not found."
85         echo "please install the SDL library, which can be found at http://www.libsdl.org"
86         echo "------------------"
87         exit 1
88    fi
89    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
90    if test "$FOUND_sdl" = "yes" ; then
91        LIBS="$LIBS -lsdl"
92    else
93         echo "------------------"
94         echo "SDL library not found."
95         echo "please install the SDL library, which can be found at http://www.libsdl.org"
96         echo "------------------"
97         exit -1
98    fi
99
100    ;;
101
102### LINUX ###
103 *Linux*)
104echo "Linux detected"
105
106 Linux="yes"
107
108# checking gl header (has to be here because of a Linux error)
109   AC_CHECK_HEADERS(GL/gl.h ,,
110      [AC_MSG_ERROR([cannot find opengl headers]) ])
111
112#  checking for Unix GL
113   AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
114   if test "$FOUND_GL" = "yes" ; then
115     LIBS="$LIBS -lGL"
116   else
117         echo "------------------"
118         echo "opengl not found."
119         echo "please install the opengl package which can be found at http://www.opengl.org"
120         echo "------------------"
121         exit -1
122   fi
123
124# cheking for GLU-header
125    AC_CHECK_HEADERS(GL/glu.h ,,
126      [AC_MSG_ERROR([cannot find opengl headers]) ])
127
128    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
129    if test "$FOUND_GLU" = "yes" ; then
130      LIBS="$LIBS -lGLU"
131    else
132         echo "------------------"
133         echo "GLU library not found."
134         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
135         echo "------------------"
136         exit -1
137    fi   
138
139# checking for SDL-headers
140    AC_CHECK_HEADERS(SDL/SDL.h ,,
141      [AC_MSG_ERROR([cannot find SDL headers]) ])
142
143    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
144     if test "$FOUND_SDL" = "yes" ; then
145        LIBS="$LIBS -lSDL"
146     else
147         echo "------------------"
148         echo "SDL library not found."
149         echo "please install the SDL library, which can be found at http://www.libsdl.org"
150         echo "------------------"
151         exit -1
152     fi   
153       
154    ;;
155  *)
156    mingw="no"
157    ;;
158esac
159AC_MSG_RESULT([$mingw])
160AC_SUBST(MSBITFIELDS)
161
162#### Checking for LIBraries.
163
164# FIXME: Replace `main' with a function in `-lOSMesa':
165AC_CHECK_LIB([OSMesa], [main])
166# FIXME: Replace `main' with a function in `-lX11':
167AC_CHECK_LIB([X11], [main])
168# FIXME: Replace `main' with a function in `-lXt':
169AC_CHECK_LIB([Xt], [main])
170
171
172#checking for pthread libs
173AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
174if test "$FOUND_pthread" = "yes" ; then
175    LIBS="$LIBS -lpthread"
176fi
177
178
179
180
181# FIXME: Replace `main' with a function in `-lm':
182AC_CHECK_LIB([m], [main])
183
184LIBS="$LIBS `pkg-config --libs  gtk+-2.0`"
185
186
187# Checks for header files.
188AC_HEADER_STDC
189AC_CHECK_HEADERS([stdlib.h string.h])
190
191# Checks for typedefs, structures, and compiler characteristics.
192AC_HEADER_STDBOOL
193
194# Checks for library functions.
195AC_FUNC_MALLOC
196AC_CHECK_FUNCS([bzero sqrt])
197
198AC_CONFIG_FILES([Makefile
199                 console/Makefile
200                 gui/Makefile
201                 src/Makefile
202                 importer/Makefile])
203AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.