1AC_INIT(README)
2
3AC_CHECK_PROG(GNU_MAKE,make,yes)
4AC_PROG_INSTALL
5AC_PATH_PROG(EBOARDCONFIG,eboard-config,no)
6
7if test "$EBOARDCONFIG" != "no"; then
8	AC_MSG_CHECKING(for eboard >= 0.3.1)
9	echo "0.3.1" > vfile1
10	$EBOARDCONFIG --version >> vfile1
11	sort <vfile1 >vfile2
12
13	echo "0.3.2" > vfile3
14	$EBOARDCONFIG --version >> vfile3
15	sort <vfile3 >vfile4
16
17	if ! diff -q vfile1 vfile2 >/dev/null ; then
18		rm -f vfile1 vfile2 vfile3 vfile4
19		AC_MSG_RESULT(no)
20		AC_MSG_ERROR(you need eboard 0.3.1 or newer)
21	else
22		rm -f vfile1 vfile2
23		AC_MSG_RESULT(yes)
24	fi
25else
26	AC_MSG_ERROR(you don't seem to have eboard >= 0.3.1 installed.)
27fi
28
29if ! diff -q vfile3 vfile4 >/dev/null ; then
30	MY_TARGET=compatible-install
31else
32	MY_TARGET=newer-install
33fi
34
35rm -f vfile3 vfile4
36
37AC_SUBST(MY_TARGET)
38
39DATADIR=`$EBOARDCONFIG --datadir`
40AC_SUBST(DATADIR)
41
42AC_OUTPUT(Makefile)
43
44echo "Now become root and type 'make install' to install eboard-extras"
45