Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/old.chris/configure.ac @ 3524

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

orxonox/branches/chris: now it configures the right values for Linux&Winodws.

File size: 4.1 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch)
6AM_INIT_AUTOMAKE
7AC_CONFIG_SRCDIR([.])
8AC_CONFIG_HEADER([config.h])
9
10AC_MSG_CHECKING([for mingw])
11case `uname` in
12  *MINGW*)
13    mingw="yes"
14    MSBITFIELDS="-mms-bitfields"
15    MWINDOWS="-mwindows"
16    ;;
17  *)
18    mingw="no"
19    ;;
20esac
21AC_MSG_RESULT([$mingw])
22AC_SUBST(MSBITFIELDS)
23
24
25# Checks for programs.
26AC_PROG_CXX
27AC_PROG_CC
28
29# Checks for libraries.
30
31#  cheking for libGL
32AC_CHECK_HEADERS(GL/gl.h ,,
33      [AC_MSG_ERROR([cannot find opengl headers]) ])
34
35#   checking for Unix GL
36AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
37if test "$FOUND_GL" = "yes" ; then
38    LIBS="$LIBS -lGL"
39    #   checking for Windows openGl library
40else
41    echo "We did not find the Linux opengl Library. Checking for Windows Library"
42    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
43    if test "$FOUND_opengl32" = "yes" ; then
44        LIBS="$LIBS -lopengl32"
45       
46    else
47         echo "------------------"
48         echo "opengl not found."
49         echo "please install the opengl package which can be found at http://www.opengl.org"
50         echo "------------------"
51         exit -1
52    fi
53fi
54
55#  cheking for libGLU
56AC_CHECK_HEADERS(GL/glu.h ,,
57      [AC_MSG_ERROR([cannot find opengl headers]) ])
58
59AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
60if test "$FOUND_GLU" = "yes" ; then
61    LIBS="$LIBS -lGLU"
62    #   checking for Windows GLU32 library
63else
64    echo "We did not find the Linux GLU Library. Checking for Windows Library"
65    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
66    if test "$FOUND_glu32" = "yes" ; then
67        LIBS="$LIBS -lGLU32"
68       
69        else
70         echo "------------------"
71         echo "GLU library not found."
72         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
73         echo "------------------"
74         exit -1
75    fi
76fi
77
78# FIXME: Replace `main' with a function in `-lOSMesa':
79AC_CHECK_LIB([OSMesa], [main])
80# FIXME: Replace `main' with a function in `-lX11':
81AC_CHECK_LIB([X11], [main])
82# FIXME: Replace `main' with a function in `-lXt':
83AC_CHECK_LIB([Xt], [main])
84
85#  cheking for libglut32
86AC_CHECK_HEADERS(GL/glut.h ,,
87      [AC_MSG_ERROR([cannot find glut headers]) ])
88AC_CHECK_LIB([glut], [glutInit], FOUND_glut=yes)
89if test "$FOUND_glut" = "yes" ; then
90    LIBS="$LIBS -lglut"
91    #   checking for Windows glut32 library
92else
93    echo "We did not find the Linux glut Library. Checking for Windows Library"
94    AC_CHECK_LIB([glut32], [main], FOUND_glut32=yes)
95    if test "$FOUND_glut32" = "yes" ; then
96        LIBS="$LIBS -lglut32"
97    else
98         echo "------------------"
99         echo "glut library not found."
100         echo "please install the glut library, which can be found at http://www.xmission.com/~nate/glut.html"
101         echo "------------------"
102         exit -1
103    fi
104fi
105
106## mingw CHECK
107if test $mingw = yes ; then
108        AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
109        if test $FOUND_mingw32 = "yes"; then
110                LIBS="$LIBS -lmingw32"
111        fi
112fi
113
114## SDL CHECK
115
116#checking for SDL libs
117AC_CHECK_HEADERS(SDL/SDL.h ,,
118      [AC_MSG_ERROR([cannot find SDL headers]) ])
119if test $mingw = no ; then
120        AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
121        if test "$FOUND_SDL" = "yes" ; then
122                LIBS="$LIBS -lSDL"
123        fi
124#   checking for Windows sdl library
125else
126    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
127    if test "$FOUND_sdlmain" = "yes" ; then
128        LIBS="$LIBS -lsdlmain"
129    fi
130        AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
131        if test "$FOUND_sdl" = "yes" ; then
132                LIBS="$LIBS -lsdl"
133        fi
134fi
135
136#checking for pthread libs
137AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
138if test "$FOUND_pthread" = "yes" ; then
139    LIBS="$LIBS -lpthread"
140fi
141
142
143
144
145# FIXME: Replace `main' with a function in `-lm':
146AC_CHECK_LIB([m], [main])
147
148LIBS="$LIBS `pkg-config --libs  gtk+-2.0`"
149
150
151# Checks for header files.
152AC_HEADER_STDC
153AC_CHECK_HEADERS([stdlib.h string.h])
154
155# Checks for typedefs, structures, and compiler characteristics.
156AC_HEADER_STDBOOL
157
158# Checks for library functions.
159AC_FUNC_MALLOC
160AC_CHECK_FUNCS([bzero sqrt])
161
162AC_CONFIG_FILES([Makefile
163                 console/Makefile
164                 gui/Makefile
165                 src/Makefile])
166AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.