Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/chris/configure.ac @ 2624

Last change on this file since 2624 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
RevLine 
[1945]1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
[1950]5AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch)
[1959]6AM_INIT_AUTOMAKE
[1951]7AC_CONFIG_SRCDIR([.])
[1945]8AC_CONFIG_HEADER([config.h])
9
[2058]10AC_MSG_CHECKING([for mingw])
11case `uname` in
12  *MINGW*)
[2189]13    mingw="yes"
[2058]14    MSBITFIELDS="-mms-bitfields"
[2188]15    MWINDOWS="-mwindows"
[2058]16    ;;
17  *)
[2189]18    mingw="no"
[2058]19    ;;
20esac
21AC_MSG_RESULT([$mingw])
22AC_SUBST(MSBITFIELDS)
23
24
[1945]25# Checks for programs.
26AC_PROG_CXX
27AC_PROG_CC
28
29# Checks for libraries.
[1959]30
31#  cheking for libGL
[1971]32AC_CHECK_HEADERS(GL/gl.h ,,
33      [AC_MSG_ERROR([cannot find opengl headers]) ])
34
[1959]35#   checking for Unix GL
[1971]36AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
[1959]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"
[1971]42    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
43    if test "$FOUND_opengl32" = "yes" ; then
[1959]44        LIBS="$LIBS -lopengl32"
45       
[1971]46    else
[1959]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
[1971]56AC_CHECK_HEADERS(GL/glu.h ,,
57      [AC_MSG_ERROR([cannot find opengl headers]) ])
58
[1959]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"
[1971]65    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
66    if test "$FOUND_glu32" = "yes" ; then
[1959]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
[1971]77
[1945]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])
[1959]84
85#  cheking for libglut32
[1971]86AC_CHECK_HEADERS(GL/glut.h ,,
87      [AC_MSG_ERROR([cannot find glut headers]) ])
[1959]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"
[1971]94    AC_CHECK_LIB([glut32], [main], FOUND_glut32=yes)
[1959]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
[2189]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
[2188]114## SDL CHECK
115
116#checking for SDL libs
117AC_CHECK_HEADERS(SDL/SDL.h ,,
118      [AC_MSG_ERROR([cannot find SDL headers]) ])
[2189]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
[2188]125else
126    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
127    if test "$FOUND_sdlmain" = "yes" ; then
[2189]128        LIBS="$LIBS -lsdlmain"
[2188]129    fi
[2189]130        AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
131        if test "$FOUND_sdl" = "yes" ; then
132                LIBS="$LIBS -lsdl"
133        fi
[2188]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
[1945]145# FIXME: Replace `main' with a function in `-lm':
146AC_CHECK_LIB([m], [main])
147
[2058]148LIBS="$LIBS `pkg-config --libs  gtk+-2.0`"
149
150
[1945]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
[1946]162AC_CONFIG_FILES([Makefile
163                 console/Makefile
[1945]164                 gui/Makefile
165                 src/Makefile])
166AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.