Towards 2.0.6.
[idzebra-moved-to-github.git] / buildconf.sh
1 #!/bin/sh
2 # $Id: buildconf.sh,v 1.25 2006-11-23 18:42:48 adam Exp $
3
4 automake=automake
5 aclocal=aclocal
6 autoconf=autoconf
7 libtoolize=libtoolize
8
9 if [ "`uname -s`" = FreeBSD ]; then
10     # FreeBSD intalls the various auto* tools with version numbers
11     echo "Using special configuration for FreeBSD ..."
12     automake=automake19
13     aclocal="aclocal19 -I /usr/local/share/aclocal"
14     autoconf=autoconf259
15     libtoolize=libtoolize15
16 fi
17
18 if $automake --version|head -1 |grep '1\.[4-7]'; then
19     echo "automake 1.4-1.7 is active. You should use automake 1.8 or later"
20     if test -f /etc/debian_version; then
21         echo " sudo apt-get install automake1.9"
22         echo " sudo update-alternatives --config automake"
23     fi
24     exit 1
25 fi
26
27 set -x
28 # I am tired of underquoted warnings for Tcl macros
29 $aclocal -I m4 2>&1 | grep -v aclocal/tcl.m4
30 $libtoolize --automake --force 
31 $automake -a 
32 $autoconf
33 set -
34 if [ -f config.cache ]; then
35         rm config.cache
36 fi
37
38 enable_configure=false
39 enable_help=true
40 sh_flags=""
41 conf_flags=""
42 case $1 in
43     -d)
44         sh_flags="-g -Wall -O0 -Wdeclaration-after-statement -Wstrict-prototypes"
45         enable_configure=true
46         enable_help=false
47         shift
48         ;;
49     -p)
50         sh_flags="-g -pg -Wall -Wdeclaration-after-statement -Wstrict-prototypes"
51         enable_configure=true
52         enable_help=false
53         shift
54         ;;
55     -o)
56         sh_flags="-g -Wall -O3 -Wdeclaration-after-statement -Wstrict-prototypes"
57         enable_configure=true
58         enable_help=false
59         shift
60         ;;
61     -c)
62         sh_flags=""
63         enable_configure=true
64         enable_help=false
65         shift
66         ;;
67 esac
68
69 if $enable_configure; then
70     if test -n "$sh_flags"; then
71         CFLAGS="$sh_flags" ./configure --disable-shared $*
72     else
73         ./configure $*
74     fi
75 fi
76 if $enable_help; then
77     cat <<EOF
78
79 Build the Makefiles with the configure command.
80   ./configure [--someoption=somevalue ...]
81
82 For help on options or configuring run
83   ./configure --help
84
85 Build and install binaries with the usual
86   make
87   make check
88   make install
89
90 Build distribution tarball with
91   make dist
92
93 Verify distribution tarball with
94   make distcheck
95
96 Or just build the Debian packages without configuring
97   dpkg-buildpackage -rfakeroot
98
99 When building from a CVS checkout, you need these Debian packages:
100   docbook, docbook-xml, docbook-xsl, xsltproc,
101   libyaz-dev, libexpat1-dev, tcl8.4-dev, libbz2-dev
102 and if you want the Alvis/XSLT filter, you also need:
103   libxslt1-dev
104 EOF
105 fi