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