source: abuse/trunk/configure.ac @ 160

Last change on this file since 160 was 160, checked in by Sam Hocevar, 14 years ago

Get rid of acinclude.m4: modern operating systems provide everything we need.

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