source: abuse/trunk/configure.ac @ 32

Last change on this file since 32 was 32, checked in by Sam Hocevar, 12 years ago
  • Reorganised build system: + Renamed configure.in to configure.ac. + Add a bootstrap script. + Put autotools files in .auto/. + svn:ignore generated files.
File size: 2.2 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
44dnl Checks for header files
45AC_HEADER_DIRENT
46AC_HEADER_STDC
47AC_CHECK_HEADERS(fcntl.h malloc.h string.h sys/ioctl.h sys/time.h unistd.h)
48
49dnl Checks for functions
50AC_FUNC_MEMCMP
51AC_CHECK_FUNCS(atexit on_exit strstr gettimeofday)
52
53dnl Check for OpenGL
54dnl Should this be more thorough?
55dnl For OpenGL support on OSX it's better to use Project Builder as -lGL
56dnl doesn't seem to work this way.
57AC_MSG_CHECKING(for OpenGL support)
58have_opengl=no
59AC_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],[
70have_opengl=yes
71])
72AC_MSG_RESULT($have_opengl)
73if test x$have_opengl = xyes; then
74                CFLAGS="$CFLAGS -DHAVE_OPENGL"
75                CXXFLAGS="$CXXFLAGS -DHAVE_OPENGL"
76                LIBS="$LIBS -lGL -lpthread"
77fi
78
79AC_OUTPUT([Makefile
80                abuse-sdl.6
81                src/Makefile
82                src/net/Makefile
83                src/imlib/Makefile
84                src/sdlport/Makefile])
85
86echo "
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
93Now type 'make' to build $PACKAGE.
94"
Note: See TracBrowser for help on using the repository browser.