[1945] | 1 | # -*- Autoconf -*- |
---|
| 2 | # Process this file with autoconf to produce a configure script. |
---|
| 3 | |
---|
| 4 | AC_PREREQ(2.59) |
---|
[1950] | 5 | AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch) |
---|
[1959] | 6 | AM_INIT_AUTOMAKE |
---|
[1951] | 7 | AC_CONFIG_SRCDIR([.]) |
---|
[1945] | 8 | AC_CONFIG_HEADER([config.h]) |
---|
| 9 | |
---|
[2018] | 10 | AC_MSG_CHECKING([for mingw]) |
---|
| 11 | case `uname` in |
---|
| 12 | *MINGW*) |
---|
[2190] | 13 | mingw="yes" |
---|
[2018] | 14 | MSBITFIELDS="-mms-bitfields" |
---|
[2190] | 15 | MWINDOWS="-mwindows" |
---|
[2018] | 16 | ;; |
---|
| 17 | *) |
---|
[2190] | 18 | mingw="no" |
---|
[2018] | 19 | ;; |
---|
| 20 | esac |
---|
| 21 | AC_MSG_RESULT([$mingw]) |
---|
| 22 | AC_SUBST(MSBITFIELDS) |
---|
| 23 | |
---|
| 24 | |
---|
[1945] | 25 | # Checks for programs. |
---|
| 26 | AC_PROG_CXX |
---|
| 27 | AC_PROG_CC |
---|
| 28 | |
---|
| 29 | # Checks for libraries. |
---|
[1959] | 30 | |
---|
| 31 | # cheking for libGL |
---|
[1971] | 32 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
| 33 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 34 | |
---|
[1959] | 35 | # checking for Unix GL |
---|
[1971] | 36 | AC_CHECK_LIB([GL], [main], FOUND_GL=yes) |
---|
[1959] | 37 | if test "$FOUND_GL" = "yes" ; then |
---|
| 38 | LIBS="$LIBS -lGL" |
---|
| 39 | # checking for Windows openGl library |
---|
| 40 | else |
---|
| 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 |
---|
| 53 | fi |
---|
| 54 | |
---|
| 55 | # cheking for libGLU |
---|
[1971] | 56 | AC_CHECK_HEADERS(GL/glu.h ,, |
---|
| 57 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 58 | |
---|
[1959] | 59 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
| 60 | if test "$FOUND_GLU" = "yes" ; then |
---|
| 61 | LIBS="$LIBS -lGLU" |
---|
| 62 | # checking for Windows GLU32 library |
---|
| 63 | else |
---|
| 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 |
---|
| 76 | fi |
---|
[1971] | 77 | |
---|
[1945] | 78 | # FIXME: Replace `main' with a function in `-lOSMesa': |
---|
| 79 | AC_CHECK_LIB([OSMesa], [main]) |
---|
| 80 | # FIXME: Replace `main' with a function in `-lX11': |
---|
| 81 | AC_CHECK_LIB([X11], [main]) |
---|
| 82 | # FIXME: Replace `main' with a function in `-lXt': |
---|
| 83 | AC_CHECK_LIB([Xt], [main]) |
---|
[1959] | 84 | |
---|
| 85 | # cheking for libglut32 |
---|
[1971] | 86 | AC_CHECK_HEADERS(GL/glut.h ,, |
---|
| 87 | [AC_MSG_ERROR([cannot find glut headers]) ]) |
---|
[1959] | 88 | AC_CHECK_LIB([glut], [glutInit], FOUND_glut=yes) |
---|
| 89 | if test "$FOUND_glut" = "yes" ; then |
---|
| 90 | LIBS="$LIBS -lglut" |
---|
| 91 | # checking for Windows glut32 library |
---|
| 92 | else |
---|
| 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 |
---|
| 104 | fi |
---|
| 105 | |
---|
[2190] | 106 | ## mingw CHECK |
---|
| 107 | if 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 |
---|
| 112 | fi |
---|
| 113 | |
---|
| 114 | ## SDL CHECK |
---|
| 115 | |
---|
| 116 | #checking for SDL libs |
---|
| 117 | AC_CHECK_HEADERS(SDL/SDL.h ,, |
---|
| 118 | [AC_MSG_ERROR([cannot find SDL headers]) ]) |
---|
| 119 | if 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 |
---|
| 125 | else |
---|
| 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 |
---|
| 134 | fi |
---|
| 135 | |
---|
| 136 | #checking for pthread libs |
---|
| 137 | AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes) |
---|
| 138 | if test "$FOUND_pthread" = "yes" ; then |
---|
| 139 | LIBS="$LIBS -lpthread" |
---|
| 140 | fi |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | |
---|
[1945] | 145 | # FIXME: Replace `main' with a function in `-lm': |
---|
| 146 | AC_CHECK_LIB([m], [main]) |
---|
| 147 | |
---|
[2018] | 148 | LIBS="$LIBS `pkg-config --libs gtk+-2.0`" |
---|
| 149 | |
---|
| 150 | |
---|
[1945] | 151 | # Checks for header files. |
---|
| 152 | AC_HEADER_STDC |
---|
| 153 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
| 154 | |
---|
| 155 | # Checks for typedefs, structures, and compiler characteristics. |
---|
| 156 | AC_HEADER_STDBOOL |
---|
| 157 | |
---|
| 158 | # Checks for library functions. |
---|
| 159 | AC_FUNC_MALLOC |
---|
| 160 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
| 161 | |
---|
[1946] | 162 | AC_CONFIG_FILES([Makefile |
---|
| 163 | console/Makefile |
---|
[1945] | 164 | gui/Makefile |
---|
| 165 | src/Makefile]) |
---|
| 166 | AC_OUTPUT |
---|