source: abuse/trunk/configure.ac @ 40

Last change on this file since 40 was 40, checked in by Sam Hocevar, 15 years ago
  • Fix a few more warnings.
  • Remove -Wshadow from the warnings because it is too verbose for now.
  • Remove warning flags that have no meaning in C++.
File size: 2.5 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(abuse, 0.7.0)
3AC_CONFIG_AUX_DIR(.auto)
4AM_INIT_AUTOMAKE
5
6dnl Version information
7VERSION="0.7.0"
8
9dnl Checks for programs.
10AC_PROG_LIBTOOL
11AC_ISC_POSIX
12AC_PROG_CC
13AC_PROG_CPP
14AC_PROG_CXX
15AC_PROG_INSTALL
16AC_C_BIGENDIAN
17
18dnl Check for X
19AC_PATH_X
20X_LIBS=-L$x_libraries
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 -L/usr/lib"
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([Makefile
85                abuse-sdl.6
86                src/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.