source: abuse/trunk/configure.ac @ 62

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