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