summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 29a898b1ab7516a1f5abdc02d663b2dd8d12c040 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
AC_PREREQ(2.59)
AC_INIT([TMW Server], [0.0.1], [b_lindeijer@users.sourceforge.net])
AC_CONFIG_HEADERS([config.h:config.h.in])
AM_INIT_AUTOMAKE

# Check with pkg-config
PKG_CHECK_MODULES(SQLITE, [sqlite3 >= 3.0.6], 
    [],
    [AC_MSG_ERROR([Cannot find SQLite 3])]
)

AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_RANLIB

# Checks for libraries.
AC_CHECK_LIB([physfs], [PHYSFS_init])
AC_CHECK_LIB([SDL_net], [SDLNet_Init])

AC_ARG_WITH(scripting,[  --with-scripting       Build with scripting])
if test "x$with_scripting" == "xyes"; then
    AC_CHECK_LIB([squirrel], [sq_open], ,
      AC_MSG_ERROR([Cannot find Squirrel library (squirrel.sf.net)]))

    with_scripting=yes
    SCRIPT_CFLAGS=' -DSCRIPT_SUPPORT'
    SCRIPT_LIBS=' -lsquirrel -lsqstdlib'
    AC_SUBST(SCRIPT_CFLAGS)
    AC_SUBST(SCRIPT_LIBS)
else
    with_scripting=no
fi


# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([string.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST

# Checks for library functions.
AC_CHECK_FUNCS([atexit])

AC_CONFIG_FILES([Makefile
                 src/Makefile])
AC_OUTPUT

echo
echo "Building with scripting support: $with_scripting"