source: abuse/trunk/configure.in @ 2

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