Code

501ae2095c7c921c65c703010dd944de336d371b
[nagiosplug.git] / tools / setup
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 ( cd m4 && $MAKE -f Makefile.am Makefile.am.in )
23 # This bit is to fix SF's compile server as libtool not installed by default
24 extra=""
25 if test -d $HOME/share/aclocal ; then
26         extra="-I $HOME/share/aclocal"
27 fi
29 # I think gettext no longer necessary, as all necessary files imported from coreutils
30 #autopoint --force
31 aclocal -I m4 $extra
32 libtoolize --force --copy
33 autoheader
34 automake --add-missing --force-missing --copy
35 autoconf
37 if [ -f debian/rules ] ; then
38   chmod +x debian/rules
39 fi
41 # Lots of fiddling as Solaris' which command does give error if which fails
42 docbook=0
43 if [ `uname -s` = "SunOS" ] ; then
44         if [ "`which docbook2html`" = "/"* ] ; then
45                 docbook=1
46         fi
47 else
48         if which docbook2html >/dev/null 2>&1; then
49                 docbook=1
50         fi
51 fi
53 if [ $docbook = 1 ] ; then
54         cd doc && make
55 fi