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