d647316a4581a31c57fd3e0b800130f5c29422b8
[claws.git] / autogen.sh
1 #!/bin/sh
2 # This file is part of Claws Mail package.
3 # See COPYING file for license details.
4
5 # ***** W32 build script *******
6 # Used to cross-compile for Windows.
7 if test "$1" = "--build-w32"; then
8     tmp=`dirname $0`
9     tsdir=`cd "$tmp"; pwd`
10     shift
11     if [ ! -f $tsdir/config/config.guess ]; then
12         echo "$tsdir/config/config.guess not found" >&2
13         exit 1
14     fi
15     build=`$tsdir/config/config.guess`
16
17     [ -z "$w32root" ] && w32root="$HOME/w32root"
18     echo "Using $w32root as standard install directory" >&2
19     
20     if i586-mingw32msvc-gcc --version >/dev/null 2>&1 ; then
21         host=i586-mingw32msvc
22         crossbindir=/usr/$host/bin
23     else
24        echo "Debian's mingw32 cross-compiler packet is required" >&2
25        exit 1
26     fi
27    
28     if [ -f "$tsdir/config.log" ]; then
29         if ! head $tsdir/config.log | grep "$host" >/dev/null; then
30             echo "Pease run a 'make distclean' first" >&2
31             exit 1
32         fi
33     fi
34
35     ./configure --enable-maintainer-mode --prefix=${w32root}  \
36              --host=i586-mingw32msvc --build=${build} \
37              --with-lib-prefix=${w32root} \
38              --with-libiconv-prefix=${w32root} \
39              --with-gpg-error-prefix=${w32root} \
40              --with-gpgme-prefix=${w32root} \
41              --with-config-dir="Claws-mail" \
42              --disable-openssl --disable-dillo-viewer-plugin \
43              --disable-nls --disable-libetpan --disable-enchant \
44              --disable-trayicon-plugin --disable-spamassassin-plugin \
45              --disable-bogofilter-plugin --disable-valgrind \
46              PKG_CONFIG_LIBDIR="$w32root/lib/pkgconfig"
47
48     rc=$?
49     exit $rc
50 fi
51 # ***** end W32 build script *******
52
53 bisonver=`bison --version`
54
55 if [ "$bisonver" = "" ]; then
56         echo Bison is needed to compile Claws Mail git
57         exit 1
58 fi
59
60 if [ "$LEX" != "" ]; then
61         flexver=`$LEX --version|sed "s/.* //"`
62 else
63         flexver=`flex --version|sed "s/.* //"`
64 fi
65
66 if [ "$flexver" = "" ]; then
67         echo Flex 2.5.31 or greater is needed to compile Claws Mail git
68         exit 1
69 else
70         flex_major=`echo $flexver|sed "s/\..*//"`
71         flex_minor=`echo $flexver|sed "s/$flex_major\.\(.*\)\..*/\1/"`
72         flex_micro=`echo $flexver|sed "s/$flex_major\.$flex_minor\.\(.*\)/\1/"`
73         if [ $flex_major -lt 2 -o $flex_minor -lt 5 -o $flex_micro -lt 31 ]; then
74                 echo Flex 2.5.31 or greater is needed to compile Claws Mail git
75                 exit 1
76         fi
77 fi
78
79 intltoolver=`intltoolize --version`
80 if [ "$intltoolver" = "" ]; then
81         echo intltool is needed to compile Claws Mail git
82         exit 1
83 fi
84
85 aclocal -I m4 \
86   && libtoolize --force --copy \
87   && autoheader \
88   && automake --add-missing --foreign --copy \
89   && autoconf \
90   && intltoolize -f --automake
91 if test -z "$NOCONFIGURE"; then
92 exec ./configure --enable-maintainer-mode $@
93 fi