[1945] | 1 | # -*- Autoconf -*- |
---|
| 2 | # Process this file with autoconf to produce a configure script. |
---|
| 3 | |
---|
[2980] | 4 | #AC_PREREQ(2.56) |
---|
[1950] | 5 | AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch) |
---|
[2980] | 6 | |
---|
| 7 | # Detect the canonical host and target build environment. |
---|
| 8 | AC_CANONICAL_BUILD |
---|
| 9 | AC_CANONICAL_HOST |
---|
| 10 | AC_CANONICAL_TARGET |
---|
| 11 | |
---|
| 12 | |
---|
[1959] | 13 | AM_INIT_AUTOMAKE |
---|
[2618] | 14 | |
---|
[1951] | 15 | AC_CONFIG_SRCDIR([.]) |
---|
[1945] | 16 | AC_CONFIG_HEADER([config.h]) |
---|
| 17 | |
---|
[2018] | 18 | |
---|
[1945] | 19 | # Checks for programs. |
---|
| 20 | AC_PROG_CXX |
---|
[2925] | 21 | AC_HEADER_STDC |
---|
[2701] | 22 | |
---|
| 23 | ### CHECKING FOR SYSTEM ### |
---|
| 24 | |
---|
| 25 | AC_MSG_CHECKING([for System]) |
---|
[2980] | 26 | ## checking for openGL-environment and other sys-specific parameters |
---|
| 27 | case "$target" in |
---|
[2701] | 28 | ### WINDOWS ### |
---|
[2980] | 29 | *-*-mingw32*) |
---|
[2701] | 30 | echo "mingw-WINDOWS detected" |
---|
| 31 | |
---|
| 32 | mingw="yes" |
---|
| 33 | MSBITFIELDS="-mms-bitfields" |
---|
| 34 | MWINDOWS="-mwindows" |
---|
| 35 | |
---|
| 36 | # checking gl header |
---|
| 37 | #done before loop |
---|
| 38 | |
---|
[2925] | 39 | # checking gl header |
---|
[2879] | 40 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
| 41 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
[2701] | 42 | # checking for Windows openGl 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" |
---|
[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 | |
---|
[2701] | 54 | # cheking for GLU-header |
---|
| 55 | AC_CHECK_HEADERS(GL/glu.h ,, |
---|
[1971] | 56 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 57 | |
---|
[2701] | 58 | # checking for libGLU |
---|
[1971] | 59 | AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes) |
---|
| 60 | if test "$FOUND_glu32" = "yes" ; then |
---|
[1959] | 61 | LIBS="$LIBS -lGLU32" |
---|
[2701] | 62 | else |
---|
[1959] | 63 | echo "------------------" |
---|
| 64 | echo "GLU library not found." |
---|
| 65 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
| 66 | echo "------------------" |
---|
| 67 | exit -1 |
---|
| 68 | fi |
---|
[1971] | 69 | |
---|
[2701] | 70 | |
---|
| 71 | # checking for mingw32 |
---|
| 72 | AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes) |
---|
| 73 | if test $FOUND_mingw32 = "yes"; then |
---|
| 74 | LIBS="$LIBS -lmingw32" |
---|
| 75 | fi |
---|
| 76 | |
---|
| 77 | ;; |
---|
| 78 | |
---|
| 79 | ### LINUX ### |
---|
[2980] | 80 | *-*-linux*) |
---|
[2701] | 81 | echo "Linux detected" |
---|
| 82 | |
---|
| 83 | Linux="yes" |
---|
| 84 | |
---|
[2925] | 85 | # checking gl header |
---|
[2879] | 86 | AC_CHECK_HEADERS(GL/gl.h ,, |
---|
| 87 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
[2701] | 88 | |
---|
| 89 | # checking for Unix GL |
---|
| 90 | AC_CHECK_LIB([GL], [main], FOUND_GL=yes) |
---|
| 91 | if test "$FOUND_GL" = "yes" ; then |
---|
| 92 | LIBS="$LIBS -lGL" |
---|
| 93 | else |
---|
| 94 | echo "------------------" |
---|
| 95 | echo "opengl not found." |
---|
| 96 | echo "please install the opengl package which can be found at http://www.opengl.org" |
---|
| 97 | echo "------------------" |
---|
| 98 | exit -1 |
---|
| 99 | fi |
---|
| 100 | |
---|
| 101 | # cheking for GLU-header |
---|
| 102 | AC_CHECK_HEADERS(GL/glu.h ,, |
---|
| 103 | [AC_MSG_ERROR([cannot find opengl headers]) ]) |
---|
| 104 | |
---|
| 105 | AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes) |
---|
| 106 | if test "$FOUND_GLU" = "yes" ; then |
---|
| 107 | LIBS="$LIBS -lGLU" |
---|
| 108 | else |
---|
| 109 | echo "------------------" |
---|
| 110 | echo "GLU library not found." |
---|
| 111 | echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org" |
---|
| 112 | echo "------------------" |
---|
| 113 | exit -1 |
---|
| 114 | fi |
---|
| 115 | ;; |
---|
| 116 | *) |
---|
| 117 | mingw="no" |
---|
| 118 | ;; |
---|
| 119 | esac |
---|
[2968] | 120 | |
---|
[2701] | 121 | AC_SUBST(MSBITFIELDS) |
---|
| 122 | |
---|
| 123 | |
---|
[2980] | 124 | ## checking for SDL |
---|
| 125 | SDL_VERSION=1.2.7 |
---|
| 126 | AM_PATH_SDL($SDL_VERSION, |
---|
| 127 | :, |
---|
| 128 | AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) |
---|
| 129 | ) |
---|
| 130 | CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" |
---|
| 131 | LIBS="$LIBS $SDL_LIBS" |
---|
[1959] | 132 | |
---|
[2980] | 133 | |
---|
| 134 | ## checking for GTK |
---|
| 135 | PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no) |
---|
| 136 | AC_SUBST(GTK2_LIBS) |
---|
| 137 | AC_SUBST(GTK2_CFLAGS) |
---|
| 138 | AM_CONDITIONAL(HAVE_GTK2, test "x$have_gtk2" = xyes) |
---|
| 139 | |
---|
| 140 | |
---|
[2190] | 141 | #checking for pthread libs |
---|
[2968] | 142 | AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes) |
---|
| 143 | if test "$FOUND_pthread" = "yes" ; then |
---|
[2190] | 144 | LIBS="$LIBS -lpthread" |
---|
[2968] | 145 | fi |
---|
[2190] | 146 | |
---|
| 147 | |
---|
[1945] | 148 | # FIXME: Replace `main' with a function in `-lm': |
---|
[2968] | 149 | AC_CHECK_LIB([m], [main]) |
---|
[1945] | 150 | |
---|
[2018] | 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 |
---|
[2819] | 166 | src/Makefile |
---|
| 167 | importer/Makefile]) |
---|
[1945] | 168 | AC_OUTPUT |
---|