source: abuse/tags/0.7.1/configure.ac @ 69

Last change on this file since 69 was 68, checked in by Sam Hocevar, 11 years ago
  • Version 0.7.1 is ready.
File size: 2.5 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
18X_LIBS=-L$x_libraries
19
20dnl Figure out where the datafiles will be
21EXPDATADIR="-DEXPDATADIR=\\\"$datadir/games/abuse\\\""
22AC_SUBST(EXPDATADIR)
23
24dnl Checks for libraries
25dnl Do we need to link against something for X shared memory support?
26AC_CHECK_LIB(Xext,XShmAttach,:,[
27AC_CHECK_LIB(XextSam,XShmAttach,LIBS="$LIBS -lXextSam",,$X_LIBS -lX11 -lXext)
28],$X_LIBS -lX11)
29
30dnl Checks for Solaris compatibility
31AC_CHECK_LIB(m,pow,LIBS="$LIBS -lm")
32AC_CHECK_LIB(socket,socket,LIBS="$LIBS -lsocket")
33AC_CHECK_LIB(nsl,gethostbyname,LIBS="$LIBS -lnsl")
34
35dnl Check for SDL
36SDL_VERSION=1.1.6
37AM_PATH_SDL($SDL_VERSION, :,
38    AC_MSG_ERROR([*** SDL version $SDL_VERSION or above not found!]))
39CFLAGS="$CFLAGS $SDL_CFLAGS"
40LIBS="$LIBS $SDL_LIBS $X_LIBS -L/usr/lib"
41
42# Optimizations
43CPPFLAGS="${CPPFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
44# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
45CPPFLAGS="${CPPFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Waggregate-return -Wsign-compare"
46
47dnl Checks for header files
48AC_HEADER_DIRENT
49AC_HEADER_STDC
50AC_CHECK_HEADERS(fcntl.h malloc.h string.h sys/ioctl.h sys/time.h unistd.h)
51
52dnl Checks for functions
53AC_FUNC_MEMCMP
54AC_CHECK_FUNCS(atexit on_exit strstr gettimeofday)
55
56dnl Check for OpenGL
57dnl Should this be more thorough?
58dnl For OpenGL support on OSX it's better to use Project Builder as -lGL
59dnl doesn't seem to work this way.
60AC_MSG_CHECKING(for OpenGL support)
61have_opengl=no
62AC_TRY_COMPILE([
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
71],[
72],[
73have_opengl=yes
74])
75AC_MSG_RESULT($have_opengl)
76if test x$have_opengl = xyes; then
77    CFLAGS="$CFLAGS -DHAVE_OPENGL"
78    CXXFLAGS="$CXXFLAGS -DHAVE_OPENGL"
79    LIBS="$LIBS -lGL -lpthread"
80fi
81
82AC_OUTPUT([
83    Makefile
84    abuse.6
85    src/Makefile
86    src/lisp/Makefile
87    src/net/Makefile
88    src/imlib/Makefile
89    src/sdlport/Makefile])
90
91echo "
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
98Now type 'make' to build $PACKAGE.
99"
Note: See TracBrowser for help on using the repository browser.