Code

Solaris package build system
[nagiosplug.git] / autogen.sh
1 #!/bin/sh
2 #
3 # autogen.sh glue for 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 depcomp; do
23         test -r /usr/share/automake/${i} && {
24                 rm -f ${i}
25         }
26 done
28 tools/setup
30 # For the Debian build
31 test -d debian && {
32         # Kill executable list first
33         rm -f debian/executable.files
35         # Make sure our executable and removable lists won't be screwed up
36         debclean && echo Cleaned buildtree just in case...
38         # refresh list of executable scripts, to avoid possible breakage if
39         # upstream tarball does not include the file or if it is mispackaged
40         # for whatever reason.
41         echo Generating list of executable files...
42         rm -f debian/executable.files
43         find -type f -perm +111 ! -name '.*' -fprint debian/executable.files
45         # link these in Debian builds
46         rm -f config.sub config.guess
47         ln -s /usr/share/misc/config.sub .
48         ln -s /usr/share/misc/config.guess .
49 }
51 ./configure $*
53 exit 0