1 #!/bin/sh
2 #
3 # autogen.sh glue from CMU Cyrus IMAP
4 # $Id$
5 #
6 # Requires: automake, autoconf, dpkg-dev
7 # set -e
9 MAKE=$(which gnumake)
10 if test ! -x "$MAKE" ; then MAKE=$(which gmake) ; fi
11 if test ! -x "$MAKE" ; then MAKE=$(which make) ; fi
12 HAVE_GNU_MAKE=$($MAKE --version|grep -c "Free Software Foundation")
14 if test "$HAVE_GNU_MAKE" != "1"; then
15 echo Could not find GNU make on this system, can not proceed with build.
16 exit 1
17 else
18 echo Found GNU Make at $MAKE ... good.
19 fi
21 # Refresh GNU autotools toolchain.
22 for i in config.guess config.sub missing install-sh mkinstalldirs ; do
23 test -r /usr/share/automake/${i} && {
24 rm -f ${i}
25 cp /usr/share/automake/${i} .
26 }
27 chmod 755 ${i}
28 done
30 aclocal -I lib
31 autoheader
32 automake --add-missing --copy
33 autoconf
35 if [ -f debian/rules ] ; then
36 chmod +x debian/rules
37 fi
39 # Lots of fiddling as Solaris' which command does give error if which fails
40 docbook=0
41 if [ `uname -s` = "SunOS" ] ; then
42 if [ "`which docbook2html`" = "/"* ] ; then
43 docbook=1
44 fi
45 else
46 if which docbook2html ; then
47 docbook=1
48 fi
49 fi
51 if [ $docbook = 1 ] ; then
52 cd doc && make
53 fi