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