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