summaryrefslogtreecommitdiffstats
path: root/autogen.sh
blob: b833a3083e3463108240b7f81905e03e37745df5 (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
#!/bin/sh
#
# autogen.sh glue for 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 depcomp; do
	test -r /usr/share/automake/${i} && {
		rm -f ${i}
	}
done

tools/setup

# For the Debian build
test -d debian && {
	# Kill executable list first
	rm -f debian/executable.files

	# Make sure our executable and removable lists won't be screwed up
	debclean && echo Cleaned buildtree just in case...

	# refresh list of executable scripts, to avoid possible breakage if
	# upstream tarball does not include the file or if it is mispackaged
	# for whatever reason.
	echo Generating list of executable files...
	rm -f debian/executable.files
	find -type f -perm +111 ! -name '.*' -fprint debian/executable.files

	# link these in Debian builds
	rm -f config.sub config.guess
	ln -s /usr/share/misc/config.sub .
	ln -s /usr/share/misc/config.guess .
}

./configure $*

exit 0