1
2AC_INIT(src/main.cpp)
3VERSION=0.1.8
4PACKAGE=zatacka
5AM_CONFIG_HEADER(config.h)
6AM_INIT_AUTOMAKE($PACKAGE,"$VERSION")
7CFLAGS="$CFLAGS"
8
9dnl Determine default prefix
10if test "x$prefix" = "xNONE"; then
11  prefix="/usr/local"
12fi
13
14AC_PROG_CC
15AC_PROG_CPP
16AC_PROG_CXX
17AC_PROG_INSTALL
18AC_PROG_MAKE_SET
19
20dnl ---- Checks for header files.
21
22AC_HEADER_DIRENT
23AC_HEADER_STDC
24AC_HEADER_SYS_WAIT
25AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h)
26
27
28AC_ARG_WITH(sdl,     [  --with-sdl              build SDL interface], [], [with_sdl=yes])
29
30
31if test "$with_sdl" != "no" ; then
32AC_CHECK_PROG(SDL_CONFIG, sdl-config,yes)
33if test x$SDL_CONFIG = "x"; then
34  AC_MSG_ERROR([SDL_CONFIG not found!!! Install sdl libs])
35fi
36
37if test "$SDL_CONFIG" ; then
38SDL_LIBS="`sdl-config --libs`"
39SDL_CFLAGS="`sdl-config --cflags`"
40INCS="$INCS $SDL_CFLAGS"
41AC_CHECK_LIB(SDL, SDL_Init, [
42AC_CHECK_HEADERS(SDL/SDL.h, ,[
43AC_MSG_ERROR(SDL found but headers are missing!!)
44with_sdl=no
45])], [with_sdl=no], $SDL_LIBS)
46
47AC_CHECK_LIB(SDL_image, IMG_Load, ,[
48AC_MSG_ERROR([SDL_image libs and headers are missing!! Install sdl-image libs])
49], $SDL_LIBS)
50SDL_LIBS="$SDL_LIBS -lSDL_image"
51
52AC_CHECK_LIB(SDL_ttf, TTF_OpenFont, ,[
53AC_MSG_ERROR([SDL_ttf libs and headers are missing!! Install sdl-ttf libs])
54], $SDL_LIBS)
55SDL_LIBS="$SDL_LIBS -lSDL_ttf"
56
57else
58with_sdl=no
59fi
60fi
61
62AC_SUBST(SDL_CFLAGS)
63AC_SUBST(SDL_LIBS)
64
65CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
66LIBS="$LIBS $SDL_LIBS"
67
68dnl Determine if maintainer portions of the Makefiles should be included.
69dnl AM_MAINTAINER_MODE
70
71dnl datadir
72DEFAULT_LIBDIR="$datadir"
73AC_SUBST(DEFAULT_LIBDIR)
74
75
76dnl Print results
77AC_MSG_RESULT([])
78AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
79AC_MSG_RESULT([])
80AC_MSG_RESULT([Using '$DEFAULT_PREFIX' for installation.])
81AC_MSG_RESULT([Using '$DEFAULT_LIBDIR' for installation libraries.])
82AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
83AC_MSG_RESULT([Building with '$SDL_CFLAGS' for C++ compiler flags.])
84AC_MSG_RESULT([Building with '$SDL_LIBS' for linker flags.])
85AC_MSG_RESULT([])
86
87AC_OUTPUT(Makefile
88src/Makefile
89)
90