diff options
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..0357d93 --- /dev/null +++ b/autogen.sh | |||
@@ -0,0 +1,58 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # autogen.sh glue for CMU Cyrus IMAP | ||
4 | # $Id$ | ||
5 | # | ||
6 | # Requires: automake, autoconf, dpkg-dev | ||
7 | # set -e | ||
8 | |||
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") | ||
13 | |||
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 | ||
20 | |||
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 | ||
29 | |||
30 | aclocal -I lib | ||
31 | autoheader | ||
32 | automake -c -a | ||
33 | autoconf | ||
34 | |||
35 | # For the Debian build | ||
36 | test -d debian && { | ||
37 | # Kill executable list first | ||
38 | rm -f debian/executable.files | ||
39 | |||
40 | # Make sure our executable and removable lists won't be screwed up | ||
41 | debclean && echo Cleaned buildtree just in case... | ||
42 | |||
43 | # refresh list of executable scripts, to avoid possible breakage if | ||
44 | # upstream tarball does not include the file or if it is mispackaged | ||
45 | # for whatever reason. | ||
46 | echo Generating list of executable files... | ||
47 | rm -f debian/executable.files | ||
48 | find -type f -perm +111 ! -name '.*' -fprint debian/executable.files | ||
49 | |||
50 | # link these in Debian builds | ||
51 | rm -f config.sub config.guess | ||
52 | ln -s /usr/share/misc/config.sub . | ||
53 | ln -s /usr/share/misc/config.guess . | ||
54 | } | ||
55 | |||
56 | ./configure $* | ||
57 | |||
58 | exit 0 | ||