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