aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: a32c9c1ff3a7fb1518fa9e067019b3e7448020f8 (plain)
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
dnl Process this file with autoconf to produce a configure script.

AC_INIT(openmoocow, 0.1.0, taw27@srcf.ucam.org)
VERSION=AC_PACKAGE_VERSION

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(openmoocow, "$VERSION")

AC_PROG_CC
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S

AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
AC_C_CONST
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([strdup])

if test -z "$PKG_CONFIG"; then
	AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" = "no" ; then
	echo "*** pkg-config not found.  Do you have pkg-config installed?"
fi

AM_PATH_GTK_2_0(2.0.0,,AC_MSG_ERROR([
*** GTK+ 2.6.0 or above is required by OpenMooCow but no GTK+2 was found.
*** Please make sure you have the GTK+ development files installed. The
*** latest version of GTK+ is always available at http://www.gtk.org/.]))

AC_MSG_CHECKING([SDL])
if $PKG_CONFIG sdl ; then
        LIBSDL_CFLAGS=`$PKG_CONFIG --cflags sdl`
        LIBSDL_LIBS=`$PKG_CONFIG --libs sdl`
        AC_MSG_RESULT([yes])
else
        AC_MSG_RESULT([not found])
        AC_MSG_ERROR([*** SDL not found.  Do you have 'libsdl-dev' or similar installed?])
fi

CFLAGS="$CFLAGS $GTK_CFLAGS $LIBSDL_CFLAGS"
LIBS="$LIBS $GTK_LIBS $LIBSDL_LIBS"

AC_OUTPUT(Makefile src/Makefile data/Makefile)