Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/osX/configure.ac @ 2978

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

orxonox/branches/osX: now compiles on Macintosh

File size: 5.2 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_HEADER_STDC
19
20### CHECKING FOR SYSTEM ###
21
22AC_MSG_CHECKING([for System])
23case `uname` in
24### WINDOWS ###
25  *MINGW*)
26echo "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*)
102echo "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### OS X ###
161 *Darwin*)
162echo "OS X detected"
163
164 osX="yes"
165
166# checking gl header
167   AC_CHECK_HEADERS(OpenGL/gl.h ,,
168      [AC_MSG_ERROR([cannot find opengl headers]) ])
169# cheking for GLU-header
170    AC_CHECK_HEADERS(OpenGL/glu.h ,,
171      [AC_MSG_ERROR([cannot find opengl headers]) ])
172
173   LIBS="$LIBS -framework OpenGL"
174
175# checking for SDL-headers
176    AC_CHECK_HEADERS(SDL/SDL.h ,,
177      [AC_MSG_ERROR([cannot find SDL headers]) ])
178
179 LIBS="$LIBS -L/sw/lib -lSDLmain -lSDL -framework Cocoa"
180
181  ;;
182
183  *)
184    mingw="no"
185    ;;
186esac
187
188AC_SUBST(MSBITFIELDS)
189
190
191
192#checking for pthread libs
193 AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
194 if test "$FOUND_pthread" = "yes" ; then
195    LIBS="$LIBS -lpthread"
196 fi
197
198
199
200
201# FIXME: Replace `main' with a function in `-lm':
202 AC_CHECK_LIB([m], [main])
203
204LIBS="$LIBS `pkg-config --libs  gtk+-2.0`"
205
206
207# Checks for header files.
208AC_HEADER_STDC
209AC_CHECK_HEADERS([stdlib.h string.h])
210
211# Checks for typedefs, structures, and compiler characteristics.
212AC_HEADER_STDBOOL
213
214# Checks for library functions.
215AC_FUNC_MALLOC
216AC_CHECK_FUNCS([bzero sqrt])
217
218AC_CONFIG_FILES([Makefile
219                 console/Makefile
220                 gui/Makefile
221                 src/Makefile
222                 importer/Makefile])
223AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.