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