summaryrefslogtreecommitdiffstats
path: root/tools/setup
blob: 6f3fdee982814e0b3e2c46bf99f96ccc2110a8cb (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
48
49
50
51
52
53
54
#!/bin/sh
#
# autogen.sh glue from CMU Cyrus IMAP
# $Id$
#
# Requires: automake, autoconf, dpkg-dev
# set -e

MAKE=`which gnumake`
if test ! -x "$MAKE" ; then MAKE=`which gmake` ; fi
if test ! -x "$MAKE" ; then MAKE=`which make` ; fi
HAVE_GNU_MAKE=`$MAKE --version|grep -c "Free Software Foundation"`

if test "$HAVE_GNU_MAKE" != "1"; then 
	echo Could not find GNU make on this system, can not proceed with build.
	exit 1
else
	echo Found GNU Make at $MAKE ... good.
fi

# Refresh GNU autotools toolchain.
for i in config.guess config.sub missing install-sh mkinstalldirs ; do
	test -r /usr/share/automake/${i} && {
		rm -f ${i}
		cp /usr/share/automake/${i} .
	}
	chmod 755 ${i}
done

aclocal -I lib
autoheader
automake --add-missing --copy
autoconf
autopoint --force

if [ -f debian/rules ] ; then
  chmod +x debian/rules
fi

# Lots of fiddling as Solaris' which command does give error if which fails
docbook=0
if [ `uname -s` = "SunOS" ] ; then
	if [ "`which docbook2html`" = "/"* ] ; then
		docbook=1
	fi
else
	if which docbook2html ; then
		docbook=1
	fi
fi

if [ $docbook = 1 ] ; then
	cd doc && make
fi