[2] | 1 | dnl Process this file with autoconf to produce a configure script. |
---|
[68] | 2 | AC_INIT(abuse, 0.7.1) |
---|
[32] | 3 | AC_CONFIG_AUX_DIR(.auto) |
---|
| 4 | AM_INIT_AUTOMAKE |
---|
[41] | 5 | AM_CONFIG_HEADER(config.h) |
---|
[2] | 6 | |
---|
| 7 | dnl Checks for programs. |
---|
| 8 | AC_PROG_LIBTOOL |
---|
| 9 | AC_ISC_POSIX |
---|
| 10 | AC_PROG_CC |
---|
| 11 | AC_PROG_CPP |
---|
| 12 | AC_PROG_CXX |
---|
| 13 | AC_PROG_INSTALL |
---|
| 14 | AC_C_BIGENDIAN |
---|
| 15 | |
---|
| 16 | dnl Check for X |
---|
| 17 | AC_PATH_X |
---|
| 18 | X_LIBS=-L$x_libraries |
---|
| 19 | |
---|
| 20 | dnl Figure out where the datafiles will be |
---|
| 21 | EXPDATADIR="-DEXPDATADIR=\\\"$datadir/games/abuse\\\"" |
---|
| 22 | AC_SUBST(EXPDATADIR) |
---|
| 23 | |
---|
| 24 | dnl Checks for libraries |
---|
| 25 | dnl Do we need to link against something for X shared memory support? |
---|
| 26 | AC_CHECK_LIB(Xext,XShmAttach,:,[ |
---|
| 27 | AC_CHECK_LIB(XextSam,XShmAttach,LIBS="$LIBS -lXextSam",,$X_LIBS -lX11 -lXext) |
---|
| 28 | ],$X_LIBS -lX11) |
---|
| 29 | |
---|
| 30 | dnl Checks for Solaris compatibility |
---|
| 31 | AC_CHECK_LIB(m,pow,LIBS="$LIBS -lm") |
---|
| 32 | AC_CHECK_LIB(socket,socket,LIBS="$LIBS -lsocket") |
---|
| 33 | AC_CHECK_LIB(nsl,gethostbyname,LIBS="$LIBS -lnsl") |
---|
| 34 | |
---|
| 35 | dnl Check for SDL |
---|
| 36 | SDL_VERSION=1.1.6 |
---|
| 37 | AM_PATH_SDL($SDL_VERSION, :, |
---|
[42] | 38 | AC_MSG_ERROR([*** SDL version $SDL_VERSION or above not found!])) |
---|
[2] | 39 | CFLAGS="$CFLAGS $SDL_CFLAGS" |
---|
| 40 | LIBS="$LIBS $SDL_LIBS $X_LIBS -L/usr/lib" |
---|
| 41 | |
---|
[37] | 42 | # Optimizations |
---|
| 43 | CPPFLAGS="${CPPFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" |
---|
| 44 | # Code qui fait des warnings == code de porc == deux baffes dans ta gueule |
---|
[40] | 45 | CPPFLAGS="${CPPFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Waggregate-return -Wsign-compare" |
---|
[37] | 46 | |
---|
[2] | 47 | dnl Checks for header files |
---|
| 48 | AC_HEADER_DIRENT |
---|
| 49 | AC_HEADER_STDC |
---|
| 50 | AC_CHECK_HEADERS(fcntl.h malloc.h string.h sys/ioctl.h sys/time.h unistd.h) |
---|
| 51 | |
---|
| 52 | dnl Checks for functions |
---|
| 53 | AC_FUNC_MEMCMP |
---|
| 54 | AC_CHECK_FUNCS(atexit on_exit strstr gettimeofday) |
---|
| 55 | |
---|
| 56 | dnl Check for OpenGL |
---|
| 57 | dnl Should this be more thorough? |
---|
| 58 | dnl For OpenGL support on OSX it's better to use Project Builder as -lGL |
---|
| 59 | dnl doesn't seem to work this way. |
---|
| 60 | AC_MSG_CHECKING(for OpenGL support) |
---|
| 61 | have_opengl=no |
---|
| 62 | AC_TRY_COMPILE([ |
---|
[42] | 63 | #ifdef WIN32 |
---|
| 64 | #include <windows.h> |
---|
| 65 | #elif defined(__APPLE__) && defined(__MACH__) |
---|
| 66 | /* #include <OpenGL/gl.h>*/ |
---|
| 67 | #error /* Error so the compile fails on OSX */ |
---|
| 68 | #else |
---|
| 69 | #include <GL/gl.h> |
---|
| 70 | #endif |
---|
[2] | 71 | ],[ |
---|
| 72 | ],[ |
---|
| 73 | have_opengl=yes |
---|
| 74 | ]) |
---|
| 75 | AC_MSG_RESULT($have_opengl) |
---|
| 76 | if test x$have_opengl = xyes; then |
---|
[42] | 77 | CFLAGS="$CFLAGS -DHAVE_OPENGL" |
---|
| 78 | CXXFLAGS="$CXXFLAGS -DHAVE_OPENGL" |
---|
| 79 | LIBS="$LIBS -lGL -lpthread" |
---|
[2] | 80 | fi |
---|
| 81 | |
---|
[42] | 82 | AC_OUTPUT([ |
---|
| 83 | Makefile |
---|
| 84 | abuse.6 |
---|
| 85 | src/Makefile |
---|
[62] | 86 | src/lisp/Makefile |
---|
[42] | 87 | src/net/Makefile |
---|
| 88 | src/imlib/Makefile |
---|
| 89 | src/sdlport/Makefile]) |
---|
[2] | 90 | |
---|
| 91 | echo " |
---|
| 92 | ------ Configuration for $PACKAGE $VERSION ------ |
---|
| 93 | Compiler: ${CC} (version `${CC} --version`) |
---|
| 94 | Install prefix: $prefix |
---|
| 95 | SDL version: `sdl-config --version` |
---|
| 96 | OpenGL support: $have_opengl |
---|
| 97 | |
---|
| 98 | Now type 'make' to build $PACKAGE. |
---|
| 99 | " |
---|