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