[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 | |
---|
[1945] | 12 | # Checks for programs. |
---|
| 13 | AC_PROG_CXX |
---|
| 14 | AC_PROG_CC |
---|
| 15 | |
---|
[1959] | 16 | |
---|
[1971] | 17 | |
---|
[2925] | 18 | AC_HEADER_STDC |
---|
[2701] | 19 | |
---|
| 20 | ### CHECKING FOR SYSTEM ### |
---|
| 21 | |
---|
| 22 | AC_MSG_CHECKING([for System]) |
---|
| 23 | case `uname` in |
---|
| 24 | ### WINDOWS ### |
---|
| 25 | *MINGW*) |
---|
| 26 | echo "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*) |
---|
| 102 | echo "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 | |
---|
[2968] | 152 | # FIXME: Replace `main' with a function in `-lOSMesa': |
---|
| 153 | AC_CHECK_LIB([OSMesa], [main]) |
---|
| 154 | # FIXME: Replace `main' with a function in `-lX11': |
---|
| 155 | AC_CHECK_LIB([X11], [main]) |
---|
| 156 | # FIXME: Replace `main' with a function in `-lXt': |
---|
| 157 | AC_CHECK_LIB([Xt], [main]) |
---|
[2701] | 158 | ;; |
---|
| 159 | *) |
---|
| 160 | mingw="no" |
---|
| 161 | ;; |
---|
| 162 | esac |
---|
[2968] | 163 | |
---|
[2701] | 164 | AC_SUBST(MSBITFIELDS) |
---|
| 165 | |
---|
| 166 | |
---|
[1959] | 167 | |
---|
[2190] | 168 | #checking for pthread libs |
---|
[2968] | 169 | AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes) |
---|
| 170 | if test "$FOUND_pthread" = "yes" ; then |
---|
[2190] | 171 | LIBS="$LIBS -lpthread" |
---|
[2968] | 172 | fi |
---|
[2190] | 173 | |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | |
---|
[1945] | 177 | # FIXME: Replace `main' with a function in `-lm': |
---|
[2968] | 178 | AC_CHECK_LIB([m], [main]) |
---|
[1945] | 179 | |
---|
[2018] | 180 | LIBS="$LIBS `pkg-config --libs gtk+-2.0`" |
---|
| 181 | |
---|
| 182 | |
---|
[1945] | 183 | # Checks for header files. |
---|
| 184 | AC_HEADER_STDC |
---|
| 185 | AC_CHECK_HEADERS([stdlib.h string.h]) |
---|
| 186 | |
---|
| 187 | # Checks for typedefs, structures, and compiler characteristics. |
---|
| 188 | AC_HEADER_STDBOOL |
---|
| 189 | |
---|
| 190 | # Checks for library functions. |
---|
| 191 | AC_FUNC_MALLOC |
---|
| 192 | AC_CHECK_FUNCS([bzero sqrt]) |
---|
| 193 | |
---|
[1946] | 194 | AC_CONFIG_FILES([Makefile |
---|
| 195 | console/Makefile |
---|
[1945] | 196 | gui/Makefile |
---|
[2819] | 197 | src/Makefile |
---|
| 198 | importer/Makefile]) |
---|
[1945] | 199 | AC_OUTPUT |
---|