Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: fixed problem with the AC_CHECK_HEADER. now works in linux and windows again.

File size: 4.8 KB
RevLine 
[1945]1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
[2611]4AC_PREREQ(2.56)
[1950]5AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch)
[1959]6AM_INIT_AUTOMAKE
[2618]7
[1951]8AC_CONFIG_SRCDIR([.])
[1945]9AC_CONFIG_HEADER([config.h])
10
[2018]11
[1945]12# Checks for programs.
13AC_PROG_CXX
14AC_PROG_CC
15
[1959]16
[1971]17
[2925]18AC_HEADER_STDC
[2701]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
[2925]35# checking gl header
[2879]36   AC_CHECK_HEADERS(GL/gl.h ,,
37      [AC_MSG_ERROR([cannot find opengl headers]) ])
[2701]38#   checking for Windows openGl library
[1971]39    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
40    if test "$FOUND_opengl32" = "yes" ; then
[1959]41        LIBS="$LIBS -lopengl32"
[1971]42    else
[1959]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
[2701]50# cheking for GLU-header
51    AC_CHECK_HEADERS(GL/glu.h ,,
[1971]52      [AC_MSG_ERROR([cannot find opengl headers]) ])
53
[2701]54# checking for libGLU
[1971]55    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
56    if test "$FOUND_glu32" = "yes" ; then
[1959]57        LIBS="$LIBS -lGLU32"
[2701]58    else
[1959]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
[1971]65
[2701]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
[2925]106# checking gl header
[2879]107   AC_CHECK_HEADERS(GL/gl.h ,,
108      [AC_MSG_ERROR([cannot find opengl headers]) ])
[2701]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    ;;
153  *)
154    mingw="no"
155    ;;
156esac
157AC_MSG_RESULT([$mingw])
158AC_SUBST(MSBITFIELDS)
159
160#### Checking for LIBraries.
161
[1945]162# FIXME: Replace `main' with a function in `-lOSMesa':
163AC_CHECK_LIB([OSMesa], [main])
164# FIXME: Replace `main' with a function in `-lX11':
165AC_CHECK_LIB([X11], [main])
166# FIXME: Replace `main' with a function in `-lXt':
167AC_CHECK_LIB([Xt], [main])
[1959]168
[2190]169
170#checking for pthread libs
171AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
172if test "$FOUND_pthread" = "yes" ; then
173    LIBS="$LIBS -lpthread"
174fi
175
176
177
178
[1945]179# FIXME: Replace `main' with a function in `-lm':
180AC_CHECK_LIB([m], [main])
181
[2018]182LIBS="$LIBS `pkg-config --libs  gtk+-2.0`"
183
184
[1945]185# Checks for header files.
186AC_HEADER_STDC
187AC_CHECK_HEADERS([stdlib.h string.h])
188
189# Checks for typedefs, structures, and compiler characteristics.
190AC_HEADER_STDBOOL
191
192# Checks for library functions.
193AC_FUNC_MALLOC
194AC_CHECK_FUNCS([bzero sqrt])
195
[1946]196AC_CONFIG_FILES([Makefile
197                 console/Makefile
[1945]198                 gui/Makefile
[2819]199                 src/Makefile
200                 importer/Makefile])
[1945]201AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.